[html5] r8621 - [giow] (3) Spec relatedTarget for focus and blur Fixing https://www.w3.org/Bugs/ [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu May 8 13:14:01 PDT 2014


Author: ianh
Date: 2014-05-08 13:13:59 -0700 (Thu, 08 May 2014)
New Revision: 8621

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Spec relatedTarget for focus and blur
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25279
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2014-05-08 18:12:30 UTC (rev 8620)
+++ complete.html	2014-05-08 20:13:59 UTC (rev 8621)
@@ -3786,6 +3786,8 @@
     <ul class=brief><li><dfn id=mouseevent><code>MouseEvent</code></dfn> interface</li>
      <li><dfn id=mouseeventinit><code>MouseEventInit</code></dfn> dictionary type</li>
 
+     <li>The <dfn id=focusevent><code>FocusEvent</code></dfn> interface and its <dfn id=dom-focusevent-relatedtarget title=dom-FocusEvent-relatedTarget><code>relatedTarget</code></dfn> attribute</li>
+
      <li>The <dfn id=uievent><code>UIEvent</code></dfn> interface's <dfn id=dom-uievent-detail title=dom-UIEvent-detail><code>detail</code></dfn> attribute</li>
 
      <li><dfn id=event-click title=event-click><code>click</code></dfn> event</li>
@@ -77444,10 +77446,17 @@
 
      </li>
 
+     <li><p>If <var title="">entry</var> is the last entry in <var title="">old chain</var>, and
+     <var title="">entry</var> is an <code><a href=#element>Element</a></code>, and the last entry in <var title="">new
+     chain</var> is also an <code><a href=#element>Element</a></code>, then let <var title="">related blur target</var>
+     be the last entry in <var title="">new chain</var>. Otherwise, let <var title="">related blur
+     target</var> be null.</li>
+
      <li>
 
-      <p>If <var title="">blur event target</var> is not null, <a href=#fire-a-simple-event>fire a simple event</a>
-      named <code title=event-blur><a href=#event-blur>blur</a></code> at <var title="">blur event target</var>.</p>
+      <p>If <var title="">blur event target</var> is not null, <a href=#fire-a-focus-event>fire a focus event</a>
+      named <code title=event-blur><a href=#event-blur>blur</a></code> at <var title="">blur event target</var>, with
+      <var title="">related blur target</var> as the related target.</p>
 
       <p class=note>In some cases, e.g. if <var title="">entry</var> is an <code><a href=#the-area-element>area</a></code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -77493,10 +77502,17 @@
 
      </li>
 
+     <li><p>If <var title="">entry</var> is the last entry in <var title="">new chain</var>, and
+     <var title="">entry</var> is an <code><a href=#element>Element</a></code>, and the last entry in <var title="">old
+     chain</var> is also an <code><a href=#element>Element</a></code>, then let <var title="">related focus target</var>
+     be the last entry in <var title="">old chain</var>. Otherwise, let <var title="">related
+     focus target</var> be null.</li>
+
      <li>
 
-      <p>If <var title="">focus event target</var> is not null, <a href=#fire-a-simple-event>fire a simple event</a>
-      named <code title=event-focus><a href=#event-focus>focus</a></code> at <var title="">focus event target</var>.</p>
+      <p>If <var title="">focus event target</var> is not null, <a href=#fire-a-focus-event>fire a focus event</a>
+      named <code title=event-focus><a href=#event-focus>focus</a></code> at <var title="">focus event target</var>, with
+      <var title="">related focus target</var> as the related target.</p>
 
       <p class=note>In some cases, e.g. if <var title="">entry</var> is an <code><a href=#the-area-element>area</a></code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -77505,7 +77521,15 @@
    
     </ol></li>
 
-  </ol><hr><p>When a key event is to be routed in a <a href=#top-level-browsing-context>top-level browsing context</a>, the user agent
+  </ol><p>When a user agent is required to <dfn id=fire-a-focus-event>fire a focus event</dfn> named <var title="">e</var> at
+  an element <var title="">t</var> and with a given related target <var title="">r</var>, the user
+  agent must create a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#focusevent>FocusEvent</a></code>
+  object, initialize it to have the given name <var title="">e</var>, to not bubble, to not be
+  cancelable, and to have the <code title=dom-FocusEvent-relatedTarget><a href=#dom-focusevent-relatedtarget>relatedTarget</a></code>
+  attribute initialized to <var title="">r</var>, and must then <a href=#concept-event-dispatch title=concept-event-dispatch>dispatch</a> the newly created <code><a href=#focusevent>FocusEvent</a></code> object
+  at the specified target element <var title="">t</var>.</p>
+
+  <hr><p>When a key event is to be routed in a <a href=#top-level-browsing-context>top-level browsing context</a>, the user agent
   must run the following steps:</p>
 
   <ol><li><p>Let <var title="">target area</var> be the <a href=#currently-focused-area-of-a-top-level-browsing-context title="currently focused area of a
@@ -104564,6 +104588,7 @@
   Anthony Hickson,
   Anthony Ricaud,
   Antti Koivisto,
+  Arkadiusz Michalski,
   Arne Thomassen,
   Aron Spohr,
   Arphen Lin,

Modified: index
===================================================================
--- index	2014-05-08 18:12:30 UTC (rev 8620)
+++ index	2014-05-08 20:13:59 UTC (rev 8621)
@@ -3786,6 +3786,8 @@
     <ul class=brief><li><dfn id=mouseevent><code>MouseEvent</code></dfn> interface</li>
      <li><dfn id=mouseeventinit><code>MouseEventInit</code></dfn> dictionary type</li>
 
+     <li>The <dfn id=focusevent><code>FocusEvent</code></dfn> interface and its <dfn id=dom-focusevent-relatedtarget title=dom-FocusEvent-relatedTarget><code>relatedTarget</code></dfn> attribute</li>
+
      <li>The <dfn id=uievent><code>UIEvent</code></dfn> interface's <dfn id=dom-uievent-detail title=dom-UIEvent-detail><code>detail</code></dfn> attribute</li>
 
      <li><dfn id=event-click title=event-click><code>click</code></dfn> event</li>
@@ -77444,10 +77446,17 @@
 
      </li>
 
+     <li><p>If <var title="">entry</var> is the last entry in <var title="">old chain</var>, and
+     <var title="">entry</var> is an <code><a href=#element>Element</a></code>, and the last entry in <var title="">new
+     chain</var> is also an <code><a href=#element>Element</a></code>, then let <var title="">related blur target</var>
+     be the last entry in <var title="">new chain</var>. Otherwise, let <var title="">related blur
+     target</var> be null.</li>
+
      <li>
 
-      <p>If <var title="">blur event target</var> is not null, <a href=#fire-a-simple-event>fire a simple event</a>
-      named <code title=event-blur><a href=#event-blur>blur</a></code> at <var title="">blur event target</var>.</p>
+      <p>If <var title="">blur event target</var> is not null, <a href=#fire-a-focus-event>fire a focus event</a>
+      named <code title=event-blur><a href=#event-blur>blur</a></code> at <var title="">blur event target</var>, with
+      <var title="">related blur target</var> as the related target.</p>
 
       <p class=note>In some cases, e.g. if <var title="">entry</var> is an <code><a href=#the-area-element>area</a></code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -77493,10 +77502,17 @@
 
      </li>
 
+     <li><p>If <var title="">entry</var> is the last entry in <var title="">new chain</var>, and
+     <var title="">entry</var> is an <code><a href=#element>Element</a></code>, and the last entry in <var title="">old
+     chain</var> is also an <code><a href=#element>Element</a></code>, then let <var title="">related focus target</var>
+     be the last entry in <var title="">old chain</var>. Otherwise, let <var title="">related
+     focus target</var> be null.</li>
+
      <li>
 
-      <p>If <var title="">focus event target</var> is not null, <a href=#fire-a-simple-event>fire a simple event</a>
-      named <code title=event-focus><a href=#event-focus>focus</a></code> at <var title="">focus event target</var>.</p>
+      <p>If <var title="">focus event target</var> is not null, <a href=#fire-a-focus-event>fire a focus event</a>
+      named <code title=event-focus><a href=#event-focus>focus</a></code> at <var title="">focus event target</var>, with
+      <var title="">related focus target</var> as the related target.</p>
 
       <p class=note>In some cases, e.g. if <var title="">entry</var> is an <code><a href=#the-area-element>area</a></code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -77505,7 +77521,15 @@
    
     </ol></li>
 
-  </ol><hr><p>When a key event is to be routed in a <a href=#top-level-browsing-context>top-level browsing context</a>, the user agent
+  </ol><p>When a user agent is required to <dfn id=fire-a-focus-event>fire a focus event</dfn> named <var title="">e</var> at
+  an element <var title="">t</var> and with a given related target <var title="">r</var>, the user
+  agent must create a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#focusevent>FocusEvent</a></code>
+  object, initialize it to have the given name <var title="">e</var>, to not bubble, to not be
+  cancelable, and to have the <code title=dom-FocusEvent-relatedTarget><a href=#dom-focusevent-relatedtarget>relatedTarget</a></code>
+  attribute initialized to <var title="">r</var>, and must then <a href=#concept-event-dispatch title=concept-event-dispatch>dispatch</a> the newly created <code><a href=#focusevent>FocusEvent</a></code> object
+  at the specified target element <var title="">t</var>.</p>
+
+  <hr><p>When a key event is to be routed in a <a href=#top-level-browsing-context>top-level browsing context</a>, the user agent
   must run the following steps:</p>
 
   <ol><li><p>Let <var title="">target area</var> be the <a href=#currently-focused-area-of-a-top-level-browsing-context title="currently focused area of a
