[html5] r7791 - [giow] (1) Add a .relatedTarget attribute on 'show' events for <menu> elements. [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Apr 3 13:23:33 PDT 2013


Author: ianh
Date: 2013-04-03 13:23:31 -0700 (Wed, 03 Apr 2013)
New Revision: 7791

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Add a .relatedTarget attribute on 'show' events for <menu> elements.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17840
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2013-04-01 19:17:26 UTC (rev 7790)
+++ complete.html	2013-04-03 20:23:31 UTC (rev 7791)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 April 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 3 April 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -774,7 +774,8 @@
      <li><a href=#context-menus><span class=secno>4.11.5 </span>Context menus</a>
       <ol>
        <li><a href=#declaring-a-context-menu><span class=secno>4.11.5.1 </span>Declaring a context menu</a></li>
-       <li><a href=#processing-model-2><span class=secno>4.11.5.2 </span>Processing model</a></ol></li>
+       <li><a href=#processing-model-2><span class=secno>4.11.5.2 </span>Processing model</a></li>
+       <li><a href=#event-definitions-0><span class=secno>4.11.5.3 </span>Event definitions</a></ol></li>
      <li><a href=#commands><span class=secno>4.11.6 </span>Commands</a>
       <ol>
        <li><a href=#facets-0><span class=secno>4.11.6.1 </span>Facets</a></li>
@@ -914,7 +915,7 @@
      <li><a href=#scroll-to-fragid><span class=secno>6.6.9 </span>Navigating to a fragment identifier</a></li>
      <li><a href=#history-traversal><span class=secno>6.6.10 </span>History traversal</a>
       <ol>
-       <li><a href=#event-definitions-0><span class=secno>6.6.10.1 </span>Event definitions</a></ol></li>
+       <li><a href=#event-definitions-1><span class=secno>6.6.10.1 </span>Event definitions</a></ol></li>
      <li><a href=#unloading-documents><span class=secno>6.6.11 </span>Unloading documents</a>
       <ol>
        <li><a href=#event-definition><span class=secno>6.6.11.1 </span>Event definition</a></ol></li>
@@ -1067,7 +1068,7 @@
      <li><a href=#worker-locations><span class=secno>9.3.4 </span>Worker locations</a></ol></ol></li>
  <li><a href=#comms><span class=secno>10 </span>Communication</a>
   <ol>
-   <li><a href=#event-definitions-1><span class=secno>10.1 </span>Event definitions</a></li>
+   <li><a href=#event-definitions-2><span class=secno>10.1 </span>Event definitions</a></li>
    <li><a href=#server-sent-events><span class=secno>10.2 </span>Server-sent events</a>
     <ol>
      <li><a href=#server-sent-events-intro><span class=secno>10.2.1 </span>Introduction</a></li>
@@ -1089,7 +1090,7 @@
      <li><a href=#feedback-from-the-protocol><span class=secno>10.3.3 </span>Feedback from the protocol</a></li>
      <li><a href=#ping-and-pong-frames><span class=secno>10.3.4 </span>Ping and Pong frames</a></li>
      <li><a href=#parsing-websocket-urls><span class=secno>10.3.5 </span>Parsing WebSocket URLs</a></li>
-     <li><a href=#event-definitions-2><span class=secno>10.3.6 </span>Event definitions</a></li>
+     <li><a href=#event-definitions-3><span class=secno>10.3.6 </span>Event definitions</a></li>
      <li><a href=#garbage-collection-1><span class=secno>10.3.7 </span>Garbage collection</a></ol></li>
    <li><a href=#web-messaging><span class=secno>10.4 </span>Cross-document messaging</a>
     <ol>
@@ -50162,8 +50163,10 @@
      <li><p>Let <var title="">menu</var> be the element's <a href=#designated-pop-up-menu>designated pop-up menu</a>, if
      any. If there isn't one, then abort these steps.</li>
 
-     <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-show>show</code> that is
-     cancelable at <var title="">menu</var>. <!-- v2: include modifier key information --></li>
+     <li><p><a href=#concept-event-fire title=concept-event-fire>Fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-show>show</code> at <var title="">menu</var>, using the <code><a href=#relatedevent>RelatedEvent</a></code>
+     interface, with the <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code> attribute
+     initialized to the <code><a href=#the-button-element>button</a></code> element. The event must be cancelable. <!-- v2: include
+     modifier key information --></li>
 
      <li><p>If the event is not canceled, then <a href=#construct-and-show-a-menu title="construct and show a menu">construct and
      show</a> the menu for <var title="">menu</var>.</li>
@@ -56462,10 +56465,14 @@
 
   <h5 id=processing-model-2><span class=secno>4.11.5.2 </span>Processing model</h5>
 
-  <p>If there is no element with the ID given by an element's <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute's value in the element's <a href=#home-subtree>home
-  subtree</a>, or if the first such element is not a <code><a href=#the-menu-element>menu</a></code> element whose <code title=attr-menu-type><a href=#attr-menu-type>type</a></code> attribute is in the <a href=#popup-menu-state title="popup menu state">popup
-  menu</a> state, then the element has no assigned context menu. Otherwise, the element's
-  assigned context menu is the first such element.</p>
+  <p>Each element has an <dfn id=assigned-context-menu>assigned context menu</dfn>, which can be null. If an element <var title="">A</var> has a <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute, and there is
+  an element with the ID given by <var title="">A</var>'s <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute's value in <var title="">A</var>'s
+  <a href=#home-subtree>home subtree</a>, and the first such element in <a href=#tree-order>tree order</a> is a
+  <code><a href=#the-menu-element>menu</a></code> element whose <code title=attr-menu-type><a href=#attr-menu-type>type</a></code> attribute is in the <a href=#popup-menu-state title="popup menu state">popup menu</a> state, then <var title="">A</var>'s <a href=#assigned-context-menu>assigned
+  context menu</a> is that element. Otherwise, if <var title="">A</var> has a parent element,
+  then <var title="">A</var>'s <a href=#assigned-context-menu>assigned context menu</a> is the <a href=#assigned-context-menu>assigned context
+  menu</a> of its parent element. Otherwise, <var title="">A</var>'s <a href=#assigned-context-menu>assigned context
+  menu</a> is null.</p>
 
   <p>When an element's context menu is requested (e.g. by the user right-clicking the element, or
   pressing a context menu key), the user agent must apply the appropriate rules from the following
@@ -56489,19 +56496,25 @@
   of events is UA-dependent, as it will vary based on platform conventions.</p>
 
   <p>The default action of the <code title=event-contextmenu>contextmenu</code> event depends on
-  whether or not the element or one of its ancestors has a context menu assigned (using the <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute) when the event dispatch has completed. If
-  there is no context menu assigned, the default action must be for the user agent to show its
-  default context menu, if it has one.</p>
+  whether or not the element for which the menu was requested has a non-null <a href=#assigned-context-menu>assigned context
+  menu</a> when the event dispatch has completed, as follows.</p>
 
-  <p>If the element or one of its ancestors <em>does</em> have a context menu assigned, then the
-  user agent must <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-show>show</code> that
-  is cancelable at the <code><a href=#the-menu-element>menu</a></code> element of the context menu of the nearest ancestor
-  (including the element itself) with one assigned.</p> <!-- v2: include modifier key information
-  -->
+  <p>If the <a href=#assigned-context-menu>assigned context menu</a> of the element for which the menu was requested is
+  null, the default action must be for the user agent to show its default context menu, if it has
+  one.</p>
 
-  <p>The default action of <em>this</em> event is that the user agent must <a href=#construct-and-show-a-menu title="construct
-  and show a menu">construct and show</a> the menu for the <code><a href=#the-menu-element>menu</a></code> element.</p>
+  <p>Otherwise, let <var title="">subject</var> be the element for which the menu was requested, and
+  let <var title="">menu</var> be the <a href=#assigned-context-menu>assigned context menu</a> of <var title="">target</var> immediately after the code title="event-contextmenu">contextmenu
+  event's dispatch has completed. The user agent must <a href=#concept-event-fire title=concept-event-fire>fire</a> a
+  <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-show>show</code> at <var title="">menu</var>, using the <code><a href=#relatedevent>RelatedEvent</a></code>
+  interface, with the <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code> attribute
+  initialized to <var title="">subject</var>. The event must be cancelable. <!-- v2: include
+  modifier key information --></p>
 
+  <p>If <em>this</em> event (the <code title=event-show>show</code> event) is not canceled, then
+  the user agent must <a href=#construct-and-show-a-menu title="construct and show a menu">construct and show</a> the menu for
+  <var title="">menu</var>.</p>
+
   <p>The user agent may also provide access to its default context menu, if any, with the context
   menu shown. For example, it could merge the menu items from the two menus together, or provide the
   page's context menu as a submenu of the default menu.</p>
@@ -56512,14 +56525,43 @@
   <code title=event-contextmenu>contextmenu</code> event and instead always shows the default
   context menu.</p>
 
-  <p>The <dfn id=dom-contextmenu title=dom-contextMenu><code>contextMenu</code></dfn> IDL attribute must
+  <hr><p>The <dfn id=dom-contextmenu title=dom-contextMenu><code>contextMenu</code></dfn> IDL attribute must
   <a href=#reflect>reflect</a> the <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> content attribute.</p>
 
   </div>
 
 
+  <h5 id=event-definitions-0><span class=secno>4.11.5.3 </span>Event definitions</h5>
 
+  <pre class=idl>[Constructor(DOMString type, optional <a href=#relatedeventinit>RelatedEventInit</a> eventInitDict)]
+interface <dfn id=relatedevent>RelatedEvent</dfn> : <a href=#event>Event</a> {
+  readonly attribute <a href=#eventtarget>EventTarget</a>? <a href=#dom-relatedevent-relatedtarget title=dom-RelatedEvent-relatedTarget>relatedTarget</a>;
+};
 
+dictionary <dfn id=relatedeventinit>RelatedEventInit</dfn> : <a href=#eventinit>EventInit</a> {
+  <a href=#eventtarget>EventTarget</a>? relatedTarget;
+};</pre>
+
+  <dl class=domintro><dt><var title="">event</var> . <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code></dt>
+
+   <dd>
+
+    <p>Returns the other event target involved in this event. For example, when a <code title=event-show>show</code> event fires on a <code><a href=#the-menu-element>menu</a></code> element, the other event
+    target involved in the event would be the element for which the menu is being shown.</p>
+
+   </dd>
+
+  </dl><div class=impl>
+
+  <p>The <dfn id=dom-relatedevent-relatedtarget title=dom-RelatedEvent-relatedTarget><code>relatedTarget</code></dfn> attribute must
+  return the value it was initialized to. When the object is created, this attribute must be
+  initialized to null. It represents the other event target that is related to the event.</p>
+
+  </div>
+
+
+
+
   <h4 id=commands><span class=secno>4.11.6 </span>Commands</h4>
 
   <h5 id=facets-0><span class=secno>4.11.6.1 </span>Facets</h5>
@@ -67986,7 +68028,7 @@
   source</a>.</p>
 
 
-  <h5 id=event-definitions-0><span class=secno>6.6.10.1 </span>Event definitions</h5>
+  <h5 id=event-definitions-1><span class=secno>6.6.10.1 </span>Event definitions</h5>
 
   </div>
 
@@ -79902,7 +79944,7 @@
 
 
 
-  <h3 id=event-definitions-1><span class=secno>10.1 </span>Event definitions</h3>
+  <h3 id=event-definitions-2><span class=secno>10.1 </span>Event definitions</h3>
 
   <p>Messages in <a href=#server-sent-events>server-sent events</a>, <a href=#network>Web sockets</a>, <a href=#web-messaging>cross-document
   messaging</a>, and <a href=#channel-messaging>channel messaging</a> use the <dfn id=event-message title=event-message><code>message</code></dfn> event. </p>
@@ -81537,7 +81579,7 @@
    <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
    name</var>, and <var title="">secure</var>.</li>
 
