Flush tags before calling StartLayout; otherwise we might end updouble-constructing frames for whatever content we hadn't notified on yet. Bug378559, r+sr=sicking MOZILLA_1_9_a4_BASE
authorbzbarsky@mit.edu
Thu, 26 Apr 2007 11:57:58 -0700
changeset 845 df7a3c8ffeeaba229067efee5a20e21dae0dd877
parent 844 a39fcc86115d533010cac63304e385e6156c09a0
child 846 6100d773079af1e8bd0e929f62edbf207f3be758
push idunknown
push userunknown
push dateunknown
bugs378559
milestone1.9a4pre
Flush tags before calling StartLayout; otherwise we might end updouble-constructing frames for whatever content we hadn't notified on yet. Bug378559, r+sr=sicking
content/base/src/nsContentSink.cpp
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -899,16 +899,24 @@ nsContentSink::StartLayout(PRBool aIgnor
 
   if (!aIgnorePendingSheets && mPendingSheetCount > 0) {
     // Bail out; we'll start layout when the sheets load
     return;
   }
 
   mDeferredLayoutStart = PR_FALSE;
 
+  // Notify on all our content.  If none of our presshells have started layout
+  // yet it'll be a no-op except for updating our data structures, a la
+  // UpdateChildCounts() (because we don't want to double-notify on whatever we
+  // have right now).  If some of them _have_ started layout, we want to make
+  // sure to flush tags instead of just calling UpdateChildCounts() after we
+  // loop over the shells.
+  FlushTags();
+
   mLayoutStarted = PR_TRUE;
   mLastNotificationTime = PR_Now();
   
   PRUint32 i, ns = mDocument->GetNumberOfShells();
   for (i = 0; i < ns; i++) {
     nsIPresShell *shell = mDocument->GetShellAt(i);
 
     if (shell) {