| Index: third_party/WebKit/Source/core/frame/FrameView.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| index 15cff79b46d15ca13cc20c86a0a8353235f3a9d2..c91a9f1c8778582d242df052fd8896b2c343ec1c 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -1718,12 +1718,23 @@ void FrameView::updateCompositedSelectionIfNeeded()
|
| CompositedSelection selection;
|
| LocalFrame* focusedFrame = page->focusController().focusedFrame();
|
| LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr;
|
| - if (!localFrame || !computeCompositedSelection(*localFrame, selection)) {
|
| - page->chromeClient().clearCompositedSelection();
|
| - return;
|
| - }
|
|
|
| - page->chromeClient().updateCompositedSelection(selection);
|
| + if (localFrame && computeCompositedSelection(*localFrame, selection)) {
|
| + page->chromeClient().updateCompositedSelection(localFrame, selection);
|
| + } else {
|
| + if (!localFrame) {
|
| + // Clearing the mainframe when there is no focused frame (and hence
|
| + // no localFrame) is legacy behaviour, and implemented here to
|
| + // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleared's
|
| + // first check that the composited selection has been cleared even
|
| + // though no frame has focus yet. If this is not desired, then the
|
| + // expectation needs to be removed from the test.
|
| + localFrame = m_frame->localFrameRoot();
|
| + }
|
| +
|
| + if (localFrame)
|
| + page->chromeClient().clearCompositedSelection(localFrame);
|
| + }
|
| }
|
|
|
| HostWindow* FrameView::getHostWindow() const
|
|
|