@@ -104564,6 +104588,7 @@
   Anthony Hickson,
   Anthony Ricaud,
   Antti Koivisto,
+  Arkadiusz Michalski,
   Arne Thomassen,
   Aron Spohr,
   Arphen Lin,

Modified: source
===================================================================
--- source	2014-05-08 18:12:30 UTC (rev 8620)
+++ source	2014-05-08 20:13:59 UTC (rev 8621)
@@ -2524,6 +2524,8 @@
      <li><dfn><code>MouseEvent</code></dfn> interface</li>
      <li><dfn><code>MouseEventInit</code></dfn> dictionary type</li>
 
+     <li>The <dfn><code>FocusEvent</code></dfn> interface and its <dfn data-x="dom-FocusEvent-relatedTarget"><code>relatedTarget</code></dfn> attribute</li>
+
      <li>The <dfn><code>UIEvent</code></dfn> interface's <dfn data-x="dom-UIEvent-detail"><code>detail</code></dfn> attribute</li>
 
      <li><dfn data-x="event-click"><code>click</code></dfn> event</li>
@@ -85556,10 +85558,17 @@
 
      </li>
 
+     <li><p>If <var data-x="">entry</var> is the last entry in <var data-x="">old chain</var>, and
+     <var data-x="">entry</var> is an <code>Element</code>, and the last entry in <var data-x="">new
+     chain</var> is also an <code>Element</code>, then let <var data-x="">related blur target</var>
+     be the last entry in <var data-x="">new chain</var>. Otherwise, let <var data-x="">related blur
+     target</var> be null.</p></li>
+
      <li>
 
-      <p>If <var data-x="">blur event target</var> is not null, <span>fire a simple event</span>
-      named <code data-x="event-blur">blur</code> at <var data-x="">blur event target</var>.</p>
+      <p>If <var data-x="">blur event target</var> is not null, <span>fire a focus event</span>
+      named <code data-x="event-blur">blur</code> at <var data-x="">blur event target</var>, with
+      <var data-x="">related blur target</var> as the related target.</p>
 
       <p class="note">In some cases, e.g. if <var data-x="">entry</var> is an <code>area</code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -85611,10 +85620,17 @@
 
      </li>
 
+     <li><p>If <var data-x="">entry</var> is the last entry in <var data-x="">new chain</var>, and
+     <var data-x="">entry</var> is an <code>Element</code>, and the last entry in <var data-x="">old
+     chain</var> is also an <code>Element</code>, then let <var data-x="">related focus target</var>
+     be the last entry in <var data-x="">old chain</var>. Otherwise, let <var data-x="">related
+     focus target</var> be null.</p></li>
+
      <li>
 
-      <p>If <var data-x="">focus event target</var> is not null, <span>fire a simple event</span>
-      named <code data-x="event-focus">focus</code> at <var data-x="">focus event target</var>.</p>
+      <p>If <var data-x="">focus event target</var> is not null, <span>fire a focus event</span>
+      named <code data-x="event-focus">focus</code> at <var data-x="">focus event target</var>, with
+      <var data-x="">related focus target</var> as the related target.</p>
 
       <p class="note">In some cases, e.g. if <var data-x="">entry</var> is an <code>area</code>
       element's shape, a scrollable region, or a viewport, no event is fired.</p>
@@ -85627,6 +85643,15 @@
 
   </ol>
 
+  <p>When a user agent is required to <dfn>fire a focus event</dfn> named <var data-x="">e</var> at
+  an element <var data-x="">t</var> and with a given related target <var data-x="">r</var>, the user
+  agent must create a <span data-x="concept-events-trusted">trusted</span> <code>FocusEvent</code>
+  object, initialize it to have the given name <var data-x="">e</var>, to not bubble, to not be
+  cancelable, and to have the <code data-x="dom-FocusEvent-relatedTarget">relatedTarget</code>
+  attribute initialized to <var data-x="">r</var>, and must then <span
+  data-x="concept-event-dispatch">dispatch</span> the newly created <code>FocusEvent</code> object
+  at the specified target element <var data-x="">t</var>.</p>
+
   <hr>
 
   <p>When a key event is to be routed in a <span>top-level browsing context</span>, the user agent
@@ -115701,6 +115726,7 @@
   Anthony Hickson,
   Anthony Ricaud,
   Antti Koivisto,
+  Arkadiusz Michalski,
   Arne Thomassen,
   Aron Spohr,
   Arphen Lin,



More information about the Commit-Watchers mailing list