Do not update selection rect on dirty lineboxes.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Oct 2016 16:27:35 +0000 (16:27 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Oct 2016 16:27:35 +0000 (16:27 +0000)
commitfcd2ed61d38d187918ae02773b2342b0c43452c3
treecb7eb59ffd18a2407a906b9b6c4cba44a684e2a2
parentd6d8d7906315c8be2f22ba40010995279a36d361
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>

Reviewed by Simon Fraser.

Source/WebCore:

In addition to checking whether the renderer needs layout, we also need to check if its preferred
width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
there's a transition phase where the parent's preferred width dirty bit is already set, but it does
not yet need layout).

Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):

LayoutTests:

* fast/css-generated-content/dynamic-first-letter-selection-clear-crash-expected.txt: Added.
* fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-generated-content/dynamic-first-letter-selection-clear-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp