nsIFrame* nif; kidFrame->GetNextInFlow(&nif);
nsIFrame* nif = kidFrame->GetNextInFlow();
nsTableFrame::OrderRowGroups(nsVoidArray&           aChildren,                             PRUint32&              aNumRowGroups,                             nsIFrame**             aFirstBody,                             nsTableRowGroupFrame** aHead,                             nsTableRowGroupFrame** aFoot) const{  aChildren.Clear();  nsIFrame* head = nsnull;  nsIFrame* foot = nsnull;  // initialize out parameters, if present  if (aFirstBody) *aFirstBody = nsnull;  if (aHead)      *aHead      = nsnull;  if (aFoot)      *aFoot      = nsnull;    nsIFrame* kidFrame = mFrames.FirstChild();  nsAutoVoidArray nonRowGroups;  // put the tbodies first, and the non row groups last  while (kidFrame) {    const nsStyleDisplay* kidDisplay = kidFrame->GetStyleDisplay();    if (IsRowGroup(kidDisplay->mDisplay)) {      switch(kidDisplay->mDisplay) {      case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:        if (head) { // treat additional thead like tbody          aChildren.AppendElement(kidFrame);        }        else {          head = kidFrame;          if (aHead) {            *aHead = (nsTableRowGroupFrame*)head;          }        }        break;      case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP:        if (foot) {          aChildren.AppendElement(kidFrame);        }        else {          foot = kidFrame;          if (aFoot) {            *aFoot = (nsTableRowGroupFrame*)foot;          }        }        break;      default:        aChildren.AppendElement(kidFrame);        if (aFirstBody && !*aFirstBody) {          *aFirstBody = kidFrame;        }      }    }    else {      nonRowGroups.AppendElement(kidFrame);    }    // Get the next sibling but skip it if it's also the next-in-flow, since    // a next-in-flow will not be part of the current table.    while (kidFrame) {      nsIFrame* nif;      kidFrame->GetNextInFlow(&nif);      kidFrame = kidFrame->GetNextSibling();      if (kidFrame != nif)         break;    }  }  aNumRowGroups = aChildren.Count();  // put the thead first  if (head) {    aChildren.InsertElementAt(head, 0);    aNumRowGroups++;  }  // put the tfoot after the last tbody  if (foot) {    aChildren.InsertElementAt(foot, aNumRowGroups);    aNumRowGroups++;  }  // put the non row groups at the end  PRInt32 numNonRowGroups = nonRowGroups.Count();  for (PRInt32 i = 0; i < numNonRowGroups; i++) {    aChildren.AppendElement(nonRowGroups.ElementAt(i));  }}