[CSS Regions] Widows don't work if the first line in a region is aligned with the top of the region
https://bugs.webkit.org/show_bug.cgi?id=122450
Reviewed by David Hyatt.
Source/WebCore:
The patch adds a new function updateRegionForLine that updates the containing region for a line and the
flag used to determine if it's the first line in that region. This is necessary because the code in
adjustLinePositionForPagination is not sufficient to determine when an unforced break occurs and the line
being positioned is the first one in the fragmentation container or not.
Test: fast/regions/regions-widows-float-top-aligned.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustLinePositionForPagination): Added FIXME comment.
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloatsInRange):
(WebCore::RenderBlock::linkToEndLineIfNeeded):
(WebCore::RenderBlock::determineStartPosition):
(WebCore::RenderBlockFlow::updateRegionForLine): New function used to update the containing region and
the first line flag.
LayoutTests:
Simple test veryfing that widows are correctly computed when there is a float affecting the lines
and when they are vertically aligned with the regions height.
* fast/regions/regions-widows-float-top-aligned-expected.html: Added.
* fast/regions/regions-widows-float-top-aligned.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed