if (nsIFrame::GetVerifyTreeEnable()) { rootFrame->VerifyTree();
if (nsIFrameDebug::GetVerifyTreeEnable()) { nsIFrameDebug*  frameDebug;  if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) { frameDebug->VerifyTree(); }
PresShell::ProcessReflowCommands(){  RAPTOR_STOPWATCH_DEBUGTRACE(("Start: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));  NS_START_STOPWATCH(mReflowWatch)  if (0 != mReflowCommands.Count()) {    nsHTMLReflowMetrics   desiredSize(nsnull);    nsIRenderingContext*  rcx;    nsIFrame*             rootFrame;    mFrameManager->GetRootFrame(&rootFrame);    CreateRenderingContext(rootFrame, &rcx);#ifdef DEBUG    if (GetVerifyReflowEnable()) {      if (VERIFY_REFLOW_ALL & gVerifyReflowFlags) {        printf("ProcessReflowCommands: begin incremental reflow\n");      }    }    if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {      PRInt32 i, n = mReflowCommands.Count();      for (i = 0; i < n; i++) {        nsIReflowCommand* rc = (nsIReflowCommand*)          mReflowCommands.ElementAt(i);        rc->List(stdout);      }    }#endif    while (0 != mReflowCommands.Count()) {      // Use RemoveElementAt in case the reflowcommand dispatches a      // new one during its execution.      nsIReflowCommand* rc = (nsIReflowCommand*) mReflowCommands.ElementAt(0);      mReflowCommands.RemoveElementAt(0);      // Dispatch the reflow command      nsSize          maxSize;      rootFrame->GetSize(maxSize);      rc->Dispatch(*mPresContext, desiredSize, maxSize, *rcx);      NS_RELEASE(rc);      VERIFY_STYLE_TREE;    }    NS_IF_RELEASE(rcx);#ifdef DEBUG    if (nsIFrame::GetVerifyTreeEnable()) {      rootFrame->VerifyTree();    }    if (GetVerifyReflowEnable()) {      // First synchronously render what we have so far so that we can      // see it.      nsIView* rootView;      mViewManager->GetRootView(rootView);      mViewManager->UpdateView(rootView, nsnull, NS_VMREFRESH_IMMEDIATE);      mInVerifyReflow = PR_TRUE;      PRBool ok = VerifyIncrementalReflow();      mInVerifyReflow = PR_FALSE;      if (VERIFY_REFLOW_ALL & gVerifyReflowFlags) {        printf("ProcessReflowCommands: finished (%s)\n",               ok ? "ok" : "failed");      }      if (0 != mReflowCommands.Count()) {        printf("XXX yikes! reflow commands queued during verify-reflow\n");      }    }#endif  }  RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));  NS_STOP_STOPWATCH(mReflowWatch)  return NS_OK;}