<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>75380</bug_id>
          
          <creation_ts>2011-12-30 01:44:41 -0800</creation_ts>
          <short_desc>[GTK] Allow to show context menu with keyboard in WebKit2 GTK+</short_desc>
          <delta_ts>2012-01-04 03:08:54 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>72099</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gustavo</cc>
    
    <cc>jdiggs</cc>
    
    <cc>mario</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>528101</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2011-12-30 01:44:41 -0800</bug_when>
    <thetext>We just need to implement GtkWidget::popup-menu and emit a fake right click event.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528102</commentid>
    <comment_count>1</comment_count>
      <attachid>120787</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2011-12-30 01:48:44 -0800</bug_when>
    <thetext>Created attachment 120787
Patch

We don&apos;t have access to the current focused node, so it always shows the menu at the top-left corner like GtkLauncher and Firefox do when there&apos;s no focused node nor selections.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528103</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-30 01:53:22 -0800</bug_when>
    <thetext>Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528144</commentid>
    <comment_count>3</comment_count>
      <attachid>120787</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-12-30 07:16:40 -0800</bug_when>
    <thetext>Comment on attachment 120787
Patch

This actually isn&apos;t going to work, because it&apos;s going to determine the contents of the menu by doing a hittest at the location of the mouse event. For this to be accessible we need to get the currently focused node. I&apos;ll CC Joanie here because she has all of the requirements for this feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528146</commentid>
    <comment_count>4</comment_count>
    <who name="Joanmarie Diggs">jdiggs</who>
    <bug_when>2011-12-30 07:32:22 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 120787 [details])
&gt; This actually isn&apos;t going to work, because it&apos;s going to determine the contents of the menu by doing a hittest at the location of the mouse event. For this to be accessible we need to get the currently focused node. I&apos;ll CC Joanie here because she has all of the requirements for this feature.

I think you do as well, Martin. ;) So I&apos;m guessing that there&apos;s some particular aspect I&apos;m not thinking of. In the meantime.... 

The context menu should base its context about what the user is in or on.

* If that&apos;s a link, the menu should be for the link.
* If it&apos;s a widget, it should be for that widget.
* If the user is arrowing around the document via caret nav, it should be for the document.

In the last case if, say, the caret is within a paragraph does that mean the focused node is that paragraph? If so, unless non-focusable content can have a unique context menu, I suppose you do not always need the currently focused node; just the currently-focused focusable element.

If I failed to address any point which needs addressing, please let me know. And thanks for asking! :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528160</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-12-30 08:26:42 -0800</bug_when>
    <thetext>(In reply to comment #4)

&gt; In the last case if, say, the caret is within a paragraph does that mean the focused node is that paragraph? If so, unless non-focusable content can have a unique context menu, I suppose you do not always need the currently focused node; just the currently-focused focusable element.

Perhaps it may be simpler to create a new IPC message that means &quot;create a context menu event for the currently focused node.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528161</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2011-12-30 08:27:16 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 120787 [details])
&gt; This actually isn&apos;t going to work, 

This works.

&gt; because it&apos;s going to determine the contents of the menu by doing a hittest at the location of the mouse event. For this to be accessible we need to get the currently focused node. I&apos;ll CC Joanie here because she has all of the requirements for this feature.

The behaviour is exactly the same than wk1 or firefox when there isn&apos;t a focused item or selection. When wk2 allows to get the rectangle of the current focused node or selection we can just improve it to use it like I already did for wk1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528164</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-12-30 08:36:15 -0800</bug_when>
    <thetext>(In reply to comment #6)

&gt; This works.

Okay. I agree this works when there is no focused node, but I think it&apos;s possible to create a more general solution that actually meets our accessibility requirements right now.

&gt; The behaviour is exactly the same than wk1 or firefox when there isn&apos;t a focused item or selection. When wk2 allows to get the rectangle of the current focused node or selection we can just improve it to use it like I already did for wk1.

It&apos;s probably saner to just create a new IPC message than to try to determine the focused node in the UIProcess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528166</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2011-12-30 08:39:53 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; 
&gt; &gt; This works.
&gt; 
&gt; Okay. I agree this works when there is no focused node, but I think it&apos;s possible to create a more general solution that actually meets our accessibility requirements right now.
&gt; 
&gt; &gt; The behaviour is exactly the same than wk1 or firefox when there isn&apos;t a focused item or selection. When wk2 allows to get the rectangle of the current focused node or selection we can just improve it to use it like I already did for wk1.
&gt; 
&gt; It&apos;s probably saner to just create a new IPC message than to try to determine the focused node in the UIProcess.

I&apos;ve just found this bug https://bugs.webkit.org/show_bug.cgi?id=72099. That solution looks better than mine and we don&apos;t need to create a new IP message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529431</commentid>
    <comment_count>9</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-01-04 03:08:54 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 72099 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>120787</attachid>
            <date>2011-12-30 01:48:44 -0800</date>
            <delta_ts>2011-12-30 07:16:40 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk2-keyboard-context-menu.diff</filename>
            <type>text/plain</type>
            <size>2930</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCBiNjVkNGJlLi4xM2M0NjE2IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTgg
QEAKKzIwMTEtMTItMzAgIENhcmxvcyBHYXJjaWEgQ2FtcG9zICA8Y2dhcmNpYUBpZ2FsaWEuY29t
PgorCisgICAgICAgIFtHVEtdIEFsbG93IHR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ViVmlld0Jhc2VEcmFnRHJvcDsKICAgICB3aWRnZXRDbGFz
cy0+ZHJhZ19kYXRhX3JlY2VpdmVkID0gd2Via2l0V2ViVmlld0Jhc2VEcmFnRGF0YVJlY2VpdmVk
OworICAgIHdpZGdldENsYXNzLT5wb3B1cF9tZW51ID0gd2Via2l0V2ViVmlld0Jhc2VQb3B1cE1l
bnU7CiAKICAgICBHT2JqZWN0Q2xhc3MqIGdvYmplY3RDbGFzcyA9IEdfT0JKRUNUX0NMQVNTKHdl
YmtpdFdlYlZpZXdCYXNlQ2xhc3MpOwogICAgIGdvYmplY3RDbGFzcy0+ZmluYWxpemUgPSB3ZWJr
aXRXZWJWaWV3QmFzZUZpbmFsaXplOwo=
</data>
<flag name="review"
          id="121115"
          type_id="1"
          status="-"
          setter="mrobinson"
    />
          </attachment>
      

    </bug>

</bugzilla>