Fix bug 399412 - don't reflow overflow containers that are pending re-placement. r+sr=roc
authorfantasai <fantasai.cvs@inkedblade.net>
Fri, 08 May 2009 18:53:44 -0700
changeset 28158 056faf1793c7b8a730ece29dc420a45b06d711dd
parent 28157 41607e4dcc6d84ad3bfabc17d2ea2490cfa6a63d
child 28159 baf06abf0af445b9e3518d7203dcd08113770761
push id6916
push userfantasai.cvs@inkedblade.net
push dateSat, 09 May 2009 08:02:52 +0000
treeherdermozilla-central@056faf1793c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs399412
milestone1.9.2a1pre
Fix bug 399412 - don't reflow overflow containers that are pending re-placement. r+sr=roc
layout/generic/crashtests/399412-1.html
layout/generic/crashtests/crashtests.list
layout/generic/nsContainerFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/399412-1.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+
+<style id="s">
+.container {
+  height: 30px;
+}
+</style>
+
+<style>
+.overflow {
+  height: 150px;
+  border: 1px silver solid;
+}
+body {
+  height: 60px;
+  width: 300px;
+  -moz-column-width: 50px;
+  -moz-column-gap: 1px;
+}
+</style>
+
+</head>
+
+<body onload="s=document.getElementById('s'); s.parentNode.removeChild(s);">
+
+<div class="container"><div class="overflow"></div></div>
+<div class="container"><div class="overflow"></div></div>
+
+</body>
+</html>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -117,16 +117,17 @@ load 395450-1.xhtml
 load 397007-1.html
 load 397187-1.html
 load 397844-1.xhtml
 load 397844-2.xhtml
 load 397852-1.xhtml
 load 398181-1.html
 load 398181-2.html
 load 399407-1.xhtml
+load 399412-1.html
 load 399843-1.html
 load 400223-1.html
 load 400232-1.html
 load 400244-1.html
 load 401042-1.xhtml
 load 402380-1.html
 load 402380-2.html
 load 403143-1.html
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -984,16 +984,21 @@ nsContainerFrame::ReflowOverflowContaine
   }
 
   if (!overflowContainers)
     return NS_OK; // nothing to reflow
 
   nsOverflowContinuationTracker tracker(aPresContext, this, PR_FALSE, PR_FALSE);
   for (nsIFrame* frame = overflowContainers->FirstChild(); frame;
        frame = frame->GetNextSibling()) {
+    if (frame->GetPrevInFlow()->GetParent() != GetPrevInFlow()) {
+      // frame's prevInFlow has moved, skip reflowing this frame;
+      // it will get reflowed once it's been placed
+      continue;
+    }
     if (NS_SUBTREE_DIRTY(frame)) {
       // Get prev-in-flow
       nsIFrame* prevInFlow = frame->GetPrevInFlow();
       NS_ASSERTION(prevInFlow,
                    "overflow container frame must have a prev-in-flow");
       NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
                    "overflow container frame must have overflow container bit set");
       nsRect prevRect = prevInFlow->GetRect();