REGRESSION(r164133): Selection disappears after scrolling on nytimes.com
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jul 2014 01:45:54 +0000 (01:45 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jul 2014 01:45:54 +0000 (01:45 +0000)
commitbcfa7b1bafa7babbcbc9811a87fcbf3a5196130c
treef8cb1ed10714d2bd50b333d0eb3b9de768cee38e
parent590e4c4ec03ffa5715478c85bcd40d4117a3f4db
REGRESSION(r164133): Selection disappears after scrolling on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=135361

Reviewed by Ryosuke Niwa.

Ensure that when a RenderElement, part of the current selection is removed,
we recalculate and update the selection soon after layout.

Source/WebCore:
Test: fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate):
(WebCore::FrameSelection::didLayout): didLayout name reflects its functionality better.
(WebCore::FrameSelection::layoutDidChange): Deleted.
* editing/FrameSelection.h: : move some functions to private.
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeChildInternal):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):

LayoutTests:
* fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed-expected.html: Added.
* fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed-expected.html [new file with mode: 0644]
LayoutTests/fast/dynamic/selection-gets-cleared-when-part-of-it-gets-removed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderInline.cpp