From e8749977257ee5a6b1828f027025cd3b78e308e8 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 26 Sep 2005 21:34:40 +0000 Subject: [PATCH] Make sure to flush out the content model before processing restyles; otherwise we can end up with odd content duplication. Bug 309986, r+sr=dbaron, a=schrep git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@180991 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index ee407c1c521..2bdf573a8a5 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -13780,7 +13780,16 @@ void nsCSSFrameConstructor::RestyleEvent::HandleEvent() { NS_ASSERTION(viewManager, "Must have view manager for update"); viewManager->BeginUpdateViewBatch(); + // Force flushing of any pending content notifications that might have queued + // up while our event was pending. That will ensure that we don't construct + // frames for content right now that's still waiting to be notified on, + constructor->mPresShell->GetDocument()-> + FlushPendingNotifications(Flush_ContentAndNotify); + + // Make sure that any restyles that happen from now on will go into + // a new event. constructor->mRestyleEventQueue = nsnull; + constructor->ProcessPendingRestyles(); viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC); }