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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17840</bug_id>
          
          <creation_ts>2012-07-18 07:00:33 +0000</creation_ts>
          <short_desc>menuitem click and menu show events do not indicate what element triggered these events</short_desc>
          <delta_ts>2013-04-03 22:31:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          <blocked>16816</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bugzilla.w3c</cc>
    
    <cc>ian</cc>
    
    <cc>jan.varga</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70150</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:00:33 +0000</bug_when>
    <thetext>This was was cloned from bug 16816 as part of operation convergence.
Originally filed: 2012-04-21 20:56:00 +0000
Original reporter: bugzilla.w3c@signpostmarv.name

================================================================================
 #0   bugzilla.w3c@signpostmarv.name                  2012-04-21 20:56:35 +0000 
--------------------------------------------------------------------------------
I&apos;m noticing that the properties provided via the click event on a menuitem element and the show event on a menu element do not indicate what element was interacted with in order to trigger a context menu to be used. Consequently, one has to use a workaround by adding a listener to the contextmenu event- this does not appear to the most graceful solution.

For an implementation of this workaround, see http://pastebin.com/7kS8tu2W

My preferred solution would be a property on both events that indicates the element that triggered the context menu to appear.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74619</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-27 04:00:58 +0000</bug_when>
    <thetext>Hm, yeah.

I guess I should set relatedTarget on the &apos;click&apos; event of events fired on elements in a context menu to point to the element that had the contextmenu attribute. Would that work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74666</commentid>
    <comment_count>2</comment_count>
    <who name="">bugzilla.w3c</who>
    <bug_when>2012-09-27 20:32:15 +0000</bug_when>
    <thetext>That would likely work, yes.

Unsure if there are similar events that would benefit from such a property though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80678</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-29 16:48:35 +0000</bug_when>
    <thetext>I guess we need a new event type interface that has relatedTarget, since contextmenu and show are sometimes simple events, not mouse events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80680</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-29 17:19:31 +0000</bug_when>
    <thetext>similar to:
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-FocusEvent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85528</commentid>
    <comment_count>5</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-03 20:23:40 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7791.
Check-in comment: Add a .relatedTarget attribute on &apos;show&apos; events for &lt;menu&gt; elements.
http://html5.org/tools/web-apps-tracker?from=7790&amp;to=7791</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85530</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-03 22:31:19 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7792.
Check-in comment: Set the .relatedTarget attribute on &apos;click&apos; events for &lt;menuitem&gt; elements (and their master commands) properly.
http://html5.org/tools/web-apps-tracker?from=7791&amp;to=7792</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>