Simple line layout: Add support for pagination.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Feb 2017 23:02:56 +0000 (23:02 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Feb 2017 23:02:56 +0000 (23:02 +0000)
commitf9c9732bcb9738435b16db4f85de346425ffe85c
tree5bc21b0102d2b89797b88988cb2a405d57e60e66
parent59bd078a5f3f860d8432dfe2ac77b75dee8f6597
Simple line layout: Add support for pagination.
https://bugs.webkit.org/show_bug.cgi?id=168355
<rdar://problem/30119769>

Reviewed by David Hyatt.

This patch adds basic support for paginated content including widows and orphans.

This is based on the normal line layout pagination logic. However there are 2 major
advantages here (and they allow us to have a much simpler logic):
1. all the lines are positioned by the time we start paginating them and
2. lines always have uniform heights.

This is not enabled yet.

* rendering/RenderBlockFlow.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
(WebCore::SimpleLineLayout::updateMinimumPageHeight):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::isPaginated):
(WebCore::SimpleLineLayout::Layout::struts):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayout.h
Source/WebCore/rendering/SimpleLineLayoutFunctions.h
Source/WebCore/rendering/SimpleLineLayoutResolver.h