WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
210462
Web Inspector: WI.ContextMenu.createFromEvent doesn't work with keydown event
https://bugs.webkit.org/show_bug.cgi?id=210462
Summary
Web Inspector: WI.ContextMenu.createFromEvent doesn't work with keydown event
Nikita Vasilyev
Reported
2020-04-13 15:34:34 PDT
Here is one instance where it's needed:
bug 210447
: Web Inspector: AXI: tabs should be focusable when navigating by pressing Tab. Currently, InspectorFrontendHost::dispatchEventAsContextMenuEvent only takes mouse events. WebCore/inspector/InspectorFrontendHost.cpp: ``` void InspectorFrontendHost::dispatchEventAsContextMenuEvent(Event& event) { #if ENABLE(CONTEXT_MENUS) && USE(ACCESSIBILITY_CONTEXT_MENUS) if (!is<MouseEvent>(event)) return; auto& mouseEvent = downcast<MouseEvent>(event); auto& frame = *downcast<Node>(mouseEvent.target())->document().frame(); m_frontendPage->contextMenuController().showContextMenuAt(frame, roundedIntPoint(mouseEvent.absoluteLocation())); ... ``` Quick search for `absoluteLocation` showed me WebCore/dom/MouseRelatedEvent.h: // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords, // usable with RenderObject::absoluteToLocal). const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; } Keyboard events currently don't have this method. --- It would be more future-proof to have a method to show context menu for given x and y coordinates instead of the mouse event.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug