This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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'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. ================================================================================
Hm, yeah. I guess I should set relatedTarget on the 'click' event of events fired on elements in a context menu to point to the element that had the contextmenu attribute. Would that work?
That would likely work, yes. Unsure if there are similar events that would benefit from such a property though.
I guess we need a new event type interface that has relatedTarget, since contextmenu and show are sometimes simple events, not mouse events.
similar to: http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-FocusEvent
Checked in as WHATWG revision r7791. Check-in comment: Add a .relatedTarget attribute on 'show' events for <menu> elements. http://html5.org/tools/web-apps-tracker?from=7790&to=7791
Checked in as WHATWG revision r7792. Check-in comment: Set the .relatedTarget attribute on 'click' events for <menuitem> elements (and their master commands) properly. http://html5.org/tools/web-apps-tracker?from=7791&to=7792