innerSize.width  -= border.left + border.right; innerSize.height -= border.top  + border.bottom;
aDesiredSize.width += border.left + border.right; aDesiredSize.height += border.top + border.bottom;
nsHTMLFrameOuterFrame::Reflow(nsIPresContext&          aPresContext,                              nsHTMLReflowMetrics&     aDesiredSize,                              const nsHTMLReflowState& aReflowState,                              nsReflowStatus&          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);  } else {    aDesiredSize.width  = aReflowState.availableWidth;    aDesiredSize.height = aReflowState.availableHeight;  }  nsIFrame* firstChild = mFrames.FirstChild();  if (nsnull == firstChild) {    firstChild = new nsHTMLFrameInnerFrame;    mFrames.SetFrames(firstChild);    // XXX temporary! use style system to get correct style!    firstChild->Init(aPresContext, mContent, this, mStyleContext, nsnull);  }   nsSize innerSize(aDesiredSize.width, aDesiredSize.height);  nsPoint offset(0,0);  if (IsInline() && HasBorder()) {    const nsStyleSpacing* spacing =      (const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);    nsMargin border;    spacing->CalcBorderFor(this, border);    offset.x = border.left;    offset.y = border.right;    innerSize.width  -= border.left + border.right;    innerSize.height -= border.top  + border.bottom;  }  // Reflow the child and get its desired size  nsHTMLReflowMetrics kidMetrics(aDesiredSize.maxElementSize);  nsHTMLReflowState   kidReflowState(aPresContext, aReflowState, firstChild,                                     innerSize);  nsIHTMLReflow*      htmlReflow;  if (NS_OK == firstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {    ReflowChild(firstChild, aPresContext, kidMetrics, kidReflowState, aStatus);    NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");      // Place and size the child    nsRect rect(offset.x, offset.y, innerSize.width, innerSize.height);    firstChild->SetRect(rect);  }  // XXX what should the max-element-size of an iframe be? Shouldn't  // iframe's normally shrink wrap around their content when they  // don't have a specified width/height?  if (nsnull != aDesiredSize.maxElementSize) {    aDesiredSize.maxElementSize->width = aDesiredSize.width;    aDesiredSize.maxElementSize->height = aDesiredSize.height;  }  NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,     ("exit nsHTMLFrameOuterFrame::Reflow: size=%d,%d status=%x",      aDesiredSize.width, aDesiredSize.height, aStatus));  return NS_OK;}