[CSSRegions] Incorrect computed height for content with region-break-before
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 11:39:12 +0000 (11:39 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 11:39:12 +0000 (11:39 +0000)
commit3f5232555421e6270248adb385131a072a03b574
tree9eac17c029c5d43f54392e0835f6bfb6a5c5f32b
parent386ee2871364491b573da7b1333e5c6f7a5fe622
[CSSRegions] Incorrect computed height for content with region-break-before
https://bugs.webkit.org/show_bug.cgi?id=101862

Reviewed by Julien Chaffraix.

Source/WebCore:

When processing the region breaks for auto-height regions, we skipped the case
when the region-break-before occurred in the first region in the chain which was
an auto-height region. Because of that, the region computed height was not 0
as it was supposed to be, but rather LayoutUnit::max() / 2.

Test: fast/regions/autoheight-breakbefore-wrongheight.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::addForcedRegionBreak):
Make sure we process also the case when the region-break occurs at offset 0 in the flow thread
and the first region in chain is an auto-height region.
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::updateLogicalHeight):
Add an assert to make sure that the computed height for auto-height regions is always less than LayoutUnit::max() / 2.

LayoutTests:

Add a test showing that when content having -webkit-region-break-before:always is flowed
into a region chain with the first region being an auto-height region, the auto-height region
has a computed height of 0 and the content is flowed into the second region in the chain.

* fast/regions/autoheight-breakbefore-wrongheight-expected.txt: Added.
* fast/regions/autoheight-breakbefore-wrongheight.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/regions/autoheight-breakbefore-wrongheight-expected.txt [new file with mode: 0644]
LayoutTests/fast/regions/autoheight-breakbefore-wrongheight.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderRegion.cpp