<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - [WK2] Keyboard menu key should show context menu"
   href="https://bugs.webkit.org/show_bug.cgi?id=72099#c32">Comment # 32</a>
              on <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - [WK2] Keyboard menu key should show context menu"
   href="https://bugs.webkit.org/show_bug.cgi?id=72099">bug 72099</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=290201&amp;action=diff" name="attach_290201" title="Fix the build on Mac">attachment 290201</a> <a href="attachment.cgi?id=290201&amp;action=edit" title="Fix the build on Mac">[details]</a></span>
Fix the build on Mac

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=290201&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=290201&amp;action=review</a>

I think this should be testable. It would be better if you split the patch in two, one for the webcore only changes with a layout test that checks that the context menu is shown when triggered by the keyboard, checking all the cases: focused node, selected content, no focused element, etc. This test should probably be skipped initially for GTK+ until the other patch lands. And another patch for the GTK+ specific part.

<span class="quote">&gt; Source/WebCore/ChangeLog:27
&gt; +        Correctly send the mouse event that used for showing the context menu.
&gt; +        Previously the event was immediately dispatched as it is, but this was
&gt; +        only the right way if some element was focused on the page. If there
&gt; +        was no focused element or non-empty text range then the event lacked
&gt; +        the right node, where it was supposed to be shown. The correct node
&gt; +        is determined and added to the event in the sendContextMenuEvent() so
&gt; +        we have to use this function to send the event.</span >

So the thing is, are we sure we also want to do all other things done by sendContextMenuEvent() in the keyboard case?

<span class="quote">&gt; Source/WebCore/page/EventHandler.cpp:2823
&gt; +        // FIXME On WebKit2 this returns quite a bigger rectangle than the element</span >

Is this really a problem specific to WebKit2? Use : after FIXME.

<span class="quote">&gt; Source/WebCore/page/EventHandler.cpp:2859
&gt; -    return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, platformMouseEvent, false);
&gt; +    return sendContextMenuEvent(platformMouseEvent);</span >

My guess is that what we really need here is calling Document::prepareMouseEvent() so maybe we can do that here instead of reusing sendContextMenuEvent(), because I'm not sure we want to do all other tings done there.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>