PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
PresShell::ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight)
PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight){  StCaretHider  caretHider(this);			// stack-based class hides caret until dtor.  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...  nsIFrame* rootFrame;  mFrameManager->GetRootFrame(&rootFrame);  if (rootFrame) {    // Kick off a top-down reflow    NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,                 ("enter nsPresShell::ResizeReflow: %d,%d", aWidth, aHeight));#ifdef NS_DEBUG    if (nsIFrameDebug::GetVerifyTreeEnable()) {      nsIFrameDebug*  frameDebug;      if (NS_SUCCEEDED(rootFrame->QueryInterface(NS_GET_IID(nsIFrameDebug),                                                 (void**)&frameDebug))) {        frameDebug->VerifyTree();      }    }#endif#ifdef DEBUG_kipp    nsPresShell_ReflowStackPointerTop = (char*) &aWidth;#endif    nsRect                bounds;    mPresContext->GetVisibleArea(bounds);    nsSize                maxSize(bounds.width, bounds.height);    nsHTMLReflowMetrics   desiredSize(nsnull);    nsReflowStatus        status;    nsIRenderingContext*  rcx = nsnull;    nsresult rv=CreateRenderingContext(rootFrame, &rcx);	if (NS_FAILED(rv)) return rv;    nsHTMLReflowState reflowState(mPresContext, rootFrame,                                  eReflowReason_Resize, rcx, maxSize);    nsIView*          view;    rootFrame->WillReflow(mPresContext);    rootFrame->GetView(mPresContext, &view);    if (view) {      nsContainerFrame::PositionFrameView(mPresContext, rootFrame, view);    }    rootFrame->Reflow(mPresContext, desiredSize, reflowState, status);    rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);    if (view) {      nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, rootFrame, view,                                                 nsnull);    }    rootFrame->DidReflow(mPresContext, NS_FRAME_REFLOW_FINISHED);#ifdef NS_DEBUG    if (nsIFrameDebug::GetVerifyTreeEnable()) {      nsIFrameDebug*  frameDebug;      if (NS_SUCCEEDED(rootFrame->QueryInterface(NS_GET_IID(nsIFrameDebug),                                                 (void**)&frameDebug))) {        frameDebug->VerifyTree();      }    }#endif    VERIFY_STYLE_TREE;    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(PR_TRUE);    return NS_OK; //XXX this needs to be real. MMP}