Bug 963441 - Make sure we push an existing next-in-flow sibling too. r=dholbert
authorMats Palmgren <matspal@gmail.com>
Fri, 31 Jan 2014 12:36:00 +0000
changeset 166263 b717389c3f940df0da3a962a1fc8880342660ab3
parent 166262 fe5449bbf9bc68283c9da8aee58d190b4626fd6c
child 166264 fb7220123d5ab3a563044a2e804dbc9f6b2679d7
push id39147
push usermpalmgren@mozilla.com
push dateFri, 31 Jan 2014 12:36:07 +0000
treeherdermozilla-inbound@b717389c3f94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs963441
milestone29.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 963441 - Make sure we push an existing next-in-flow sibling too. r=dholbert
layout/reftests/table-overflow/963441-ref.html
layout/reftests/table-overflow/963441.html
layout/reftests/table-overflow/reftest.list
layout/tables/nsTableFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-overflow/963441-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head><meta charset="utf-8"></head>
+<body>
+  <div style="height:3in">Tall div. (Scroll to end.)</div>
+  <div>IS THIS TEXT VISIBLE IN PRINT PREVIEW?</div>
+  <div>[clear:left]</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-overflow/963441.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-print">
+<head><meta charset="utf-8"></head>
+<body>
+  <div style="float: left">
+    <table cellpadding=0 cellspacing=0>
+      <tr>
+        <td>
+          <div style="height:3in">Tall div. (Scroll to end.)</div>
+          <div>IS THIS TEXT VISIBLE IN PRINT PREVIEW?</div>
+        </td>
+      </tr>
+    </table>
+  </div>
+  <div style="clear: left">[clear:left]</div>
+</body>
+</html>
--- a/layout/reftests/table-overflow/reftest.list
+++ b/layout/reftests/table-overflow/reftest.list
@@ -1,3 +1,4 @@
 == bug785684-x.html bug785684-ref.html
 == bug785684-y.html bug785684-ref.html
 == table-row-pagination.html table-row-pagination-ref.html
+== 963441.html 963441-ref.html
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2951,17 +2951,24 @@ nsTableFrame::ReflowChildren(nsTableRefl
           // frame. This hooks the child into the flow
           kidNextInFlow = presContext->PresShell()->FrameConstructor()->
             CreateContinuingFrame(presContext, kidFrame, this);
 
           // Insert the kid's new next-in-flow into our sibling list...
           mFrames.InsertFrame(nullptr, kidFrame, kidNextInFlow);
           // and in rowGroups after childX so that it will get pushed below.
           rowGroups.InsertElementAt(childX + 1,
-                      static_cast <nsTableRowGroupFrame*>(kidNextInFlow));
+                      static_cast<nsTableRowGroupFrame*>(kidNextInFlow));
+        } else if (kidNextInFlow == kidFrame->GetNextSibling()) {
+          // OrderRowGroups excludes NIFs in the child list from 'rowGroups'
+          // so we deal with that here to make sure they get pushed.
+          MOZ_ASSERT(!rowGroups.Contains(kidNextInFlow),
+                     "OrderRowGroups must not put our NIF in 'rowGroups'");
+          rowGroups.InsertElementAt(childX + 1,
+                      static_cast<nsTableRowGroupFrame*>(kidNextInFlow));
         }
 
         // We've used up all of our available space so push the remaining
         // children.
         if (allowRepeatedFooter) {
           PlaceRepeatedFooter(aReflowState, tfoot, footerHeight);
         }
         else if (tfoot && tfoot->IsRepeatable()) {