Bug 696640 - Don't put an existing next-in-flow for the kid into 'rowGroups' - it's either already there or it's not our child. r=roc
authorMats Palmgren <matspal@gmail.com>
Mon, 17 Dec 2012 02:21:36 +0100
changeset 125337 1ac4491232e58341646bb692eca957a4d6f36079
parent 125336 9431f38215421cd979d41f0cf729cc357534130e
child 125338 47bd1f6fd8ed14f3ba6811e23c5f8463533b3e64
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs696640
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 696640 - Don't put an existing next-in-flow for the kid into 'rowGroups' - it's either already there or it's not our child. r=roc
layout/tables/crashtests/696640-1.html
layout/tables/crashtests/696640-2.html
layout/tables/crashtests/crashtests.list
layout/tables/nsTableFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/tables/crashtests/696640-1.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="flags" content="paged">
+<title> crash at A4 90% generated content + repeatable tfoot</title>
+<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=696640">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+    color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.LayoutBreakAfter:after {
+  clear: both;
+  display: block;
+  height: 0;
+  content: "\0020";
+}
+td { width:0.1in; height:0.1in; }
+div.spacer { width:50%; height:1.7in; }
+</style>
+
+</head>
+<body>
+
+<div class="spacer"></div>
+
+<div class="LayoutBreakAfter">
+ <div style="float:left">
+  <table>
+   <tbody >
+    <tr>
+     <td> 
+	 </td>
+    </tr>
+   </tbody>
+   <tfoot>
+    <tr>
+     <td >
+     </td>
+    </tr>
+   </tfoot>
+  </table>
+ </div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/tables/crashtests/696640-2.html
@@ -0,0 +1,486 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="flags" content="paged">
+<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=696640">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+    color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+#yui-main { float: left;}
+#bd:after { content: "."; display: block; clear: both; }
+</style>
+</head>
+<body>
+  <div id="bd">
+    <div id="yui-main">
+    <table>
+      <tbody>
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+
+
+         <tr>
+            <td><a href="http://football.fantasysports.yahoo.com/bowl/55789">i</a></td>
+            <td> – </td>
+            <td> – </td>
+            <td></td>
+            <td>vs</td>
+            <td></td>
+            <td><em>vs.</em> – </td>
+            <td></td>
+            <td></td>
+        </tr>
+    </tbody>
+             <tfoot>
+                <tr >
+                    <td colspan="8"><p><b >Total Points</b></p></td>
+                    <td colspan="2" >0</td>
+                </tr>
+            </tfoot>
+    </table>
+    </div>
+  </div>
+</body>
+</html>
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -115,13 +115,15 @@ load 576890-1.html
 load 576890-2.html
 load 576890-3.html
 load 580481-1.xhtml
 asserts(0-3) load 595758-1.xhtml # Bug 453871
 load 595758-2.xhtml
 load 678447-1.html
 skip-if(Android) load 691824-1.xhtml # Bug 694248
 load 695430-1.html
+load 696640-1.html
+load 696640-2.html
 load 707622-1.html
 load 705996-1.html
 load 705996-2.html
 load 711864-1.html
 load 710098-1.html
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2933,39 +2933,34 @@ nsTableFrame::ReflowChildren(nsTableRefl
           // frame. This hooks the child into the flow
           rv = presContext->PresShell()->FrameConstructor()->
             CreateContinuingFrame(presContext, kidFrame, this, &kidNextInFlow);
           if (NS_FAILED(rv)) {
             aStatus = NS_FRAME_COMPLETE;
             break;
           }
 
-          // Insert the continuing frame into the sibling list.
+          // Insert the kid's new next-in-flow into our sibling list...
           mFrames.InsertFrame(nullptr, kidFrame, kidNextInFlow);
-
-          // Fall through and update |rowGroups| with the new rowgroup, just as
-          // it would have been if we had called OrderRowGroups again.
-          // Note that rowGroups doesn't get used again after we PushChildren
-          // below, anyway.
+          // and in rowGroups after childX so that it will get pushed below.
+          rowGroups.InsertElementAt(childX + 1,
+                      static_cast <nsTableRowGroupFrame*>(kidNextInFlow));
         }
 
-        // Put the nextinflow so that it will get pushed
-        rowGroups.InsertElementAt(childX + 1,
-                           static_cast <nsTableRowGroupFrame*>(kidNextInFlow));
-
         // We've used up all of our available space so push the remaining
-        // children to the next-in-flow
+        // children.
         if (allowRepeatedFooter) {
           PlaceRepeatedFooter(aReflowState, tfoot, footerHeight);
         }
         else if (tfoot && tfoot->IsRepeatable()) {
           tfoot->SetRepeatable(false);
         }
+
         nsIFrame* nextSibling = kidFrame->GetNextSibling();
-        if (nullptr != nextSibling) {
+        if (nextSibling) {
           PushChildren(rowGroups, childX + 1);
         }
         break;
       }
     }
     else { // it isn't being reflowed
       aReflowState.y += cellSpacingY;
       nsRect kidRect = kidFrame->GetRect();