Simple line layout: Re-adjust paginated lines when block height changes.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Feb 2017 02:14:40 +0000 (02:14 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Feb 2017 02:14:40 +0000 (02:14 +0000)
commit0e0f4e3b5d9dd3486ac26d8e24eb156f823a94b3
treee3b9a3444cc37720c457f47b933b487486ecc33c
parent2f38caf9391e31be20b717938d51fb2e6b6786a3
Simple line layout: Re-adjust paginated lines when block height changes.
https://bugs.webkit.org/show_bug.cgi?id=168838
<rdar://problem/30701233>

Reviewed by Antti Koivisto.

When the estimated block height is wrong, we issue an additional layout on the inline children
so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines.
This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.

Not enabled yet.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
(WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
(WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
(WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::setIsPaginated):
(WebCore::SimpleLineLayout::Layout::setLineStruts):
* rendering/SimpleLineLayoutPagination.cpp: Added.
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::updateMinimumPageHeight):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
* rendering/SimpleLineLayoutPagination.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderingAllInOne.cpp
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayout.h
Source/WebCore/rendering/SimpleLineLayoutPagination.cpp [new file with mode: 0644]
Source/WebCore/rendering/SimpleLineLayoutPagination.h [new file with mode: 0644]