[html5] r7792 - [giow] (1) Set the .relatedTarget attribute on 'click' events for <menuitem> ele [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Apr 3 15:31:11 PDT 2013


Author: ianh
Date: 2013-04-03 15:31:07 -0700 (Wed, 03 Apr 2013)
New Revision: 7792

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Set the .relatedTarget attribute on 'click' events for <menuitem> elements (and their master commands) properly.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17840
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2013-04-03 20:23:31 UTC (rev 7791)
+++ complete.html	2013-04-03 22:31:07 UTC (rev 7792)
@@ -50169,7 +50169,8 @@
      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>
+     show</a> the menu for <var title="">menu</var>, with the <code><a href=#the-button-element>button</a></code> element as the
+     subject.</li>
 
     </ol></dd>
 
@@ -56063,7 +56064,7 @@
   <ul class=brief><li><a href=#concept-command title=concept-command>Commands</a>, which can be marked as default commands (<code><a href=#the-menuitem-element>menuitem</a></code>)</li>
    <li>Separators (<code><a href=#the-hr-element>hr</a></code>)</li>
    <li>Other menus, which allows the list to be nested (<code><a href=#the-menu-element>menu</a></code>)</li>
-  </ul><p>To <dfn id=construct-and-show-a-menu>construct and show a menu</dfn> for a particular <code><a href=#the-menu-element>menu</a></code> element, the user
+  </ul><!--CLEANUP--><p>To <dfn id=construct-and-show-a-menu>construct and show a menu</dfn> for a particular <code><a href=#the-menu-element>menu</a></code> element and with a particular element as a subject, the user
   agent must run the following steps:</p>
 
   <ol><li><p>Let the menu be an empty list of the type described above.</li>
@@ -56130,7 +56131,10 @@
     <p>Display the menu to the user, and let the algorithm that invoked this one continue.</p>
 
     <p>If the user selects a menu item that corresponds to an element that still represents a <a href=#concept-command title=concept-command>command</a> when the user selects it, then the UA must invoke that
-    command's <a href=#command-facet-action title=command-facet-Action>Action</a>.</p>
+    command's <a href=#command-facet-action title=command-facet-Action>Action</a>. If the command's <a href=#command-facet-action title=command-facet-Action>Action</a> is defined as <a href=#fire-a-click-event title="fire a click event">firing
+    a <code title=event-click>click</code> event</a>, either directly or via the <a href=#run-synthetic-click-activation-steps>run
+    synthetic click activation steps</a> algorithm, then the <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute of that <code title=event-click><a href=#event-click>click</a></code> event must be initialized to the subject passed to this
+    <a href=#construct-and-show-a-menu>construct and show a menu</a> algorithm.</p>
 
     <p>Pop-up menus must not, while being shown, reflect changes in the DOM. The menu is constructed
     from the DOM before being shown, and is then immutable.</p>
@@ -56504,7 +56508,7 @@
   one.</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
+  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</code>
   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
@@ -56513,7 +56517,7 @@
 
   <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>
+  <var title="">menu</var> with <var title="">subject</var> as the subject.</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
@@ -57066,7 +57070,7 @@
 
   <p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
   command, if the element has a defined <a href=#activation-behavior>activation
-  behavior</a>, is to <a href=#run-synthetic-click-activation-steps>run synthetic click activation
+  behavior</a><!-- it doesn't if the element is disabled -->, is to <a href=#run-synthetic-click-activation-steps>run synthetic click activation
   steps</a> on the element. Otherwise, it is just to <a href=#fire-a-click-event>fire a
   <code title=event-click>click</code> event</a> at the
   element.</p>
@@ -71976,6 +71980,7 @@
   <div class=impl>
 
   <h5 id=event-firing><span class=secno>7.1.6.3 </span>Event firing</h5>
+<!--CLEANUP-->
 
   <p>Certain operations and methods are defined as firing events on
   elements. For example, the <code title=dom-click><a href=#dom-click>click()</a></code>
@@ -71995,7 +72000,7 @@
   attributes initialized to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>,
   <code title="">altKey</code>, and <code title="">metaKey</code> attributes initialized according
   to the current state of the key input device, if any (false for any keys that are not available),
-  its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null. The <code title="">getModifierState()</code> method on the object must return values appropriately
+  its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The <code title="">getModifierState()</code> method on the object must return values appropriately
   describing the state of the key input device at the time the event is created.</p>
 
   <p><dfn id=fire-a-click-event title="fire a click event">Firing a <code title=event-click>click</code> event</dfn>

Modified: index
===================================================================
--- index	2013-04-03 20:23:31 UTC (rev 7791)
+++ index	2013-04-03 22:31:07 UTC (rev 7792)
@@ -50169,7 +50169,8 @@
      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>
+     show</a> the menu for <var title="">menu</var>, with the <code><a href=#the-button-element>button</a></code> element as the
+     subject.</li>
 
     </ol></dd>
 
@@ -56063,7 +56064,7 @@
   <ul class=brief><li><a href=#concept-command title=concept-command>Commands</a>, which can be marked as default commands (<code><a href=#the-menuitem-element>menuitem</a></code>)</li>
    <li>Separators (<code><a href=#the-hr-element>hr</a></code>)</li>
    <li>Other menus, which allows the list to be nested (<code><a href=#the-menu-element>menu</a></code>)</li>
-  </ul><p>To <dfn id=construct-and-show-a-menu>construct and show a menu</dfn> for a particular <code><a href=#the-menu-element>menu</a></code> element, the user
+  </ul><!--CLEANUP--><p>To <dfn id=construct-and-show-a-menu>construct and show a menu</dfn> for a particular <code><a href=#the-menu-element>menu</a></code> element and with a particular element as a subject, the user
   agent must run the following steps:</p>
 
   <ol><li><p>Let the menu be an empty list of the type described above.</li>
@@ -56130,7 +56131,10 @@
     <p>Display the menu to the user, and let the algorithm that invoked this one continue.</p>
 
     <p>If the user selects a menu item that corresponds to an element that still represents a <a href=#concept-command title=concept-command>command</a> when the user selects it, then the UA must invoke that
-    command's <a href=#command-facet-action title=command-facet-Action>Action</a>.</p>
+    command's <a href=#command-facet-action title=command-facet-Action>Action</a>. If the command's <a href=#command-facet-action title=command-facet-Action>Action</a> is defined as <a href=#fire-a-click-event title="fire a click event">firing
+    a <code title=event-click>click</code> event</a>, either directly or via the <a href=#run-synthetic-click-activation-steps>run
+    synthetic click activation steps</a> algorithm, then the <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute of that <code title=event-click><a href=#event-click>click</a></code> event must be initialized to the subject passed to this
+    <a href=#construct-and-show-a-menu>construct and show a menu</a> algorithm.</p>
 
     <p>Pop-up menus must not, while being shown, reflect changes in the DOM. The menu is constructed
     from the DOM before being shown, and is then immutable.</p>
@@ -56504,7 +56508,7 @@
   one.</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
+  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</code>
   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
@@ -56513,7 +56517,7 @@
 
   <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>
+  <var title="">menu</var> with <var title="">subject</var> as the subject.</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
@@ -57066,7 +57070,7 @@
 
   <p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
   command, if the element has a defined <a href=#activation-behavior>activation
-  behavior</a>, is to <a href=#run-synthetic-click-activation-steps>run synthetic click activation
+  behavior</a><!-- it doesn't if the element is disabled -->, is to <a href=#run-synthetic-click-activation-steps>run synthetic click activation
   steps</a> on the element. Otherwise, it is just to <a href=#fire-a-click-event>fire a
   <code title=event-click>click</code> event</a> at the
   element.</p>
@@ -71976,6 +71980,7 @@
   <div class=impl>
 
   <h5 id=event-firing><span class=secno>7.1.6.3 </span>Event firing</h5>
+<!--CLEANUP-->
 
   <p>Certain operations and methods are defined as firing events on
   elements. For example, the <code title=dom-click><a href=#dom-click>click()</a></code>
@@ -71995,7 +72000,7 @@
   attributes initialized to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>,
   <code title="">altKey</code>, and <code title="">metaKey</code> attributes initialized according
   to the current state of the key input device, if any (false for any keys that are not available),
-  its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null. The <code title="">getModifierState()</code> method on the object must return values appropriately
+  its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The <code title="">getModifierState()</code> method on the object must return values appropriately
   describing the state of the key input device at the time the event is created.</p>
 
   <p><dfn id=fire-a-click-event title="fire a click event">Firing a <code title=event-click>click</code> event</dfn>

Modified: source
===================================================================
--- source	2013-04-03 20:23:31 UTC (rev 7791)
+++ source	2013-04-03 22:31:07 UTC (rev 7792)
@@ -59544,7 +59544,8 @@
      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>
+     show</span> the menu for <var title="">menu</var>, with the <code>button</code> element as the
+     subject.</p></li>
 
     </ol>
 
@@ -66511,8 +66512,9 @@
    <li>Separators (<code>hr</code>)</li>
    <li>Other menus, which allows the list to be nested (<code>menu</code>)</li>
   </ul>
+<!--CLEANUP-->
 
-  <p>To <dfn>construct and show a menu</dfn> for a particular <code>menu</code> element, the user
+  <p>To <dfn>construct and show a menu</dfn> for a particular <code>menu</code> element and with a particular element as a subject, the user
   agent must run the following steps:</p>
 
   <ol>
@@ -66586,7 +66588,13 @@
 
     <p>If the user selects a menu item that corresponds to an element that still represents a <span
     title="concept-command">command</span> when the user selects it, then the UA must invoke that
-    command's <span title="command-facet-Action">Action</span>.</p>
+    command's <span title="command-facet-Action">Action</span>. If the command's <span
+    title="command-facet-Action">Action</span> is defined as <span title="fire a click event">firing
+    a <code title="event-click">click</code> event</span>, either directly or via the <span>run
+    synthetic click activation steps</span> algorithm, then the <code
+    title="dom-MouseEvent-relatedTarget">relatedTarget</code> attribute of that <code
+    title="event-click">click</code> event must be initialized to the subject passed to this
+    <span>construct and show a menu</span> algorithm.</p>
 
     <p>Pop-up menus must not, while being shown, reflect changes in the DOM. The menu is constructed
     from the DOM before being shown, and is then immutable.</p>
@@ -67031,7 +67039,7 @@
 
   <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>
+  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>
@@ -67041,7 +67049,7 @@
 
   <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>
+  <var title="">menu</var> with <var title="">subject</var> as the subject.</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
@@ -67704,7 +67712,7 @@
 
   <p>The <span title="command-facet-Action">Action</span> of the
   command, if the element has a defined <span>activation
-  behavior</span>, is to <span>run synthetic click activation
+  behavior</span><!-- it doesn't if the element is disabled -->, is to <span>run synthetic click activation
   steps</span> on the element. Otherwise, it is just to <span>fire a
   <code title="event-click">click</code> event</span> at the
   element.</p>
@@ -85062,6 +85070,7 @@
   <div class="impl">
 
   <h5>Event firing</h5>
+<!--CLEANUP-->
 
   <p>Certain operations and methods are defined as firing events on
   elements. For example, the <code title="dom-click">click()</code>
@@ -85086,7 +85095,7 @@
   <code title="">altKey</code>, and <code title="">metaKey</code> attributes initialized according
   to the current state of the key input device, if any (false for any keys that are not available),
   its <code title="">detail</code> attribute initialized to 1, and its <code
-  title="">relatedTarget</code> attribute initialized to null. The <code
+  title="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The <code
   title="">getModifierState()</code> method on the object must return values appropriately
   describing the state of the key input device at the time the event is created.</p>
 




More information about the Commit-Watchers mailing list