viewManager->EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);
viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
ApplyRenderingChangeToTree(nsPresContext* aPresContext,                           nsIFrame* aFrame,                           nsIViewManager* aViewManager,                           nsChangeHint aChange){  nsIPresShell *shell = aPresContext->PresShell();  PRBool isPaintingSuppressed = PR_FALSE;  shell->IsPaintingSuppressed(&isPaintingSuppressed);  if (isPaintingSuppressed) {    // Don't allow synchronous rendering changes when painting is turned off.    aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame);    if (!aChange) {      return;    }  }  // If the frame's background is propagated to an ancestor, walk up to  // that ancestor.  const nsStyleBackground *bg;  PRBool isCanvas;  while (!nsCSSRendering::FindBackground(aPresContext, aFrame,                                         &bg, &isCanvas)) {    aFrame = aFrame->GetParent();    NS_ASSERTION(aFrame, "root frame must paint");  }  nsIViewManager* viewManager = aViewManager;  if (!viewManager) {    viewManager = aPresContext->GetViewManager();  }  // Trigger rendering updates by damaging this frame and any  // continuations of this frame.  // XXX this needs to detect the need for a view due to an opacity change and deal with it...  viewManager->BeginUpdateViewBatch();#ifdef DEBUG  gInApplyRenderingChangeToTree = PR_TRUE;#endif  DoApplyRenderingChangeToTree(aPresContext, aFrame, viewManager,                               shell->FrameManager(), aChange);#ifdef DEBUG  gInApplyRenderingChangeToTree = PR_FALSE;#endif    // Use NS_VMREFRESH_DEFERRED here so that any reflows that may be coming from  // the same restyle as called this function will get a chance to be processed  // before we do the widget invalidates from DoApplyRenderingChangeToTree.  viewManager->EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);}