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 44f2446632fc84ee790b38e7d3a2133f1022b82c..150fef813d4ba64cca07e761ffc7a47a70c6a5cb 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
| @@ -1719,11 +1719,23 @@ void FrameView::updateCompositedSelectionIfNeeded() |
| LocalFrame* focusedFrame = page->focusController().focusedFrame(); |
| LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr; |
| if (!localFrame || !computeCompositedSelection(*localFrame, selection)) { |
|
bokan
2016/08/11 14:14:06
These `if` statements can be simplified to:
if (l
wjmaclean
2016/08/11 14:35:06
Done.
Sorry, I had thought about doing this, then
|
| - page->chromeClient().clearCompositedSelection(); |
| + 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. |
| + auto mainLocalFrame = m_frame->localFrameRoot(); |
|
bokan
2016/08/11 14:14:06
IMO, readability is a bit better with s/auto/Local
wjmaclean
2016/08/11 14:35:06
Done.
|
| + if (mainLocalFrame) |
| + page->chromeClient().clearCompositedSelection(mainLocalFrame); |
| + } |
| return; |
| } |
| - page->chromeClient().updateCompositedSelection(selection); |
| + page->chromeClient().updateCompositedSelection(localFrame, selection); |
| } |
| HostWindow* FrameView::getHostWindow() const |