Bug 747688. r=roc a=lsblakk
authorMats Palmgren <matspal@gmail.com>
Sat, 12 May 2012 02:09:08 +0200
changeset 94220 338785a9d6d9c06d21090114a4a8199e16e1727d
parent 94219 9d04b27de4c383c47d51f7eff35b5933f42892ca
child 94221 ca2e6ec11127beaf3eeec56528a8fc083a85e642
push id1269
push usermpalmgren@mozilla.com
push dateSat, 12 May 2012 00:08:24 +0000
treeherdermozilla-aurora@338785a9d6d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs747688
milestone14.0a2
Bug 747688. r=roc a=lsblakk
layout/generic/nsContainerFrame.cpp
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1711,40 +1711,43 @@ nsOverflowContinuationTracker::Insert(ns
   return rv;
 }
 
 void
 nsOverflowContinuationTracker::Finish(nsIFrame* aChild)
 {
   NS_PRECONDITION(aChild, "null ptr");
   NS_PRECONDITION(aChild->GetNextInFlow(),
-                "supposed to call Finish *before* deleting next-in-flow!");
+                  "supposed to call Finish *before* deleting next-in-flow!");
 
-  for (nsIFrame* f = aChild; f; f = f->GetNextInFlow()) {
-    // Make sure we drop all references if the only frame
-    // in the overflow containers list is about to be destroyed
+  for (nsIFrame* f = aChild; f; ) {
+    // Make sure we drop all references if all the frames in the
+    // overflow containers list are about to be destroyed.
+    nsIFrame* nif = f->GetNextInFlow();
     if (mOverflowContList &&
-        mOverflowContList->FirstChild() == f->GetNextInFlow() &&
-        !f->GetNextInFlow()->GetNextSibling()) {
+        mOverflowContList->FirstChild() == nif &&
+        (!nif->GetNextSibling() ||
+         nif->GetNextSibling() == nif->GetNextInFlow())) {
       mOverflowContList = nsnull;
       mPrevOverflowCont = nsnull;
       mSentry = nsnull;
       mParent = static_cast<nsContainerFrame*>(f->GetParent());
       break;
     }
     if (f == mSentry) {
       // Step past aChild
       nsIFrame* prevOverflowCont = mPrevOverflowCont;
       StepForward();
-      if (mPrevOverflowCont == f->GetNextInFlow()) {
+      if (mPrevOverflowCont == nif) {
         // Pull mPrevOverflowChild back to aChild's prevSibling:
         // aChild will be removed from our list by our caller
         mPrevOverflowCont = prevOverflowCont;
       }
     }
+    f = nif;
   }
 }
 
 /////////////////////////////////////////////////////////////////////////////
 // Debugging
 
 #ifdef NS_DEBUG
 NS_IMETHODIMP