NS_ASSERTION(nsnull != aReflowState.reflowCommand, "no reflow command");
RootFrame::Reflow(nsIPresContext&          aPresContext,                  nsHTMLReflowMetrics&     aDesiredSize,                  const nsHTMLReflowState& aReflowState,                  nsReflowStatus&          aStatus){  NS_FRAME_TRACE_REFLOW_IN("RootFrame::Reflow");  aStatus = NS_FRAME_COMPLETE;  if (eReflowReason_Incremental == aReflowState.reason) {    // We don't expect the target of the reflow command to be the root frame#ifdef NS_DEBUG    NS_ASSERTION(nsnull != aReflowState.reflowCommand, "no reflow command");    nsIFrame* target;    aReflowState.reflowCommand->GetTarget(target);    NS_ASSERTION(target != this, "root frame is reflow command target");#endif      // Verify that the next frame in the reflow chain is our pseudo frame    nsIFrame* next;    aReflowState.reflowCommand->GetNext(next);    NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");  }  // Reflow our pseudo frame. It will choose whetever height its child frame  // wants  if (nsnull != mFirstChild) {    nsHTMLReflowMetrics desiredSize(nsnull);    nsHTMLReflowState kidReflowState(aPresContext, mFirstChild, aReflowState,                                     aReflowState.maxSize);    // XXX HACK    kidReflowState.widthConstraint = eHTMLFrameConstraint_Fixed;    kidReflowState.minWidth = aReflowState.maxSize.width;    kidReflowState.heightConstraint = eHTMLFrameConstraint_Fixed;    kidReflowState.minHeight = aReflowState.maxSize.height;    nsIHTMLReflow* htmlReflow;    if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {      ReflowChild(mFirstChild, aPresContext, desiredSize, kidReflowState, aStatus);          // Place and size the child      nsRect  rect(0, 0, desiredSize.width, desiredSize.height);      mFirstChild->SetRect(rect);      // XXX We should resolve the details of who/when DidReflow() notifications      // are sent...      htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);    }  }  // Return the max size as our desired size  aDesiredSize.width = aReflowState.maxSize.width;  aDesiredSize.height = aReflowState.maxSize.height;  aDesiredSize.ascent = aDesiredSize.height;  aDesiredSize.descent = 0;  NS_FRAME_TRACE_REFLOW_OUT("RootFrame::Reflow", aStatus);  return NS_OK;}