REGRESSION (r62632): page-break-inside: avoid is ignored
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 19:37:26 +0000 (19:37 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 19:37:26 +0000 (19:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79262

Reviewed by Adele Peterson.

Source/WebCore:

This was disabled in r62632 because of <http://webkit.org/b/41532>. Changes to the
pagination code since then have invalidated that bug, so enabling the feature again does not
re-introduce the bug.

Updated expected results for printing/page-break-inside-avoid.html.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustForUnsplittableChild):

LayoutTests:

* printing/page-break-inside-avoid-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108528 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/printing/page-break-inside-avoid-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index bd903f1..a766d2a 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-22  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r62632): page-break-inside: avoid is ignored
+        https://bugs.webkit.org/show_bug.cgi?id=79262
+
+        Reviewed by Adele Peterson.
+
+        * printing/page-break-inside-avoid-expected.txt:
+
 2012-02-22  Adrienne Walker  <enne@google.com>
 
         [chromium] Unreviewed gardening. Mark some XHR tests as asserting.
index 3e1db54..cebbc85 100644 (file)
@@ -8,12 +8,13 @@ PASS: page number of "page1-1" is 1
 PASS: page number of "page1-2" is 1
 PASS: page number of "page2" is 2
 PASS: page number of "page3" is 3
-FAIL: expected page number of "page4" is 4. Was 3
+PASS: page number of "page4" is 4
 PASS: page number of "page5" is 5
 PASS: page number of "page8" is 8
 PASS: page number of "page9-1" is 9
 PASS: page number of "page9-2" is 9
 PASS: page number of "page10" is 10
+All tests passed
 
 PASS successfullyParsed is true
 
index 3be069a..794420c 100644 (file)
@@ -1,3 +1,19 @@
+2012-02-22  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r62632): page-break-inside: avoid is ignored
+        https://bugs.webkit.org/show_bug.cgi?id=79262
+
+        Reviewed by Adele Peterson.
+
+        This was disabled in r62632 because of <http://webkit.org/b/41532>. Changes to the
+        pagination code since then have invalidated that bug, so enabling the feature again does not
+        re-introduce the bug.
+
+        Updated expected results for printing/page-break-inside-avoid.html.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::adjustForUnsplittableChild):
+
 2012-02-22  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer] webkitwebsrc: use HTTP referer provided by MediaPlayer
 
 2012-02-19  James Robinson  <jamesr@chromium.org>
 
-        Sort WebCore XCode project files with sort-Xcode-project-files script. Unreviewed.
+        Sort WebCore Xcode project files with sort-Xcode-project-files script. Unreviewed.
 
         * WebCore.xcodeproj/project.pbxproj:
 
index 11f5a1d..9308877 100755 (executable)
@@ -6584,8 +6584,12 @@ LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, P
 
 LayoutUnit RenderBlock::adjustForUnsplittableChild(RenderBox* child, LayoutUnit logicalOffset, bool includeMargins)
 {
-    bool isUnsplittable = child->isUnsplittableForPagination() || child->style()->columnBreakInside() == PBAVOID
-        || child->style()->regionBreakInside() == PBAVOID;
+    bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns();
+    bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLogicalHeight;
+    bool checkRegionBreaks = inRenderFlowThread();
+    bool isUnsplittable = child->isUnsplittableForPagination() || (checkColumnBreaks && child->style()->columnBreakInside() == PBAVOID)
+        || (checkPageBreaks && child->style()->pageBreakInside() == PBAVOID)
+        || (checkRegionBreaks && child->style()->regionBreakInside() == PBAVOID);
     if (!isUnsplittable)
         return logicalOffset;
     LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : zeroLayoutUnit);