Multiple Layout Tests (e.g. fast/repaint/japanese-rl-selection-clear.html) is failing...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2012 07:09:44 +0000 (07:09 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2012 07:09:44 +0000 (07:09 +0000)
commit88dd0633ae8209c8127ec223e09b8e07cd4ef332
treef4225c5b9f8b776e34f6da096330a6a8a34d80fc
parentbbd81950482de6ea6b750579746d6bdf2a6a55aa
Multiple Layout Tests (e.g. fast/repaint/japanese-rl-selection-clear.html) is failing after r133840.
https://bugs.webkit.org/show_bug.cgi?id=101547

Reviewed by Simon Fraser.

Source/WebCore:

I overlooked the fact when the selection is null, we still have to invalidate the caret rect that
previously existed. Revert the optimization added in r133840 to skip caret invalidation when new
selection is null, and add a special method to be called by FrameLoader prior to destruction instead.
This will let us avoid doing an extra layout upon destruction and not regress repaint tests.

Covered by existing tests.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection): Added DoNotUpdateAppearance option.
(WebCore::FrameSelection::prepareForDestruction): Added.
(WebCore::FrameSelection::updateAppearance): Reverted the flawed optimization added in r133840.
Also, don't update style before updating selection unless text caret is disabled since we always
update the layout (including style) when text caret is enabled.
* editing/FrameSelection.h:
(FrameSelection):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear): Call prepareForDestruction instead of clear to avoid a layout.

LayoutTests:

Remove Chromium test expectations as these tests now pass.

* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/loader/FrameLoader.cpp