Newly added float should trigger full layout on the block.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jul 2018 14:23:45 +0000 (14:23 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jul 2018 14:23:45 +0000 (14:23 +0000)
commit065991924bd842331e3b4d9c5022f0a82b492fc0
tree19c8d0e99eb147eb96a27437796627c1458b17b4
parent2131027c35829b4a474f6c30215329b2ef52a42e
Newly added float should trigger full layout on the block.
https://bugs.webkit.org/show_bug.cgi?id=187251
<rdar://problem/41726137>

Reviewed by David Kilzer.

Source/WebCore:

RenderBlockFlow::determineStartPosition() is one of the places where we decide the extent of the line layout for the current block.
In here we try to figure out the first line in the block that requires layout. In certain cases when floats are present,
(due to their intrusive behavior) we just trigger a full layout on the entire block.
One of the special cases is when a new float is added to the block. determineStartPosition() checks for such floats (floats inserted
after the "last known float") and marks the block for full layout. However it missed the case when other, unrelated mutations happened
in addition to this newly inserted float. This patch fixes this case by checking if the floats after the "last know float" actually need layout.

Test: fast/inline/new-float-needs-layout-when-line-is-dirty.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::determineStartPosition):

LayoutTests:

* fast/inline/new-float-needs-layout-when-line-is-dirty-expected.txt: Added.
* fast/inline/new-float-needs-layout-when-line-is-dirty.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/inline/new-float-needs-layout-when-line-is-dirty-expected.txt [new file with mode: 0644]
LayoutTests/fast/inline/new-float-needs-layout-when-line-is-dirty.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp