[Webkit-unassigned] [Bug 210462] New: Web Inspector: WI.ContextMenu.createFromEvent doesn't work with keydown event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 13 15:34:34 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=210462

            Bug ID: 210462
           Summary: Web Inspector: WI.ContextMenu.createFromEvent doesn't
                    work with keydown event
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Inspector
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nvasilyev at apple.com
                CC: inspector-bugzilla-changes at group.apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200413/89829414/attachment.htm>


More information about the webkit-unassigned mailing list