[html5] r8810 - [giow] (2) Try to match browsers better around focus. Fixing https://www.w3.org/ [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Sep 24 11:54:55 PDT 2014


Author: ianh
Date: 2014-09-24 11:54:51 -0700 (Wed, 24 Sep 2014)
New Revision: 8810

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Try to match browsers better around focus.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26826
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2014-09-24 17:45:41 UTC (rev 8809)
+++ complete.html	2014-09-24 18:54:51 UTC (rev 8810)
@@ -54542,17 +54542,21 @@
       <p>Let <var>new focus target</var> be the element's first scrollable region,
       according to a pre-order, depth-first traversal of the box tree. <a href=#refsCSS>[CSS]</a></p>
 
-     <dt>If <var>new focus target</var> is <a href=#the-body-element-2 id=processing-model-6:the-body-element-2>the body element</a> of its
-     <code id=processing-model-6:document><a href=#document>Document</a></code><dt>If <var>new focus target</var> is the <a href=#root-element id=processing-model-6:root-element>root element</a> of its
-     <code id=processing-model-6:document-2><a href=#document>Document</a></code> and that <code id=processing-model-6:document-3><a href=#document>Document</a></code> has no <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-2>body element</a><dd>
+     <dt>If <var>new focus target</var> is the <a href=#root-element id=processing-model-6:root-element>root element</a> of its
+     <code id=processing-model-6:document><a href=#document>Document</a></code><dd>
 
-      <p>Let <var>new focus target</var> be the <code id=processing-model-6:document-4><a href=#document>Document</a></code>'s viewport.</p>
+      <p>Let <var>new focus target</var> be the <code id=processing-model-6:document-2><a href=#document>Document</a></code>'s viewport.</p>
 
      <dt>If <var>new focus target</var> is a <a href=#browsing-context id=processing-model-6:browsing-context-2>browsing context</a><dd>
 
       <p>Let <var>new focus target</var> be the <a href=#browsing-context id=processing-model-6:browsing-context-3>browsing context</a>'s
       <a href=#active-document id=processing-model-6:active-document>active document</a>.</p>
 
+     <dt>If <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container>browsing context container</a><dd>
+
+      <p>Let <var>new focus target</var> be the <a href=#browsing-context-container id=processing-model-6:browsing-context-container-2>browsing context container</a>'s <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context>nested browsing context</a>'s
+      <a href=#active-document id=processing-model-6:active-document-2>active document</a>.</p>
+
      <dt>Otherwise<dd>
 
       <p>Abort the <a href=#focusing-steps id=processing-model-6:focusing-steps>focusing steps</a>.</p>
@@ -54573,9 +54577,9 @@
     group</a>, and redo this step.</p>
 
     
-    <p>Otherwise, if <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container>browsing context
-    container</a>, then let <var>new focus target</var> be the <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context>nested browsing
-    context</a>'s <a href=#active-document id=processing-model-6:active-document-2>active document</a>, and redo this step.</p>
+    <p>Otherwise, if <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container-3>browsing context
+    container</a>, then let <var>new focus target</var> be the <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context-2>nested browsing
+    context</a>'s <a href=#active-document id=processing-model-6:active-document-3>active document</a>, and redo this step.</p>
 
     <p class=note>A <code id=processing-model-6:the-dialog-element-2><a href=#the-dialog-element>dialog</a></code> element can be both a <a href=#control-group-owner-object id=processing-model-6:control-group-owner-object-4>control group owner
     object</a> and a <a href=#focusable-area id=processing-model-6:focusable-area-8>focusable area</a>, if it has both an <code id=processing-model-6:attr-dialog-open-2><a href=#attr-dialog-open>open</a></code> attribute specified and a <code id=processing-model-6:attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute specified and is <a href=#being-rendered id=processing-model-6:being-rendered-2>being
@@ -54615,7 +54619,7 @@
 
     <p>Otherwise, if <var>old focus target</var> is a <a href=#focusable-area id=processing-model-6:focusable-area-13>focusable area</a>, then let <var>new
     focus target</var> be the first <a href=#focusable-area id=processing-model-6:focusable-area-14>focusable area</a> of its <a href=#control-group id=processing-model-6:control-group-3>control group</a>
