ASSERTION FAILED: newLogicalTop >= logicalTop in WebCore::RenderBlockFlow::getClearDelta
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2017 02:17:19 +0000 (02:17 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2017 02:17:19 +0000 (02:17 +0000)
commitc37ad05b76cb1c2285539b87655b866e549961ff
tree0e2e3af97d2535327c74ac31e6715c144f81931b
parent7ec447a5d7c830480d3cdd53ff6cb10cab2c5af8
ASSERTION FAILED: newLogicalTop >= logicalTop in WebCore::RenderBlockFlow::getClearDelta
https://bugs.webkit.org/show_bug.cgi?id=151202
<rdar://problem/27711822>

Reviewed by Myles C. Maxfield.

Source/WebCore:

FindNextFloatLogicalBottomAdapter uses LayoutUnit::max() to flag m_nextLogicalBottom uninitialized.
However LayoutUnit::max() can also be a valid value for m_nextLogicalBottom.
FindNextFloatLogicalBottomAdapter::nextLogicalBottom() returns 0 instead of the actual value when
it sees m_nextLogicalBottom uninitialized. In certain cases, it confuses the caller and we end up
with a runaway loop.

Test: fast/block/float/assert-when-line-has-not-enough-space-left.html

* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
(WebCore::FindNextFloatLogicalBottomAdapter::highValue):
(WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom):
(WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom):
(WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):

LayoutTests:

* fast/block/float/assert-when-line-has-not-enough-space-left-expected.txt: Added.
* fast/block/float/assert-when-line-has-not-enough-space-left.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/block/float/assert-when-line-has-not-enough-space-left-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/float/assert-when-line-has-not-enough-space-left.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/FloatingObjects.cpp