bug 678447 - prevent splitting of tables inside columnsets during printing r=roc
authorBernd <bmlk@gmx.de>
Sat, 13 Aug 2011 18:37:43 +0200
changeset 74379 bddfa5c83a6ea7bb1b2a29937db78975772aa0c2
parent 74378 64b4ec7bfb4300b2ba6127fb22bc21a210db396f
child 74380 6f4b90a6c2928ce049070a204acbdd6096a6eeff
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersroc
bugs678447
milestone8.0a1
bug 678447 - prevent splitting of tables inside columnsets during printing r=roc
layout/tables/crashtests/678447-1.html
layout/tables/crashtests/crashtests.list
layout/tables/nsTableFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/tables/crashtests/678447-1.html
@@ -0,0 +1,10 @@
+<html class="reftest-print">
+<head>
+</head>
+<body style=" -moz-column-count: 2;">
+<table>
+<tbody><tr><td>rowgroup1</td></tr></tbody>
+<tbody><tr><td>rowgroup2</td></tr></tbody>
+</table>
+</body>
+</html>
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -102,8 +102,9 @@ load 513732-1.html
 asserts(0-1) load 533380-1.xhtml # Bug 614457
 load 534716-1.html
 load 573354-1.xhtml
 load 576890-1.html
 load 576890-2.html
 load 576890-3.html
 asserts(0-1) load 595758-1.xhtml # Bug 453871
 load 595758-2.xhtml
+load 678447-1.html
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2677,18 +2677,22 @@ nsTableFrame::ReflowChildren(nsTableRefl
   aLastChildReflowed = nsnull;
 
   nsIFrame* prevKidFrame = nsnull;
   nsresult  rv = NS_OK;
   nscoord   cellSpacingY = GetCellSpacingY();
 
   nsPresContext* presContext = PresContext();
   // XXXldb Should we be checking constrained height instead?
+  // tables are not able to pull back children from its next inflow, so even
+  // under paginated contexts tables are should not paginate if they are inside
+  // column set
   PRBool isPaginated = presContext->IsPaginated() &&
-                       NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height;
+                       NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height &&
+                       aReflowState.reflowState.mFlags.mTableIsSplittable;
 
   aOverflowAreas.Clear();
 
   PRBool reflowAllKids = aReflowState.reflowState.ShouldReflowAllKids() ||
                          mBits.mResizedColumns ||
                          IsGeometryDirty();
 
   RowGroupArray rowGroups;