nsHTMLFrameOuterFrame::Reflow(nsIPresContext*          aPresContext,
nsHTMLFrameInnerFrame::Reflow(nsIPresContext*          aPresContext,
nsHTMLFrameOuterFrame::Reflow(nsIPresContext*          aPresContext,                              nsHTMLReflowMetrics&     aDesiredSize,                              const nsHTMLReflowState& aReflowState,                              nsReflowStatus&          aStatus){  DO_GLOBAL_REFLOW_COUNT("nsHTMLFrameOuterFrame", aReflowState.reason);  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);  //printf("OuterFrame::Reflow %X (%d,%d) \n", this, aReflowState.availableWidth, aReflowState.availableHeight);  NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,     ("enter nsHTMLFrameOuterFrame::Reflow: maxSize=%d,%d reason=%d",      aReflowState.availableWidth, aReflowState.availableHeight, aReflowState.reason));  if (IsInline()) {    GetDesiredSize(aPresContext, aReflowState, aDesiredSize); // IFRAME  } else {    aDesiredSize.width  = aReflowState.availableWidth; // FRAME    aDesiredSize.height = aReflowState.availableHeight;    if (aDesiredSize.mComputeMEW) { // Probably not used...      aDesiredSize.mMaxElementWidth = aDesiredSize.width;    }  }  nsSize innerSize(aDesiredSize.width, aDesiredSize.height);  nsPoint offset(0,0);  nsMargin border = aReflowState.mComputedBorderPadding;  if (IsInline()) {    offset.x = border.left;    offset.y = border.top;    // XXX Don't subtract the border!!! The size we are given does not include our    // border! -EDV    //innerSize.width  -= border.left + border.right;    //innerSize.height -= border.top  + border.bottom;    // we now need to add our border in. -EDV    aDesiredSize.width += border.left + border.right;    aDesiredSize.height += border.top + border.bottom;  }  // Reflow the child and get its desired size. We'll need to convert  // an incremental reflow to a dirty reflow unless our child is along  // the path.  nsIFrame* firstChild = mFrames.FirstChild();  nsHTMLReflowMetrics kidMetrics(aDesiredSize.mComputeMEW);  nsHTMLReflowState   kidReflowState(aPresContext, aReflowState, firstChild,                                     innerSize);  ReflowChild(firstChild, aPresContext, kidMetrics, kidReflowState,              offset.x, offset.y, 0, aStatus);  NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");  // For unknown reasons, the maxElementSize for the InnerFrame is used, but the  // maxElementSize for the OuterFrame is ignored, add in border here to prevent  // a table from shrinking inside the iframe's border when resized.  if (IsInline()) {    if (kidMetrics.mComputeMEW) {      kidMetrics.mMaxElementWidth += border.left + border.right;    }  }  // Place and size the child  FinishReflowChild(firstChild, aPresContext, nsnull,                    kidMetrics, offset.x, offset.y, 0);  if (aDesiredSize.mComputeMEW) {    aDesiredSize.mMaxElementWidth = kidMetrics.mMaxElementWidth;  }  // Determine if we need to repaint our border  CheckInvalidateBorder(aPresContext, aDesiredSize, aReflowState);  {    // Invalidate the frame    nsRect frameRect;    GetRect(frameRect);    nsRect rect(0, 0, frameRect.width, frameRect.height);    if (!rect.IsEmpty()) {      Invalidate(aPresContext, rect, PR_FALSE);    }  }  NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,     ("exit nsHTMLFrameOuterFrame::Reflow: size=%d,%d status=%x",      aDesiredSize.width, aDesiredSize.height, aStatus));  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);  return NS_OK;}