Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2230993002: Refactor composited selection code out of WebViewImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PDF print dialog tests. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/ChromeClient.h » ('j') | third_party/WebKit/Source/web/ChromeClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698