From cfda5c90936def60b00660fbbdfa6167742b5e5b Mon Sep 17 00:00:00 2001 From: "mitz@apple.com" Date: Wed, 22 Feb 2012 19:37:26 +0000 Subject: [PATCH] REGRESSION (r62632): page-break-inside: avoid is ignored https://bugs.webkit.org/show_bug.cgi?id=79262 Reviewed by Adele Peterson. Source/WebCore: This was disabled in r62632 because of . 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 | 9 +++++++++ .../printing/page-break-inside-avoid-expected.txt | 3 ++- Source/WebCore/ChangeLog | 18 +++++++++++++++++- Source/WebCore/rendering/RenderBlock.cpp | 8 ++++++-- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index bd903f1..a766d2a 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2012-02-22 Dan Bernstein + + 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 [chromium] Unreviewed gardening. Mark some XHR tests as asserting. diff --git a/LayoutTests/printing/page-break-inside-avoid-expected.txt b/LayoutTests/printing/page-break-inside-avoid-expected.txt index 3e1db54..cebbc85 100644 --- a/LayoutTests/printing/page-break-inside-avoid-expected.txt +++ b/LayoutTests/printing/page-break-inside-avoid-expected.txt @@ -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 diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 3be069a..794420c 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2012-02-22 Dan Bernstein + + 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 . 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 [GStreamer] webkitwebsrc: use HTTP referer provided by MediaPlayer @@ -4262,7 +4278,7 @@ 2012-02-19 James Robinson - 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: diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index 11f5a1d..9308877 100755 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -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); -- 2.7.4