-  </ol><h4 id=event-definitions-2><span class=secno>10.3.6 </span>Event definitions</h4>
+  </ol><h4 id=event-definitions-3><span class=secno>10.3.6 </span>Event definitions</h4>
 
   <pre class=idl>[Constructor(DOMString type, optional <a href=#closeeventinit>CloseEventInit</a> eventInitDict)]
 interface <dfn id=closeevent>CloseEvent</dfn> : <a href=#event>Event</a> {
@@ -100823,6 +100865,7 @@
    <li><code><a href=#portcollection>PortCollection</a></code>
    <li><code><a href=#propertynodelist>PropertyNodeList</a></code>
    <li><code><a href=#radionodelist>RadioNodeList</a></code>
+   <li><code><a href=#relatedevent>RelatedEvent</a></code>
    <li><code>Screen</code>, <a href=#Screen-partial>partial</a>
    <li><code><a href=#sharedworker>SharedWorker</a></code>
    <li><code><a href=#sharedworkerglobalscope>SharedWorkerGlobalScope</a></code>

Modified: index
===================================================================
--- index	2013-04-01 19:17:26 UTC (rev 7790)
+++ index	2013-04-03 20:23:31 UTC (rev 7791)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 April 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 3 April 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -774,7 +774,8 @@
      <li><a href=#context-menus><span class=secno>4.11.5 </span>Context menus</a>
       <ol>
        <li><a href=#declaring-a-context-menu><span class=secno>4.11.5.1 </span>Declaring a context menu</a></li>
-       <li><a href=#processing-model-2><span class=secno>4.11.5.2 </span>Processing model</a></ol></li>
+       <li><a href=#processing-model-2><span class=secno>4.11.5.2 </span>Processing model</a></li>
+       <li><a href=#event-definitions-0><span class=secno>4.11.5.3 </span>Event definitions</a></ol></li>
      <li><a href=#commands><span class=secno>4.11.6 </span>Commands</a>
       <ol>
        <li><a href=#facets-0><span class=secno>4.11.6.1 </span>Facets</a></li>
@@ -914,7 +915,7 @@
      <li><a href=#scroll-to-fragid><span class=secno>6.6.9 </span>Navigating to a fragment identifier</a></li>
      <li><a href=#history-traversal><span class=secno>6.6.10 </span>History traversal</a>
       <ol>
-       <li><a href=#event-definitions-0><span class=secno>6.6.10.1 </span>Event definitions</a></ol></li>
+       <li><a href=#event-definitions-1><span class=secno>6.6.10.1 </span>Event definitions</a></ol></li>
      <li><a href=#unloading-documents><span class=secno>6.6.11 </span>Unloading documents</a>
       <ol>
        <li><a href=#event-definition><span class=secno>6.6.11.1 </span>Event definition</a></ol></li>
@@ -1067,7 +1068,7 @@
      <li><a href=#worker-locations><span class=secno>9.3.4 </span>Worker locations</a></ol></ol></li>
  <li><a href=#comms><span class=secno>10 </span>Communication</a>
   <ol>
-   <li><a href=#event-definitions-1><span class=secno>10.1 </span>Event definitions</a></li>
+   <li><a href=#event-definitions-2><span class=secno>10.1 </span>Event definitions</a></li>
    <li><a href=#server-sent-events><span class=secno>10.2 </span>Server-sent events</a>
     <ol>
      <li><a href=#server-sent-events-intro><span class=secno>10.2.1 </span>Introduction</a></li>
@@ -1089,7 +1090,7 @@
      <li><a href=#feedback-from-the-protocol><span class=secno>10.3.3 </span>Feedback from the protocol</a></li>
      <li><a href=#ping-and-pong-frames><span class=secno>10.3.4 </span>Ping and Pong frames</a></li>
      <li><a href=#parsing-websocket-urls><span class=secno>10.3.5 </span>Parsing WebSocket URLs</a></li>
-     <li><a href=#event-definitions-2><span class=secno>10.3.6 </span>Event definitions</a></li>
+     <li><a href=#event-definitions-3><span class=secno>10.3.6 </span>Event definitions</a></li>
      <li><a href=#garbage-collection-1><span class=secno>10.3.7 </span>Garbage collection</a></ol></li>
    <li><a href=#web-messaging><span class=secno>10.4 </span>Cross-document messaging</a>
     <ol>
@@ -50162,8 +50163,10 @@
      <li><p>Let <var title="">menu</var> be the element's <a href=#designated-pop-up-menu>designated pop-up menu</a>, if
      any. If there isn't one, then abort these steps.</li>
 
-     <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-show>show</code> that is
-     cancelable at <var title="">menu</var>. <!-- v2: include modifier key information --></li>
+     <li><p><a href=#concept-event-fire title=concept-event-fire>Fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-show>show</code> at <var title="">menu</var>, using the <code><a href=#relatedevent>RelatedEvent</a></code>
+     interface, with the <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code> attribute
+     initialized to the <code><a href=#the-button-element>button</a></code> element. The event must be cancelable. <!-- v2: include
+     modifier key information --></li>
 
      <li><p>If the event is not canceled, then <a href=#construct-and-show-a-menu title="construct and show a menu">construct and
      show</a> the menu for <var title="">menu</var>.</li>
@@ -56462,10 +56465,14 @@
 
   <h5 id=processing-model-2><span class=secno>4.11.5.2 </span>Processing model</h5>
 
-  <p>If there is no element with the ID given by an element's <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute's value in the element's <a href=#home-subtree>home
-  subtree</a>, or if the first such element is not a <code><a href=#the-menu-element>menu</a></code> element whose <code title=attr-menu-type><a href=#attr-menu-type>type</a></code> attribute is in the <a href=#popup-menu-state title="popup menu state">popup
-  menu</a> state, then the element has no assigned context menu. Otherwise, the element's
-  assigned context menu is the first such element.</p>
+  <p>Each element has an <dfn id=assigned-context-menu>assigned context menu</dfn>, which can be null. If an element <var title="">A</var> has a <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute, and there is
+  an element with the ID given by <var title="">A</var>'s <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute's value in <var title="">A</var>'s
+  <a href=#home-subtree>home subtree</a>, and the first such element in <a href=#tree-order>tree order</a> is a
+  <code><a href=#the-menu-element>menu</a></code> element whose <code title=attr-menu-type><a href=#attr-menu-type>type</a></code> attribute is in the <a href=#popup-menu-state title="popup menu state">popup menu</a> state, then <var title="">A</var>'s <a href=#assigned-context-menu>assigned
+  context menu</a> is that element. Otherwise, if <var title="">A</var> has a parent element,
+  then <var title="">A</var>'s <a href=#assigned-context-menu>assigned context menu</a> is the <a href=#assigned-context-menu>assigned context
+  menu</a> of its parent element. Otherwise, <var title="">A</var>'s <a href=#assigned-context-menu>assigned context
+  menu</a> is null.</p>
 
   <p>When an element's context menu is requested (e.g. by the user right-clicking the element, or
   pressing a context menu key), the user agent must apply the appropriate rules from the following
@@ -56489,19 +56496,25 @@
   of events is UA-dependent, as it will vary based on platform conventions.</p>
 
   <p>The default action of the <code title=event-contextmenu>contextmenu</code> event depends on
-  whether or not the element or one of its ancestors has a context menu assigned (using the <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> attribute) when the event dispatch has completed. If
-  there is no context menu assigned, the default action must be for the user agent to show its
-  default context menu, if it has one.</p>
+  whether or not the element for which the menu was requested has a non-null <a href=#assigned-context-menu>assigned context
+  menu</a> when the event dispatch has completed, as follows.</p>
 
-  <p>If the element or one of its ancestors <em>does</em> have a context menu assigned, then the
-  user agent must <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-show>show</code> that
-  is cancelable at the <code><a href=#the-menu-element>menu</a></code> element of the context menu of the nearest ancestor
-  (including the element itself) with one assigned.</p> <!-- v2: include modifier key information
-  -->
+  <p>If the <a href=#assigned-context-menu>assigned context menu</a> of the element for which the menu was requested is
+  null, the default action must be for the user agent to show its default context menu, if it has
+  one.</p>
 
-  <p>The default action of <em>this</em> event is that the user agent must <a href=#construct-and-show-a-menu title="construct
-  and show a menu">construct and show</a> the menu for the <code><a href=#the-menu-element>menu</a></code> element.</p>
+  <p>Otherwise, let <var title="">subject</var> be the element for which the menu was requested, and
+  let <var title="">menu</var> be the <a href=#assigned-context-menu>assigned context menu</a> of <var title="">target</var> immediately after the code title="event-contextmenu">contextmenu
+  event's dispatch has completed. The user agent must <a href=#concept-event-fire title=concept-event-fire>fire</a> a
+  <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-show>show</code> at <var title="">menu</var>, using the <code><a href=#relatedevent>RelatedEvent</a></code>
+  interface, with the <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code> attribute
+  initialized to <var title="">subject</var>. The event must be cancelable. <!-- v2: include
+  modifier key information --></p>
 
+  <p>If <em>this</em> event (the <code title=event-show>show</code> event) is not canceled, then
+  the user agent must <a href=#construct-and-show-a-menu title="construct and show a menu">construct and show</a> the menu for
+  <var title="">menu</var>.</p>
+
   <p>The user agent may also provide access to its default context menu, if any, with the context
   menu shown. For example, it could merge the menu items from the two menus together, or provide the
   page's context menu as a submenu of the default menu.</p>
@@ -56512,14 +56525,43 @@
   <code title=event-contextmenu>contextmenu</code> event and instead always shows the default
   context menu.</p>
 
-  <p>The <dfn id=dom-contextmenu title=dom-contextMenu><code>contextMenu</code></dfn> IDL attribute must
+  <hr><p>The <dfn id=dom-contextmenu title=dom-contextMenu><code>contextMenu</code></dfn> IDL attribute must
   <a href=#reflect>reflect</a> the <code title=attr-contextmenu><a href=#attr-contextmenu>contextmenu</a></code> content attribute.</p>
 
   </div>
 
 
+  <h5 id=event-definitions-0><span class=secno>4.11.5.3 </span>Event definitions</h5>
 
+  <pre class=idl>[Constructor(DOMString type, optional <a href=#relatedeventinit>RelatedEventInit</a> eventInitDict)]
+interface <dfn id=relatedevent>RelatedEvent</dfn> : <a href=#event>Event</a> {
+  readonly attribute <a href=#eventtarget>EventTarget</a>? <a href=#dom-relatedevent-relatedtarget title=dom-RelatedEvent-relatedTarget>relatedTarget</a>;
+};
 
+dictionary <dfn id=relatedeventinit>RelatedEventInit</dfn> : <a href=#eventinit>EventInit</a> {
+  <a href=#eventtarget>EventTarget</a>? relatedTarget;
+};</pre>
+
+  <dl class=domintro><dt><var title="">event</var> . <code title=dom-RelatedEvent-relatedTarget><a href=#dom-relatedevent-relatedtarget>relatedTarget</a></code></dt>
+
+   <dd>
+
+    <p>Returns the other event target involved in this event. For example, when a <code title=event-show>show</code> event fires on a <code><a href=#the-menu-element>menu</a></code> element, the other event
+    target involved in the event would be the element for which the menu is being shown.</p>
+
+   </dd>
+
+  </dl><div class=impl>
+
+  <p>The <dfn id=dom-relatedevent-relatedtarget title=dom-RelatedEvent-relatedTarget><code>relatedTarget</code></dfn> attribute must
+  return the value it was initialized to. When the object is created, this attribute must be
+  initialized to null. It represents the other event target that is related to the event.</p>
+
+  </div>
+
+
+
+
   <h4 id=commands><span class=secno>4.11.6 </span>Commands</h4>
 
   <h5 id=facets-0><span class=secno>4.11.6.1 </span>Facets</h5>
@@ -67986,7 +68028,7 @@
   source</a>.</p>
 
 
-  <h5 id=event-definitions-0><span class=secno>6.6.10.1 </span>Event definitions</h5>
+  <h5 id=event-definitions-1><span class=secno>6.6.10.1 </span>Event definitions</h5>
 
   </div>
 
@@ -79902,7 +79944,7 @@
 
 
 
-  <h3 id=event-definitions-1><span class=secno>10.1 </span>Event definitions</h3>
+  <h3 id=event-definitions-2><span class=secno>10.1 </span>Event definitions</h3>
 
   <p>Messages in <a href=#server-sent-events>server-sent events</a>, <a href=#network>Web sockets</a>, <a href=#web-messaging>cross-document
   messaging</a>, and <a href=#channel-messaging>channel messaging</a> use the <dfn id=event-message title=event-message><code>message</code></dfn> event. </p>
@@ -81537,7 +81579,7 @@
    <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
    name</var>, and <var title="">secure</var>.</li>
 
-  </ol><h4 id=event-definitions-2><span class=secno>10.3.6 </span>Event definitions</h4>
+  </ol><h4 id=event-definitions-3><span class=secno>10.3.6 </span>Event definitions</h4>
 
   <pre class=idl>[Constructor(DOMString type, optional <a href=#closeeventinit>CloseEventInit</a> eventInitDict)]
 interface <dfn id=closeevent>CloseEvent</dfn> : <a href=#event>Event</a> {
@@ -100823,6 +100865,7 @@
    <li><code><a href=#portcollection>PortCollection</a></code>
    <li><code><a href=#propertynodelist>PropertyNodeList</a></code>
    <li><code><a href=#radionodelist>RadioNodeList</a></code>
+   <li><code><a href=#relatedevent>RelatedEvent</a></code>
    <li><code>Screen</code>, <a href=#Screen-partial>partial</a>
    <li><code><a href=#sharedworker>SharedWorker</a></code>
    <li><code><a href=#sharedworkerglobalscope>SharedWorkerGlobalScope</a></code>

Modified: source
===================================================================
--- source	2013-04-01 19:17:26 UTC (rev 7790)
+++ source	2013-04-03 20:23:31 UTC (rev 7791)
@@ -59536,8 +59536,12 @@
      <li><p>Let <var title="">menu</var> be the element's <span>designated pop-up menu</span>, if
      any. If there isn't one, then abort these steps.</p></li>
 
-     <li><p><span>Fire a simple event</span> named <code title="event-show">show</code> that is
-     cancelable at <var title="">menu</var>. <!-- v2: include modifier key information --></p></li>
+     <li><p><span title="concept-event-fire">Fire</span> a <span
+     title="concept-events-trusted">trusted</span> event with the name <code
+     title="event-show">show</code> at <var title="">menu</var>, using the <code>RelatedEvent</code>
+     interface, with the <code title="dom-RelatedEvent-relatedTarget">relatedTarget</code> attribute
+     initialized to the <code>button</code> element. The event must be cancelable. <!-- v2: include
+     modifier key information --></p></li>
 
      <li><p>If the event is not canceled, then <span title="construct and show a menu">construct and
      show</span> the menu for <var title="">menu</var>.</p></li>
@@ -66976,12 +66980,17 @@
 
   <h5>Processing model</h5>
 
-  <p>If there is no element with the ID given by an element's <code
-  title="attr-contextmenu">contextmenu</code> attribute's value in the element's <span>home
-  subtree</span>, or if the first such element is not a <code>menu</code> element whose <code
-  title="attr-menu-type">type</code> attribute is in the <span title="popup menu state">popup
-  menu</span> state, then the element has no assigned context menu. Otherwise, the element's
-  assigned context menu is the first such element.</p>
+  <p>Each element has an <dfn>assigned context menu</dfn>, which can be null. If an element <var
+  title="">A</var> has a <code title="attr-contextmenu">contextmenu</code> attribute, and there is
+  an element with the ID given by <var title="">A</var>'s <code
+  title="attr-contextmenu">contextmenu</code> attribute's value in <var title="">A</var>'s
+  <span>home subtree</span>, and the first such element in <span>tree order</span> is a
+  <code>menu</code> element whose <code title="attr-menu-type">type</code> attribute is in the <span
+  title="popup menu state">popup menu</span> state, then <var title="">A</var>'s <span>assigned
+  context menu</span> is that element. Otherwise, if <var title="">A</var> has a parent element,
+  then <var title="">A</var>'s <span>assigned context menu</span> is the <span>assigned context
+  menu</span> of its parent element. Otherwise, <var title="">A</var>'s <span>assigned context
+  menu</span> is null.</p>
 
   <p>When an element's context menu is requested (e.g. by the user right-clicking the element, or
   pressing a context menu key), the user agent must apply the appropriate rules from the following
@@ -67013,20 +67022,27 @@
   of events is UA-dependent, as it will vary based on platform conventions.</p>
 
   <p>The default action of the <code title="event-contextmenu">contextmenu</code> event depends on
-  whether or not the element or one of its ancestors has a context menu assigned (using the <code
-  title="attr-contextmenu">contextmenu</code> attribute) when the event dispatch has completed. If
-  there is no context menu assigned, the default action must be for the user agent to show its
-  default context menu, if it has one.</p>
+  whether or not the element for which the menu was requested has a non-null <span>assigned context
+  menu</span> when the event dispatch has completed, as follows.</p>
 
-  <p>If the element or one of its ancestors <em>does</em> have a context menu assigned, then the
-  user agent must <span>fire a simple event</span> named <code title="event-show">show</code> that
-  is cancelable at the <code>menu</code> element of the context menu of the nearest ancestor
-  (including the element itself) with one assigned.</p> <!-- v2: include modifier key information
-  -->
+  <p>If the <span>assigned context menu</span> of the element for which the menu was requested is
+  null, the default action must be for the user agent to show its default context menu, if it has
+  one.</p>
 
-  <p>The default action of <em>this</em> event is that the user agent must <span title="construct
-  and show a menu">construct and show</span> the menu for the <code>menu</code> element.</p>
+  <p>Otherwise, let <var title="">subject</var> be the element for which the menu was requested, and
+  let <var title="">menu</var> be the <span>assigned context menu</span> of <var
+  title="">target</var> immediately after the code title="event-contextmenu">contextmenu</code>
+  event's dispatch has completed. The user agent must <span title="concept-event-fire">fire</span> a
+  <span title="concept-events-trusted">trusted</span> event with the name <code
+  title="event-show">show</code> at <var title="">menu</var>, using the <code>RelatedEvent</code>
+  interface, with the <code title="dom-RelatedEvent-relatedTarget">relatedTarget</code> attribute
+  initialized to <var title="">subject</var>. The event must be cancelable. <!-- v2: include
+  modifier key information --></p></li>
 
+  <p>If <em>this</em> event (the <code title="event-show">show</code> event) is not canceled, then
+  the user agent must <span title="construct and show a menu">construct and show</span> the menu for
+  <var title="">menu</var>.</p>
+
   <p>The user agent may also provide access to its default context menu, if any, with the context
   menu shown. For example, it could merge the menu items from the two menus together, or provide the
   page's context menu as a submenu of the default menu.</p>
@@ -67037,14 +67053,50 @@
   <code title="event-contextmenu">contextmenu</code> event and instead always shows the default
   context menu.</p>
 
+  <hr>
+
   <p>The <dfn title="dom-contextMenu"><code>contextMenu</code></dfn> IDL attribute must
   <span>reflect</span> the <code title="attr-contextmenu">contextmenu</code> content attribute.</p>
 
   </div>
 
 
+  <h5>Event definitions</h5>
 
+  <pre class="idl">[Constructor(DOMString type, optional <span>RelatedEventInit</span> eventInitDict)]
+interface <dfn>RelatedEvent</dfn> : <span>Event</span> {
+  readonly attribute <span>EventTarget</span>? <span title="dom-RelatedEvent-relatedTarget">relatedTarget</span>;
+};
 
+dictionary <dfn>RelatedEventInit</dfn> : <span>EventInit</span> {
+  <span>EventTarget</span>? relatedTarget;
+};</pre>
+
+  <dl class="domintro">
+
+   <dt><var title="">event</var> . <code title="dom-RelatedEvent-relatedTarget">relatedTarget</code></dt>
+
+   <dd>
+
+    <p>Returns the other event target involved in this event. For example, when a <code
+    title="event-show">show</code> event fires on a <code>menu</code> element, the other event
+    target involved in the event would be the element for which the menu is being shown.</p>
+
+   </dd>
+
+  </dl>
+
+  <div class="impl">
+
+  <p>The <dfn title="dom-RelatedEvent-relatedTarget"><code>relatedTarget</code></dfn> attribute must
+  return the value it was initialized to. When the object is created, this attribute must be
+  initialized to null. It represents the other event target that is related to the event.</p>
+
+  </div>
+
+
+
+
   <h4 id="commands">Commands</h4>
 
   <h5>Facets</h5>




More information about the Commit-Watchers mailing list