NS_RELEASE(root);
PresShell::InitialReflow(nscoord aWidth, nscoord aHeight){  NS_PRECONDITION(nsnull == mRootFrame, "unexpected root frame");  EnterReflowLock();  if (nsnull != mPresContext) {    nsRect r(0, 0, aWidth, aHeight);    mPresContext->SetVisibleArea(r);  }  if (nsnull == mRootFrame) {    if (nsnull != mDocument) {      nsIContent* root = mDocument->GetRootContent();      if (nsnull != root) {        // Have style sheet processor construct a frame for the        // root content object        mPresContext->ConstructFrame(root, nsnull, mRootFrame);      }    }  }  if (nsnull != mRootFrame) {    // Kick off a top-down reflow    NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,                 ("enter nsPresShell::InitialReflow: %d,%d", aWidth, aHeight));#ifdef NS_DEBUG    if (nsIFrame::GetVerifyTreeEnable()) {      mRootFrame->VerifyTree();    }#endif    nsRect          bounds;    mPresContext->GetVisibleArea(bounds);    nsSize          maxSize(bounds.width, bounds.height);    nsReflowMetrics desiredSize(nsnull);    nsReflowStatus  status;    nsReflowState   reflowState(mRootFrame, eReflowReason_Initial, maxSize);    mRootFrame->Reflow(*mPresContext, desiredSize, reflowState, status);    mRootFrame->SizeTo(desiredSize.width, desiredSize.height);#ifdef NS_DEBUG    if (nsIFrame::GetVerifyTreeEnable()) {      mRootFrame->VerifyTree();    }#endif    NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::InitialReflow"));  }  ExitReflowLock();  return NS_OK; //XXX this needs to be real. MMP}