Avoid synchronous style recalc when mutating a Node inside FrameSelection.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 16:22:40 +0000 (16:22 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 16:22:40 +0000 (16:22 +0000)
commitaa9fb093a63daf52a8d1ab350ce3013ad2a3e651
treece353ec727d39ca9e4b6b81257fcf0450b486ef6
parent167af4c07113cfb015388e5ad66ababfa4cdc2fb
Avoid synchronous style recalc when mutating a Node inside FrameSelection.
<https://webkit.org/b/138791>

Reviewed by Antti Koivisto.

Source/WebCore:

We can safely clear the RenderView's selection without doing a synchronous
style recalc first.

This is a small progression on Speedometer locally.

* editing/FrameSelection.cpp:
(WebCore::DragCaretController::nodeWillBeRemoved):
(WebCore::FrameSelection::respondToNodeModification):
(WebCore::clearRenderViewSelection): Deleted.

    Merged clearRenderViewSelection() into the call sites and removed
    the now-unnecessary protection of the Document.

LayoutTests:

Rebaseline fast/dynamic/move-node-with-selection.html.
This is a progression, we avoid littering the render tree with some empty
text renderers due to deferring the style recalc in selection clearing.

* platform/efl/fast/dynamic/move-node-with-selection-expected.txt:
* platform/gtk/fast/dynamic/move-node-with-selection-expected.txt:
* platform/ios-sim-deprecated/fast/dynamic/move-node-with-selection-expected.txt:
* platform/ios-simulator/fast/dynamic/move-node-with-selection-expected.txt:
* platform/mac/fast/dynamic/move-node-with-selection-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/efl/fast/dynamic/move-node-with-selection-expected.txt
LayoutTests/platform/gtk/fast/dynamic/move-node-with-selection-expected.txt
LayoutTests/platform/ios-sim-deprecated/fast/dynamic/move-node-with-selection-expected.txt
LayoutTests/platform/ios-simulator/fast/dynamic/move-node-with-selection-expected.txt
LayoutTests/platform/mac/fast/dynamic/move-node-with-selection-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/editing/FrameSelection.cpp