From 014c686699fe1b33dc7e4c6b3196d14fbd07181f Mon Sep 17 00:00:00 2001 From: "bzbarsky@mit.edu" Date: Sun, 11 Nov 2007 11:09:45 -0800 Subject: [PATCH] When invalidating the canvas, do a DEFERRED view batch to prevent us entering reflow under frame construction. Bug 402713, r+sr=roc, a=schrep --- layout/base/nsCSSFrameConstructor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index fe838dbcd53..9955ebc83c0 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -9927,8 +9927,14 @@ InvalidateCanvasIfNeeded(nsIFrame* aFrame) } if (ancestor != aFrame) { + // Wrap this in a DEFERRED view update batch so we don't try to + // flush out layout here + + nsIViewManager* viewManager = presContext->GetViewManager(); + viewManager->BeginUpdateViewBatch(); ApplyRenderingChangeToTree(presContext, ancestor, nsChangeHint_RepaintFrame); + viewManager->EndUpdateViewBatch(NS_VMREFRESH_DEFERRED); } }