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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 110533004: CHR-1706: Context menu with Shift+F10 shows out of Opera when web contents scrolled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 24b02a8368b3bdeed6d7d9d685d4feb0c5e91130..af3b746fa4c0116a61dad62e6abf4c374e5947e9 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2822,6 +2822,7 @@ bool EventHandler::sendContextMenuEventForKey()
Element* focusedElement = doc->focusedElement();
FrameSelection& selection = m_frame->selection();
Position start = selection.selection().start();
+ bool shouldTranslateToRootView = true;
if (start.deprecatedNode() && (selection.rootEditableElement() || selection.isRange())) {
RefPtr<Range> selectionRange = selection.toNormalizedRange();
@@ -2841,11 +2842,12 @@ bool EventHandler::sendContextMenuEventForKey()
location = IntPoint(
rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
kContextMenuMargin);
+ shouldTranslateToRootView = false;
}
m_frame->view()->setCursor(pointerCursor());
- IntPoint position = view->contentsToRootView(location);
+ IntPoint position = shouldTranslateToRootView ? view->contentsToRootView(location) : location;
IntPoint globalPosition = view->hostWindow()->rootViewToScreen(IntRect(position, IntSize())).location();
Node* targetNode = doc->focusedElement();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698