Simple line layout: Web process spins endlessly below layoutSimpleLines.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 21:32:07 +0000 (21:32 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 21:32:07 +0000 (21:32 +0000)
commit38e0bcde0198d111c8f2afac7311fe291e7c6a26
tree021c87c62b074a1c33828a8174adc149070ffaf7
parentc81ecea4f0cda62ea7ae4ad8c36963daa8910f73
Simple line layout: Web process spins endlessly below layoutSimpleLines.
https://bugs.webkit.org/show_bug.cgi?id=144403
rdar://problem/20742783

Reviewed by Antti Koivisto.

When a text fragment overlaps multiple renderes and it does not fit the current line,
we revert the text fragment iterator position so that the overlapping content
gets processed again for the next line.
However, TextFragmentIterator::revertToFragment() was reverting too much and
we started processing old content all over again -> infinite loop.

This patch ensures that text fragment iterator is reverted to the right position.

Source/WebCore:

Test: fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::createLineRuns):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::revertToEndOfFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.h:

LayoutTests:

* fast/text/simple-line-layout-wrapping-multiple-renderers-hang-expected.html: Added.
* fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/simple-line-layout-wrapping-multiple-renderers-hang-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h