nsTableFrame::RecoverState(InnerTableReflowState& aReflowState, nsIFrame*              aKidFrame, nsSize*                aMaxElementSize)
nsTableFrame::RecoverState(nsTableReflowState& aReflowState, nsIFrame*           aKidFrame)
nsTableFrame::RecoverState(InnerTableReflowState& aReflowState,                           nsIFrame*              aKidFrame,                           nsSize*                aMaxElementSize){  nscoord cellSpacingY = GetCellSpacingY();  // Walk the list of children looking for aKidFrame  for (nsIFrame* childFrame = mFrames.FirstChild(); childFrame; childFrame->GetNextSibling(&childFrame)) {    nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(childFrame);    if (!rgFrame) continue; // skip foreign frame types       // If this is a footer row group, remember it    const nsStyleDisplay *display;    rgFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));    // We only allow a single footer frame, and the footer frame must occur before    // any body section row groups    if ((NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == display->mDisplay) &&        !aReflowState.footerFrame && !aReflowState.firstBodySection) {      aReflowState.footerFrame = childFrame;        }     else {      if ((NS_STYLE_DISPLAY_TABLE_ROW_GROUP == display->mDisplay) &&          !aReflowState.firstBodySection) {        aReflowState.firstBodySection = childFrame;      }      aReflowState.y += cellSpacingY;    }        // See if this is the frame we're looking for    if (childFrame == aKidFrame) {      // If it's the footer, then keep going because the footer is at the      // very bottom      if (childFrame != aReflowState.footerFrame) {        break;      }    }    // Get the frame's height    nsSize  kidSize;    childFrame->GetSize(kidSize);        // If our height is constrained then update the available height. Do    // this for all frames including the footer frame    if (PR_FALSE == aReflowState.unconstrainedHeight) {      aReflowState.availSize.height -= kidSize.height;    }    // Update the running y-offset. Don't do this for the footer frame    if (childFrame != aReflowState.footerFrame) {      aReflowState.y += kidSize.height;    }    // Update the max element size    //XXX: this should call into layout strategy to get the width field    if (nsnull != aMaxElementSize)     {      const nsStyleSpacing* tableSpacing;      GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)tableSpacing));      nsMargin borderPadding;      GetTableBorder (borderPadding); // gets the max border thickness for each edge      borderPadding += aReflowState.reflowState.mComputedPadding;      nscoord cellSpacing = GetCellSpacingX();      nsSize  kidMaxElementSize;      rgFrame->GetMaxElementSize(kidMaxElementSize);      nscoord kidWidth = kidMaxElementSize.width + borderPadding.left + borderPadding.right + cellSpacing*2;      aMaxElementSize->width = PR_MAX(aMaxElementSize->width, kidWidth);       aMaxElementSize->height += kidMaxElementSize.height;    }  }  return NS_OK;}