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(); |