SuspendCaret(); EnterReflowLock();  if (mPresContext) { nsRect r(0, 0, aWidth, aHeight); mPresContext->SetVisibleArea(r); }    if (nsnull != mRootFrame) {  NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("enter nsPresShell::ResizeReflow: %d,%d", aWidth, aHeight)); #ifdef NS_DEBUG if (nsIFrame::GetVerifyTreeEnable()) { mRootFrame->VerifyTree(); } #endif nsRect                bounds; mPresContext->GetVisibleArea(bounds); nsSize                maxSize(bounds.width, bounds.height); nsHTMLReflowMetrics   desiredSize(nsnull); nsReflowStatus        status; nsIHTMLReflow*        htmlReflow; nsIRenderingContext*  rcx = nsnull;  CreateRenderingContext(mRootFrame, &rcx);  nsHTMLReflowState reflowState(*mPresContext, mRootFrame, eReflowReason_Resize, rcx, maxSize);  if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status); mRootFrame->SizeTo(desiredSize.width, desiredSize.height); #ifdef NS_DEBUG if (nsIFrame::GetVerifyTreeEnable()) { mRootFrame->VerifyTree(); } #endif } NS_IF_RELEASE(rcx); NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::ResizeReflow"));   } else { #ifdef NOISY printf("PresShell::ResizeReflow: null root frame\n"); #endif } ExitReflowLock(); ResumeCaret();  return NS_OK;
return ResizeReflow(aWidth, aHeight);
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight){  SuspendCaret();  EnterReflowLock();  if (mPresContext) {    nsRect r(0, 0, aWidth, aHeight);    mPresContext->SetVisibleArea(r);  }  // If we don't have a root frame yet, that means we haven't had our initial  // reflow...  if (nsnull != mRootFrame) {    // Kick off a top-down reflow    NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,                 ("enter nsPresShell::ResizeReflow: %d,%d", aWidth, aHeight));#ifdef NS_DEBUG    if (nsIFrame::GetVerifyTreeEnable()) {      mRootFrame->VerifyTree();    }#endif    nsRect                bounds;    mPresContext->GetVisibleArea(bounds);    nsSize                maxSize(bounds.width, bounds.height);    nsHTMLReflowMetrics   desiredSize(nsnull);    nsReflowStatus        status;    nsIHTMLReflow*        htmlReflow;    nsIRenderingContext*  rcx = nsnull;    CreateRenderingContext(mRootFrame, &rcx);    nsHTMLReflowState reflowState(*mPresContext, mRootFrame,                                  eReflowReason_Resize, rcx, maxSize);    if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {      htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);      mRootFrame->SizeTo(desiredSize.width, desiredSize.height);#ifdef NS_DEBUG      if (nsIFrame::GetVerifyTreeEnable()) {        mRootFrame->VerifyTree();      }#endif    }    NS_IF_RELEASE(rcx);    NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, ("exit nsPresShell::ResizeReflow"));    // XXX if debugging then we should assert that the cache is empty  } else {#ifdef NOISY    printf("PresShell::ResizeReflow: null root frame\n");#endif  }  ExitReflowLock();  ResumeCaret();    return NS_OK; //XXX this needs to be real. MMP}