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);  //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.maxElementSize) { // Probably not used...      aDesiredSize.maxElementSize->width = aDesiredSize.width;      aDesiredSize.maxElementSize->height = aDesiredSize.height;    }  }  nsIFrame* firstChild = mFrames.FirstChild();  if (nsnull == firstChild) {    nsCOMPtr<nsIPresShell> shell;    aPresContext->GetShell(getter_AddRefs(shell));    firstChild = new (shell.get()) nsHTMLFrameInnerFrame;    if (firstChild) {      mFrames.SetFrames(firstChild);      // Resolve the style context for the inner frame      nsresult rv = NS_OK;      nsIStyleContext *innerStyleContext = nsnull;      rv = aPresContext->ResolveStyleContextFor(mContent, mStyleContext,                                                PR_FALSE,                                                &innerStyleContext);      if (NS_SUCCEEDED(rv)) {        rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);        // have to release the context: Init does its own AddRef...        NS_RELEASE(innerStyleContext);      } else {        NS_WARNING( "Error resolving style for InnerFrame in nsHTMLFrameOuterFrame");      }      if (NS_FAILED(rv)){        NS_WARNING( "Error initializing InnerFrame in nsHTMLFrameOuterFrame");        return rv;      }    } else {      NS_WARNING("no memory allocating inner frame in nsHTMLFrameOuterFrame");      return NS_ERROR_OUT_OF_MEMORY;    }  }   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  nsHTMLReflowMetrics kidMetrics(aDesiredSize.maxElementSize);  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.maxElementSize) {      kidMetrics.maxElementSize->width += border.left + border.right;      kidMetrics.maxElementSize->height += border.top + border.bottom;    }  }  // Place and size the child  FinishReflowChild(firstChild, aPresContext, kidMetrics, offset.x, offset.y, 0);  NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,     ("exit nsHTMLFrameOuterFrame::Reflow: size=%d,%d status=%x",      aDesiredSize.width, aDesiredSize.height, aStatus));  return NS_OK;}