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: https://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 bd903f14cd0a64e5649fca640c65f16ff989dc71..a766d2ac6ae9cad149f4cdd389bb3e645dd347e6 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 3e1db5419fe653410c1ea0174a3e3e01688528b6..cebbc854b15fcd85b78562d71eb908f57653cd36 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 3be069ad884eba1bfee729f75dd59dda189ffdc4..794420c255b8b97475ffc4bafd945e7f561ab85f 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 11f5a1dcfa68a8eefb591004eef95ac9ad0c44c2..9308877444f0c1cd12e44a176516ce488d9d32da 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);