Chromium Code Reviews| 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..ab1b7eb44abc0b4728a4d09eddb30d12631c9db8 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
| @@ -1718,12 +1718,24 @@ 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) { |
| + page->chromeClient().clearCompositedSelection(localFrame); |
| + } else { |
| + // 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* mainLocalFrame = m_frame->localFrameRoot(); |
| + if (mainLocalFrame) |
| + page->chromeClient().clearCompositedSelection(mainLocalFrame); |
|
bokan
2016/08/11 14:40:09
IMO, it's a little clearer if there's just one cle
|
| + } |
| + } |
| } |
| HostWindow* FrameView::getHostWindow() const |