-    (if the <a href=#control-group-owner id=processing-model-6:control-group-owner>control group owner</a> is a <code id=processing-model-6:document-5><a href=#document>Document</a></code>, this will always be a
+    (if the <a href=#control-group-owner id=processing-model-6:control-group-owner>control group owner</a> is a <code id=processing-model-6:document-3><a href=#document>Document</a></code>, this will always be a
     viewport).</p>
 
     <p>Otherwise, let <var>new focus target</var> be null.</p>
@@ -54656,7 +54660,7 @@
   group</a>.</p>
 
   <p class=example>For example, this might happen because an element is removed from its
-  <code id=processing-model-6:document-6><a href=#document>Document</a></code>, or has a <code id=processing-model-6:the-hidden-attribute><a href=#the-hidden-attribute>hidden</a></code> attribute added. It might
+  <code id=processing-model-6:document-4><a href=#document>Document</a></code>, or has a <code id=processing-model-6:the-hidden-attribute><a href=#the-hidden-attribute>hidden</a></code> attribute added. It might
   also happen to an <code id=processing-model-6:the-input-element><a href=#the-input-element>input</a></code> element when the element gets <a href=#concept-fe-disabled id=processing-model-6:concept-fe-disabled>disabled</a>.</p>
 
   <p><dfn id=focus-fixup-rule-two>Focus fixup rule two</dfn>: When a <a href=#dialog-group id=processing-model-6:dialog-group-7>dialog group</a> has no designed <a href=#focused-dialog-of-the-dialog-group id=processing-model-6:focused-dialog-of-the-dialog-group-4>focused
@@ -54711,8 +54715,8 @@
       <p>If <var>entry</var> is an element, let <var>blur event target</var> be
       <var>entry</var>.</p>
 
-      <p>If <var>entry</var> is a <code id=processing-model-6:document-7><a href=#document>Document</a></code> object, let <var>blur
-      event target</var> be that <code id=processing-model-6:document-8><a href=#document>Document</a></code> object's <code id=processing-model-6:window><a href=#window>Window</a></code> object.</p>
+      <p>If <var>entry</var> is a <code id=processing-model-6:document-5><a href=#document>Document</a></code> object, let <var>blur
+      event target</var> be that <code id=processing-model-6:document-6><a href=#document>Document</a></code> object's <code id=processing-model-6:window><a href=#window>Window</a></code> object.</p>
 
       <p>Otherwise, let <var>blur event target</var> be null.</p>
 
@@ -54753,8 +54757,8 @@
       <p>If <var>entry</var> is an element, let <var>focus event target</var> be
       <var>entry</var>.</p>
 
-      <p>If <var>entry</var> is a <code id=processing-model-6:document-9><a href=#document>Document</a></code> object, let <var>focus
-      event target</var> be that <code id=processing-model-6:document-10><a href=#document>Document</a></code> object's <code id=processing-model-6:window-2><a href=#window>Window</a></code> object.</p>
+      <p>If <var>entry</var> is a <code id=processing-model-6:document-7><a href=#document>Document</a></code> object, let <var>focus
+      event target</var> be that <code id=processing-model-6:document-8><a href=#document>Document</a></code> object's <code id=processing-model-6:window-2><a href=#window>Window</a></code> object.</p>
 
       <p>Otherwise, let <var>focus event target</var> be null.</p>
 
@@ -54780,7 +54784,7 @@
   agent must create a <a href=#concept-events-trusted id=processing-model-6:concept-events-trusted>trusted</a> <code id=processing-model-6:focusevent><a href=#focusevent>FocusEvent</a></code>
   object, initialise it to have the given name <var>e</var>, to not bubble, to not be
   cancelable, and to have the <code id=processing-model-6:dom-focusevent-relatedtarget><a href=#dom-focusevent-relatedtarget>relatedTarget</a></code>
-  attribute initialised to <var>r</var>, the <code id=processing-model-6:dom-uievent-view><a href=#dom-uievent-view>view</a></code> attribute initialised to the <code id=processing-model-6:window-3><a href=#window>Window</a></code> object of the <code id=processing-model-6:document-11><a href=#document>Document</a></code> object of <var>t</var>, and the <code id=processing-model-6:dom-uievent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialised to 0, and must then <a href=#concept-event-dispatch id=processing-model-6:concept-event-dispatch>dispatch</a> the newly created <code id=processing-model-6:focusevent-2><a href=#focusevent>FocusEvent</a></code> object
+  attribute initialised to <var>r</var>, the <code id=processing-model-6:dom-uievent-view><a href=#dom-uievent-view>view</a></code> attribute initialised to the <code id=processing-model-6:window-3><a href=#window>Window</a></code> object of the <code id=processing-model-6:document-9><a href=#document>Document</a></code> object of <var>t</var>, and the <code id=processing-model-6:dom-uievent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialised to 0, and must then <a href=#concept-event-dispatch id=processing-model-6:concept-event-dispatch>dispatch</a> the newly created <code id=processing-model-6:focusevent-2><a href=#focusevent>FocusEvent</a></code> object
   at the specified target element <var>t</var>.</p>
 
   <hr>
@@ -54793,12 +54797,12 @@
    node</var> be <var>target area</var>'s <a href=#dom-anchor id=processing-model-6:dom-anchor-2>DOM anchor</a>. Otherwise, <var>target area</var> is a <code id=processing-model-6:the-dialog-element-16><a href=#the-dialog-element>dialog</a></code>; let <var>target node</var> be
    <var>target area</var>.<li>
 
-    <p>If <var>target node</var> is a <code id=processing-model-6:document-12><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-3>body element</a>, then let <var>target node</var> be <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-4>the body
-    element</a> of that <code id=processing-model-6:document-13><a href=#document>Document</a></code>.</p>
+    <p>If <var>target node</var> is a <code id=processing-model-6:document-10><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=processing-model-6:the-body-element-2>body element</a>, then let <var>target node</var> be <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-2>the body
+    element</a> of that <code id=processing-model-6:document-11><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>target node</var> is a <code id=processing-model-6:document-14><a href=#document>Document</a></code> that has a
+    <p>Otherwise, if <var>target node</var> is a <code id=processing-model-6:document-12><a href=#document>Document</a></code> that has a
     <a href=#root-element id=processing-model-6:root-element-2>root element</a>, then let <var>target node</var> be the <a href=#root-element id=processing-model-6:root-element-3>root
-    element</a> of that <code id=processing-model-6:document-15><a href=#document>Document</a></code>.</p>
+    element</a> of that <code id=processing-model-6:document-13><a href=#document>Document</a></code>.</p>
 
    <li>
 
@@ -54963,19 +54967,18 @@
 
     
 
-    <p>Moves the focus to the window's <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-2>browsing context container</a>, if any.</p>
+    <p>Moves the focus to the window's <a href=#browsing-context id=focus-management-apis:browsing-context>browsing context</a>, if any.</p>
 
    <dt><var>element</var> . <code id=focus-management-apis:dom-focus><a href=#dom-focus>focus</a></code>()<dd>
 
     <p>Moves the focus to the element.</p>
 
-    <p>If the element is <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2>the body element</a>, moves the focus to the viewport instead.</p>
+    <p>If the element is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-2>browsing context container</a>, moves the focus to the <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context>nested browsing context</a> instead.</p>
 
    <dt><var>element</var> . <code id=focus-management-apis:dom-blur><a href=#dom-blur>blur</a></code>()<dd>
 
     <p>Moves the focus to the viewport. Use of this method is discouraged; if you want to focus the
-    viewport, call the <code id=focus-management-apis:dom-focus-2><a href=#dom-focus>focus()</a></code> method on <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-2>the body
-    element</a>.</p>
+    viewport, call the <code id=focus-management-apis:dom-focus-2><a href=#dom-focus>focus()</a></code> method on the <code id=focus-management-apis:document><a href=#document>Document</a></code>'s root element.</p>
 
     <p>Do not use this method to hide the focus ring if you find the focus ring unsightly. Instead,
     use a CSS rule to override the 'outline' property, and provide a different way to show what
@@ -54999,9 +55002,9 @@
   
 
   <p>The <dfn id=dom-document-activeelement><code>activeElement</code></dfn> attribute on
-  <code id=focus-management-apis:document><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
+  <code id=focus-management-apis:document-2><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
 
-  <ol><li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-2><a href=#document>Document</a></code> on which the method was
+  <ol><li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-3><a href=#document>Document</a></code> on which the method was
    invoked.<li><p>If <var>candidate</var> has a <a href=#dialog-group id=focus-management-apis:dialog-group>dialog group</a> with a designated
    <a href=#focused-dialog-of-the-dialog-group id=focus-management-apis:focused-dialog-of-the-dialog-group>focused dialog of the dialog group</a>, then let <var>candidate</var> be the
    designated <a href=#focused-dialog-of-the-dialog-group id=focus-management-apis:focused-dialog-of-the-dialog-group-2>focused dialog of the dialog group</a>, and redo this step.<li><p>If <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group>control group</a>, let <var>candidate</var> be the designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group>focused area of the control
@@ -55009,22 +55012,22 @@
 
    <li><p>If <var>candidate</var> is a <a href=#focusable-area id=focus-management-apis:focusable-area>focusable area</a>, let <var>candidate</var> be <var>candidate</var>'s <a href=#dom-anchor id=focus-management-apis:dom-anchor>DOM anchor</a>.<li>
 
-    <p>If <var>candidate</var> is a <code id=focus-management-apis:document-3><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-3>body element</a>, then let <var>candidate</var> be <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-4>the body
-    element</a> of that <code id=focus-management-apis:document-4><a href=#document>Document</a></code>.</p>
+    <p>If <var>candidate</var> is a <code id=focus-management-apis:document-4><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2>body element</a>, then let <var>candidate</var> be <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-2>the body
+    element</a> of that <code id=focus-management-apis:document-5><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-5><a href=#document>Document</a></code> that has a <a href=#root-element id=focus-management-apis:root-element>root
+    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-6><a href=#document>Document</a></code> that has a <a href=#root-element id=focus-management-apis:root-element>root
     element</a>, then let <var>candidate</var> be the <a href=#root-element id=focus-management-apis:root-element-2>root element</a> of that
-    <code id=focus-management-apis:document-6><a href=#document>Document</a></code>.</p>
+    <code id=focus-management-apis:document-7><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-7><a href=#document>Document</a></code>, then let <var>candidate</var> be null.</p>
+    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-8><a href=#document>Document</a></code>, then let <var>candidate</var> be null.</p>
 
    <li><p>Return <var>candidate</var>.</ol>
 
   <p>The <dfn id=dom-document-hasfocus><code>hasFocus()</code></dfn> method on
-  <code id=focus-management-apis:document-8><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
+  <code id=focus-management-apis:document-9><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
 
-  <ol><li><p>Let <var>target</var> be the <code id=focus-management-apis:document-9><a href=#document>Document</a></code> on which the method was
-   invoked.<li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-10><a href=#document>Document</a></code> of the <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context>top-level
+  <ol><li><p>Let <var>target</var> be the <code id=focus-management-apis:document-10><a href=#document>Document</a></code> on which the method was
+   invoked.<li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-11><a href=#document>Document</a></code> of the <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context>top-level
    browsing context</a>.<li><p>If <var>candidate</var> is <var>target</var>, return true and abort
    these steps.<li>
 
@@ -55035,13 +55038,13 @@
     <p>Otherwise, if <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group-2>control group</a>, and the
     designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group-2>focused area of the control group</a> is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-3>browsing context
     container</a>, and the <a href=#active-document id=focus-management-apis:active-document>active document</a> of that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-4>browsing context
-    container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context>nested browsing context</a> is <var>target</var>, then
+    container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-2>nested browsing context</a> is <var>target</var>, then
     return true and abort these steps.</p>
 
     <p>Otherwise, if <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group-3>control group</a>, and the
     designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group-3>focused area of the control group</a> is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-5>browsing context
     container</a>, then let <var>candidate</var> be the <a href=#active-document id=focus-management-apis:active-document-2>active document</a> of
-    that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-6>browsing context container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-2>nested browsing context</a>, and redo
+    that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-6>browsing context container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-3>nested browsing context</a>, and redo
     this step.</p>
 
     <p>Otherwise, return false and abort these steps.</p>
@@ -55050,13 +55053,13 @@
 
   <p>The <dfn id=dom-window-focus><code>focus()</code></dfn> method on the <code id=focus-management-apis:window><a href=#window>Window</a></code>
   object, when invoked, must run the <a href=#focusing-steps id=focus-management-apis:focusing-steps>focusing steps</a> with the <code id=focus-management-apis:window-2><a href=#window>Window</a></code>
-  object's <a href=#browsing-context id=focus-management-apis:browsing-context>browsing context</a>. Additionally, if this <a href=#browsing-context id=focus-management-apis:browsing-context-2>browsing context</a> is a
+  object's <a href=#browsing-context id=focus-management-apis:browsing-context-2>browsing context</a>. Additionally, if this <a href=#browsing-context id=focus-management-apis:browsing-context-3>browsing context</a> is a
   <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context-2>top-level browsing context</a>, user agents are encouraged to trigger some sort of
   notification to indicate to the user that the page is attempting to gain focus.</p>
 
   <p>The <dfn id=dom-window-blur><code>blur()</code></dfn> method on the <code id=focus-management-apis:window-3><a href=#window>Window</a></code>
   object, when invoked, provides a hint to the user agent that the script believes the user probably
-  is not currently interested in the contents of the <a href=#browsing-context id=focus-management-apis:browsing-context-3>browsing context</a> of the
+  is not currently interested in the contents of the <a href=#browsing-context id=focus-management-apis:browsing-context-4>browsing context</a> of the
   <code id=focus-management-apis:window-4><a href=#window>Window</a></code> object on which the method was invoked, but that the contents might become
   interesting again in the future.</p>
 
@@ -55064,7 +55067,7 @@
   method entirely.</p>
 
   <p class=note>Historically, the <code id=focus-management-apis:dom-window-blur-2><a href=#dom-window-blur>focus()</a></code> and <code id=focus-management-apis:dom-window-blur-3><a href=#dom-window-blur>blur()</a></code> methods actually affected the system-level focus of the
-  system widget (e.g. tab or window) that contained the <a href=#browsing-context id=focus-management-apis:browsing-context-4>browsing context</a>, but hostile
+  system widget (e.g. tab or window) that contained the <a href=#browsing-context id=focus-management-apis:browsing-context-5>browsing context</a>, but hostile
   sites widely abuse this behavior to the user's detriment.</p>
 
   <p>The <dfn id=dom-focus><code>focus()</code></dfn> method on elements, when invoked, must
@@ -84667,6 +84670,7 @@
   Axel Dahmen,
   Ben Boyle,
   Ben Godfrey,
+  Ben Kelly,
   Ben Lerner,
   Ben Leslie,
   Ben Meadowcroft,

Modified: index
===================================================================
--- index	2014-09-24 17:45:41 UTC (rev 8809)
+++ index	2014-09-24 18:54:51 UTC (rev 8810)
@@ -54542,17 +54542,21 @@
       <p>Let <var>new focus target</var> be the element's first scrollable region,
       according to a pre-order, depth-first traversal of the box tree. <a href=#refsCSS>[CSS]</a></p>
 
-     <dt>If <var>new focus target</var> is <a href=#the-body-element-2 id=processing-model-6:the-body-element-2>the body element</a> of its
-     <code id=processing-model-6:document><a href=#document>Document</a></code><dt>If <var>new focus target</var> is the <a href=#root-element id=processing-model-6:root-element>root element</a> of its
-     <code id=processing-model-6:document-2><a href=#document>Document</a></code> and that <code id=processing-model-6:document-3><a href=#document>Document</a></code> has no <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-2>body element</a><dd>
+     <dt>If <var>new focus target</var> is the <a href=#root-element id=processing-model-6:root-element>root element</a> of its
+     <code id=processing-model-6:document><a href=#document>Document</a></code><dd>
 
-      <p>Let <var>new focus target</var> be the <code id=processing-model-6:document-4><a href=#document>Document</a></code>'s viewport.</p>
+      <p>Let <var>new focus target</var> be the <code id=processing-model-6:document-2><a href=#document>Document</a></code>'s viewport.</p>
 
      <dt>If <var>new focus target</var> is a <a href=#browsing-context id=processing-model-6:browsing-context-2>browsing context</a><dd>
 
       <p>Let <var>new focus target</var> be the <a href=#browsing-context id=processing-model-6:browsing-context-3>browsing context</a>'s
       <a href=#active-document id=processing-model-6:active-document>active document</a>.</p>
 
+     <dt>If <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container>browsing context container</a><dd>
+
+      <p>Let <var>new focus target</var> be the <a href=#browsing-context-container id=processing-model-6:browsing-context-container-2>browsing context container</a>'s <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context>nested browsing context</a>'s
+      <a href=#active-document id=processing-model-6:active-document-2>active document</a>.</p>
+
      <dt>Otherwise<dd>
 
       <p>Abort the <a href=#focusing-steps id=processing-model-6:focusing-steps>focusing steps</a>.</p>
@@ -54573,9 +54577,9 @@
     group</a>, and redo this step.</p>
 
     
-    <p>Otherwise, if <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container>browsing context
-    container</a>, then let <var>new focus target</var> be the <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context>nested browsing
-    context</a>'s <a href=#active-document id=processing-model-6:active-document-2>active document</a>, and redo this step.</p>
+    <p>Otherwise, if <var>new focus target</var> is a <a href=#browsing-context-container id=processing-model-6:browsing-context-container-3>browsing context
+    container</a>, then let <var>new focus target</var> be the <a href=#nested-browsing-context id=processing-model-6:nested-browsing-context-2>nested browsing
+    context</a>'s <a href=#active-document id=processing-model-6:active-document-3>active document</a>, and redo this step.</p>
 
     <p class=note>A <code id=processing-model-6:the-dialog-element-2><a href=#the-dialog-element>dialog</a></code> element can be both a <a href=#control-group-owner-object id=processing-model-6:control-group-owner-object-4>control group owner
     object</a> and a <a href=#focusable-area id=processing-model-6:focusable-area-8>focusable area</a>, if it has both an <code id=processing-model-6:attr-dialog-open-2><a href=#attr-dialog-open>open</a></code> attribute specified and a <code id=processing-model-6:attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute specified and is <a href=#being-rendered id=processing-model-6:being-rendered-2>being
@@ -54615,7 +54619,7 @@
 
     <p>Otherwise, if <var>old focus target</var> is a <a href=#focusable-area id=processing-model-6:focusable-area-13>focusable area</a>, then let <var>new
     focus target</var> be the first <a href=#focusable-area id=processing-model-6:focusable-area-14>focusable area</a> of its <a href=#control-group id=processing-model-6:control-group-3>control group</a>
-    (if the <a href=#control-group-owner id=processing-model-6:control-group-owner>control group owner</a> is a <code id=processing-model-6:document-5><a href=#document>Document</a></code>, this will always be a
+    (if the <a href=#control-group-owner id=processing-model-6:control-group-owner>control group owner</a> is a <code id=processing-model-6:document-3><a href=#document>Document</a></code>, this will always be a
     viewport).</p>
 
     <p>Otherwise, let <var>new focus target</var> be null.</p>
@@ -54656,7 +54660,7 @@
   group</a>.</p>
 
   <p class=example>For example, this might happen because an element is removed from its
-  <code id=processing-model-6:document-6><a href=#document>Document</a></code>, or has a <code id=processing-model-6:the-hidden-attribute><a href=#the-hidden-attribute>hidden</a></code> attribute added. It might
+  <code id=processing-model-6:document-4><a href=#document>Document</a></code>, or has a <code id=processing-model-6:the-hidden-attribute><a href=#the-hidden-attribute>hidden</a></code> attribute added. It might
   also happen to an <code id=processing-model-6:the-input-element><a href=#the-input-element>input</a></code> element when the element gets <a href=#concept-fe-disabled id=processing-model-6:concept-fe-disabled>disabled</a>.</p>
 
   <p><dfn id=focus-fixup-rule-two>Focus fixup rule two</dfn>: When a <a href=#dialog-group id=processing-model-6:dialog-group-7>dialog group</a> has no designed <a href=#focused-dialog-of-the-dialog-group id=processing-model-6:focused-dialog-of-the-dialog-group-4>focused
@@ -54711,8 +54715,8 @@
       <p>If <var>entry</var> is an element, let <var>blur event target</var> be
       <var>entry</var>.</p>
 
-      <p>If <var>entry</var> is a <code id=processing-model-6:document-7><a href=#document>Document</a></code> object, let <var>blur
-      event target</var> be that <code id=processing-model-6:document-8><a href=#document>Document</a></code> object's <code id=processing-model-6:window><a href=#window>Window</a></code> object.</p>
+      <p>If <var>entry</var> is a <code id=processing-model-6:document-5><a href=#document>Document</a></code> object, let <var>blur
+      event target</var> be that <code id=processing-model-6:document-6><a href=#document>Document</a></code> object's <code id=processing-model-6:window><a href=#window>Window</a></code> object.</p>
 
       <p>Otherwise, let <var>blur event target</var> be null.</p>
 
@@ -54753,8 +54757,8 @@
       <p>If <var>entry</var> is an element, let <var>focus event target</var> be
       <var>entry</var>.</p>
 
-      <p>If <var>entry</var> is a <code id=processing-model-6:document-9><a href=#document>Document</a></code> object, let <var>focus
-      event target</var> be that <code id=processing-model-6:document-10><a href=#document>Document</a></code> object's <code id=processing-model-6:window-2><a href=#window>Window</a></code> object.</p>
+      <p>If <var>entry</var> is a <code id=processing-model-6:document-7><a href=#document>Document</a></code> object, let <var>focus
+      event target</var> be that <code id=processing-model-6:document-8><a href=#document>Document</a></code> object's <code id=processing-model-6:window-2><a href=#window>Window</a></code> object.</p>
 
       <p>Otherwise, let <var>focus event target</var> be null.</p>
 
@@ -54780,7 +54784,7 @@
   agent must create a <a href=#concept-events-trusted id=processing-model-6:concept-events-trusted>trusted</a> <code id=processing-model-6:focusevent><a href=#focusevent>FocusEvent</a></code>
   object, initialise it to have the given name <var>e</var>, to not bubble, to not be
   cancelable, and to have the <code id=processing-model-6:dom-focusevent-relatedtarget><a href=#dom-focusevent-relatedtarget>relatedTarget</a></code>
-  attribute initialised to <var>r</var>, the <code id=processing-model-6:dom-uievent-view><a href=#dom-uievent-view>view</a></code> attribute initialised to the <code id=processing-model-6:window-3><a href=#window>Window</a></code> object of the <code id=processing-model-6:document-11><a href=#document>Document</a></code> object of <var>t</var>, and the <code id=processing-model-6:dom-uievent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialised to 0, and must then <a href=#concept-event-dispatch id=processing-model-6:concept-event-dispatch>dispatch</a> the newly created <code id=processing-model-6:focusevent-2><a href=#focusevent>FocusEvent</a></code> object
+  attribute initialised to <var>r</var>, the <code id=processing-model-6:dom-uievent-view><a href=#dom-uievent-view>view</a></code> attribute initialised to the <code id=processing-model-6:window-3><a href=#window>Window</a></code> object of the <code id=processing-model-6:document-9><a href=#document>Document</a></code> object of <var>t</var>, and the <code id=processing-model-6:dom-uievent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialised to 0, and must then <a href=#concept-event-dispatch id=processing-model-6:concept-event-dispatch>dispatch</a> the newly created <code id=processing-model-6:focusevent-2><a href=#focusevent>FocusEvent</a></code> object
   at the specified target element <var>t</var>.</p>
 
   <hr>
@@ -54793,12 +54797,12 @@
    node</var> be <var>target area</var>'s <a href=#dom-anchor id=processing-model-6:dom-anchor-2>DOM anchor</a>. Otherwise, <var>target area</var> is a <code id=processing-model-6:the-dialog-element-16><a href=#the-dialog-element>dialog</a></code>; let <var>target node</var> be
    <var>target area</var>.<li>
 
-    <p>If <var>target node</var> is a <code id=processing-model-6:document-12><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-3>body element</a>, then let <var>target node</var> be <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-4>the body
-    element</a> of that <code id=processing-model-6:document-13><a href=#document>Document</a></code>.</p>
+    <p>If <var>target node</var> is a <code id=processing-model-6:document-10><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=processing-model-6:the-body-element-2>body element</a>, then let <var>target node</var> be <a href=#the-body-element-2 id=processing-model-6:the-body-element-2-2>the body
+    element</a> of that <code id=processing-model-6:document-11><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>target node</var> is a <code id=processing-model-6:document-14><a href=#document>Document</a></code> that has a
+    <p>Otherwise, if <var>target node</var> is a <code id=processing-model-6:document-12><a href=#document>Document</a></code> that has a
     <a href=#root-element id=processing-model-6:root-element-2>root element</a>, then let <var>target node</var> be the <a href=#root-element id=processing-model-6:root-element-3>root
-    element</a> of that <code id=processing-model-6:document-15><a href=#document>Document</a></code>.</p>
+    element</a> of that <code id=processing-model-6:document-13><a href=#document>Document</a></code>.</p>
 
    <li>
 
@@ -54963,19 +54967,18 @@
 
     
 
-    <p>Moves the focus to the window's <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-2>browsing context container</a>, if any.</p>
+    <p>Moves the focus to the window's <a href=#browsing-context id=focus-management-apis:browsing-context>browsing context</a>, if any.</p>
 
    <dt><var>element</var> . <code id=focus-management-apis:dom-focus><a href=#dom-focus>focus</a></code>()<dd>
 
     <p>Moves the focus to the element.</p>
 
-    <p>If the element is <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2>the body element</a>, moves the focus to the viewport instead.</p>
+    <p>If the element is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-2>browsing context container</a>, moves the focus to the <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context>nested browsing context</a> instead.</p>
 
    <dt><var>element</var> . <code id=focus-management-apis:dom-blur><a href=#dom-blur>blur</a></code>()<dd>
 
     <p>Moves the focus to the viewport. Use of this method is discouraged; if you want to focus the
-    viewport, call the <code id=focus-management-apis:dom-focus-2><a href=#dom-focus>focus()</a></code> method on <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-2>the body
-    element</a>.</p>
+    viewport, call the <code id=focus-management-apis:dom-focus-2><a href=#dom-focus>focus()</a></code> method on the <code id=focus-management-apis:document><a href=#document>Document</a></code>'s root element.</p>
 
     <p>Do not use this method to hide the focus ring if you find the focus ring unsightly. Instead,
     use a CSS rule to override the 'outline' property, and provide a different way to show what
@@ -54999,9 +55002,9 @@
   
 
   <p>The <dfn id=dom-document-activeelement><code>activeElement</code></dfn> attribute on
-  <code id=focus-management-apis:document><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
+  <code id=focus-management-apis:document-2><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
 
-  <ol><li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-2><a href=#document>Document</a></code> on which the method was
+  <ol><li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-3><a href=#document>Document</a></code> on which the method was
    invoked.<li><p>If <var>candidate</var> has a <a href=#dialog-group id=focus-management-apis:dialog-group>dialog group</a> with a designated
    <a href=#focused-dialog-of-the-dialog-group id=focus-management-apis:focused-dialog-of-the-dialog-group>focused dialog of the dialog group</a>, then let <var>candidate</var> be the
    designated <a href=#focused-dialog-of-the-dialog-group id=focus-management-apis:focused-dialog-of-the-dialog-group-2>focused dialog of the dialog group</a>, and redo this step.<li><p>If <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group>control group</a>, let <var>candidate</var> be the designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group>focused area of the control
@@ -55009,22 +55012,22 @@
 
    <li><p>If <var>candidate</var> is a <a href=#focusable-area id=focus-management-apis:focusable-area>focusable area</a>, let <var>candidate</var> be <var>candidate</var>'s <a href=#dom-anchor id=focus-management-apis:dom-anchor>DOM anchor</a>.<li>
 
-    <p>If <var>candidate</var> is a <code id=focus-management-apis:document-3><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-3>body element</a>, then let <var>candidate</var> be <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-4>the body
-    element</a> of that <code id=focus-management-apis:document-4><a href=#document>Document</a></code>.</p>
+    <p>If <var>candidate</var> is a <code id=focus-management-apis:document-4><a href=#document>Document</a></code> that has a <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2>body element</a>, then let <var>candidate</var> be <a href=#the-body-element-2 id=focus-management-apis:the-body-element-2-2>the body
+    element</a> of that <code id=focus-management-apis:document-5><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-5><a href=#document>Document</a></code> that has a <a href=#root-element id=focus-management-apis:root-element>root
+    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-6><a href=#document>Document</a></code> that has a <a href=#root-element id=focus-management-apis:root-element>root
     element</a>, then let <var>candidate</var> be the <a href=#root-element id=focus-management-apis:root-element-2>root element</a> of that
-    <code id=focus-management-apis:document-6><a href=#document>Document</a></code>.</p>
+    <code id=focus-management-apis:document-7><a href=#document>Document</a></code>.</p>
 
-    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-7><a href=#document>Document</a></code>, then let <var>candidate</var> be null.</p>
+    <p>Otherwise, if <var>candidate</var> is a <code id=focus-management-apis:document-8><a href=#document>Document</a></code>, then let <var>candidate</var> be null.</p>
 
    <li><p>Return <var>candidate</var>.</ol>
 
   <p>The <dfn id=dom-document-hasfocus><code>hasFocus()</code></dfn> method on
-  <code id=focus-management-apis:document-8><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
+  <code id=focus-management-apis:document-9><a href=#document>Document</a></code> objects must return the value returned by the following steps:</p>
 
-  <ol><li><p>Let <var>target</var> be the <code id=focus-management-apis:document-9><a href=#document>Document</a></code> on which the method was
-   invoked.<li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-10><a href=#document>Document</a></code> of the <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context>top-level
+  <ol><li><p>Let <var>target</var> be the <code id=focus-management-apis:document-10><a href=#document>Document</a></code> on which the method was
+   invoked.<li><p>Let <var>candidate</var> be the <code id=focus-management-apis:document-11><a href=#document>Document</a></code> of the <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context>top-level
    browsing context</a>.<li><p>If <var>candidate</var> is <var>target</var>, return true and abort
    these steps.<li>
 
@@ -55035,13 +55038,13 @@
     <p>Otherwise, if <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group-2>control group</a>, and the
     designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group-2>focused area of the control group</a> is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-3>browsing context
     container</a>, and the <a href=#active-document id=focus-management-apis:active-document>active document</a> of that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-4>browsing context
-    container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context>nested browsing context</a> is <var>target</var>, then
+    container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-2>nested browsing context</a> is <var>target</var>, then
     return true and abort these steps.</p>
 
     <p>Otherwise, if <var>candidate</var> has a non-empty <a href=#control-group id=focus-management-apis:control-group-3>control group</a>, and the
     designated <a href=#focused-area-of-the-control-group id=focus-management-apis:focused-area-of-the-control-group-3>focused area of the control group</a> is a <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-5>browsing context
     container</a>, then let <var>candidate</var> be the <a href=#active-document id=focus-management-apis:active-document-2>active document</a> of
-    that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-6>browsing context container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-2>nested browsing context</a>, and redo
+    that <a href=#browsing-context-container id=focus-management-apis:browsing-context-container-6>browsing context container</a>'s <a href=#nested-browsing-context id=focus-management-apis:nested-browsing-context-3>nested browsing context</a>, and redo
     this step.</p>
 
     <p>Otherwise, return false and abort these steps.</p>
@@ -55050,13 +55053,13 @@
 
   <p>The <dfn id=dom-window-focus><code>focus()</code></dfn> method on the <code id=focus-management-apis:window><a href=#window>Window</a></code>
   object, when invoked, must run the <a href=#focusing-steps id=focus-management-apis:focusing-steps>focusing steps</a> with the <code id=focus-management-apis:window-2><a href=#window>Window</a></code>
-  object's <a href=#browsing-context id=focus-management-apis:browsing-context>browsing context</a>. Additionally, if this <a href=#browsing-context id=focus-management-apis:browsing-context-2>browsing context</a> is a
+  object's <a href=#browsing-context id=focus-management-apis:browsing-context-2>browsing context</a>. Additionally, if this <a href=#browsing-context id=focus-management-apis:browsing-context-3>browsing context</a> is a
   <a href=#top-level-browsing-context id=focus-management-apis:top-level-browsing-context-2>top-level browsing context</a>, user agents are encouraged to trigger some sort of
   notification to indicate to the user that the page is attempting to gain focus.</p>
 
   <p>The <dfn id=dom-window-blur><code>blur()</code></dfn> method on the <code id=focus-management-apis:window-3><a href=#window>Window</a></code>
   object, when invoked, provides a hint to the user agent that the script believes the user probably
-  is not currently interested in the contents of the <a href=#browsing-context id=focus-management-apis:browsing-context-3>browsing context</a> of the
+  is not currently interested in the contents of the <a href=#browsing-context id=focus-management-apis:browsing-context-4>browsing context</a> of the
   <code id=focus-management-apis:window-4><a href=#window>Window</a></code> object on which the method was invoked, but that the contents might become
   interesting again in the future.</p>
 
@@ -55064,7 +55067,7 @@
   method entirely.</p>
 
   <p class=note>Historically, the <code id=focus-management-apis:dom-window-blur-2><a href=#dom-window-blur>focus()</a></code> and <code id=focus-management-apis:dom-window-blur-3><a href=#dom-window-blur>blur()</a></code> methods actually affected the system-level focus of the
-  system widget (e.g. tab or window) that contained the <a href=#browsing-context id=focus-management-apis:browsing-context-4>browsing context</a>, but hostile
+  system widget (e.g. tab or window) that contained the <a href=#browsing-context id=focus-management-apis:browsing-context-5>browsing context</a>, but hostile
   sites widely abuse this behavior to the user's detriment.</p>
 
   <p>The <dfn id=dom-focus><code>focus()</code></dfn> method on elements, when invoked, must
@@ -84667,6 +84670,7 @@
   Axel Dahmen,
   Ben Boyle,
   Ben Godfrey,
+  Ben Kelly,
   Ben Lerner,
   Ben Leslie,
   Ben Meadowcroft,

Modified: source
===================================================================
--- source	2014-09-24 17:45:41 UTC (rev 8809)
+++ source	2014-09-24 18:54:51 UTC (rev 8810)
@@ -72709,11 +72709,8 @@
      </dd>
 
 
-     <dt>If <var>new focus target</var> is <span>the body element</span> of its
+     <dt>If <var>new focus target</var> is the <span>root element</span> of its
      <code>Document</code></dt>
-     <dt>If <var>new focus target</var> is the <span>root element</span> of its
-     <code>Document</code> and that <code>Document</code> has no <span data-x="the body
-     element">body element</span></dt>
 
      <dd>
 
@@ -72731,6 +72728,17 @@
 
      </dd>
 
+
+     <dt>If <var>new focus target</var> is a <span>browsing context container</span></dt>
+
+     <dd>
+
+      <p>Let <var>new focus target</var> be the <span>browsing context container</span>'s <span>nested browsing context</span>'s
+      <span>active document</span>.</p>
+
+     </dd>
+
+
      <dt>Otherwise</dt>
 
      <dd>
@@ -73314,7 +73322,7 @@
 
     <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2823 -->
 
-    <p>Moves the focus to the window's <span>browsing context container</span>, if any.</p>
+    <p>Moves the focus to the window's <span>browsing context</span>, if any.</p>
 
    </dd>
 
@@ -73334,7 +73342,7 @@
 
     <p>Moves the focus to the element.</p>
 
-    <p>If the element is <span>the body element</span>, moves the focus to the viewport instead.</p>
+    <p>If the element is a <span>browsing context container</span>, moves the focus to the <span>nested browsing context</span> instead.</p>
 
    </dd>
 
@@ -73343,8 +73351,7 @@
    <dd>
 
     <p>Moves the focus to the viewport. Use of this method is discouraged; if you want to focus the
-    viewport, call the <code data-x="dom-focus">focus()</code> method on <span>the body
-    element</span>.</p>
+    viewport, call the <code data-x="dom-focus">focus()</code> method on the <code>Document</code>'s root element.</p>
 
     <p>Do not use this method to hide the focus ring if you find the focus ring unsightly. Instead,
     use a CSS rule to override the 'outline' property, and provide a different way to show what
@@ -116221,6 +116228,7 @@
   Axel Dahmen,
   Ben Boyle,
   Ben Godfrey,
+  Ben Kelly,
   Ben Lerner,
   Ben Leslie,
   Ben Meadowcroft,



More information about the Commit-Watchers mailing list