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

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

Issue 247023002: Correcting menu button event trigger location (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Layout test changes as per review comments Created 6 years, 8 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
« no previous file with comments | « LayoutTests/fast/events/menu-key-context-menu-expected.txt ('k') | 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 8d33eba40c5b70d75204e2d4f385d2877b167ecb..231d0b33fa750b34c39224ce390efe4c9679d766 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2711,11 +2711,8 @@ bool EventHandler::sendContextMenuEventForKey()
int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0;
location = IntPoint(x, y);
} else if (focusedElement) {
- RenderBoxModelObject* box = focusedElement->renderBoxModelObject();
- if (!box)
- return false;
- IntRect clippedRect = box->pixelSnappedAbsoluteClippedOverflowRect();
- location = IntPoint(clippedRect.x(), clippedRect.maxY() - 1);
+ IntRect clippedRect = focusedElement->boundsInRootViewSpace();
+ location = IntPoint(clippedRect.center());
} else {
location = IntPoint(
rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
« no previous file with comments | « LayoutTests/fast/events/menu-key-context-menu-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698