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

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

Issue 766143002: Fix contextmenu event location for menu key in an iframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changes as per review comments. Created 6 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
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 7624a0e919aee46f771d5949e1c03a6043fa0701..7a1de180c82f6f652ecd48193c9cbe7eecb02fb0 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2777,7 +2777,7 @@ bool EventHandler::sendContextMenuEventForKey()
Element* focusedElement = doc->focusedElement();
FrameSelection& selection = m_frame->selection();
Position start = selection.selection().start();
- bool shouldTranslateToRootView = true;
+ bool shouldTranslateToRootView = false;
if (start.deprecatedNode() && (selection.rootEditableElement() || selection.isRange())) {
RefPtrWillBeRawPtr<Range> selectionRange = selection.toNormalizedRange();
@@ -2787,6 +2787,7 @@ bool EventHandler::sendContextMenuEventForKey()
// In a multiline edit, firstRect.maxY() would endup on the next line, so -1.
int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0;
location = IntPoint(x, y);
+ shouldTranslateToRootView = true;
Rick Byers 2014/12/10 03:09:25 by the way, you don't need this variable at all an
Deepak 2014/12/10 06:40:27 Done.
} else if (focusedElement) {
IntRect clippedRect = focusedElement->boundsInRootViewSpace();
location = IntPoint(clippedRect.center());
@@ -2794,7 +2795,6 @@ bool EventHandler::sendContextMenuEventForKey()
location = IntPoint(
rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
kContextMenuMargin);
- shouldTranslateToRootView = false;
}
m_frame->view()->setCursor(pointerCursor());

Powered by Google App Engine
This is Rietveld 408576698