nscoord tableY = damageRect.y;
ProcessRowInserted(nsIPresContext* aPresContext,                   nsTableFrame&   aTableFrame,                   PRBool          aInvalidate,                   nscoord         aNewHeight){  aTableFrame.SetRowInserted(PR_FALSE); // reset the bit that got us here  nsAutoVoidArray rowGroups;  PRUint32 numRowGroups;  aTableFrame.OrderRowGroups(rowGroups, numRowGroups);  // find the row group containing the inserted row  for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {    nsTableRowGroupFrame* rgFrame = (nsTableRowGroupFrame*)rowGroups.ElementAt(rgX);    if (!rgFrame) continue; // should never happen    nsIFrame* childFrame = nsnull;    rgFrame->FirstChild(aPresContext, nsnull, &childFrame);    // find the row that was inserted first    while (childFrame) {      nsCOMPtr<nsIAtom> childType;      childFrame->GetFrameType(getter_AddRefs(childType));      if (nsLayoutAtoms::tableRowFrame == childType.get()) {        nsTableRowFrame* rowFrame = (nsTableRowFrame*)childFrame;        if (rowFrame->IsFirstInserted()) {          rowFrame->SetFirstInserted(PR_FALSE);          if (aInvalidate) {            // damage the table from the 1st row inserted to the end of the table            nsRect damageRect, rgRect, rowRect;            aTableFrame.GetRect(damageRect);            rgFrame->GetRect(rgRect);            rowFrame->GetRect(rowRect);            nscoord tableY = damageRect.y;            damageRect.y += rgRect.y + rowRect.y;             damageRect.height = aNewHeight - damageRect.y;            aTableFrame.Invalidate(aPresContext, damageRect);            aTableFrame.SetRowInserted(PR_FALSE);          }          return; // found it, so leave        }      }      childFrame->GetNextSibling(&childFrame);    }  }}