hixie: Fix the focusing-related parts of the spec to handle orphaned nested browsing contexts (whatwg r5702)

hixie: Fix the focusing-related parts of the spec to handle orphaned
nested browsing contexts (whatwg r5702)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4567&r2=1.4568&f=h
http://html5.org/tools/web-apps-tracker?from=5701&to=5702

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4567
retrieving revision 1.4568
diff -u -d -r1.4567 -r1.4568
--- Overview.html 6 Dec 2010 22:18:24 -0000 1.4567
+++ Overview.html 7 Dec 2010 00:18:17 -0000 1.4568
@@ -36853,6 +36853,14 @@
   <ol><li><p>Let <var title="">target</var> be the element's
    <code><a href="#document">Document</a></code>.</li>
 
+   <li><p>Let <var title="">target</var> has no <a href="#browsing-context">browsing
+   context</a>, abort these steps.</li>
+
+   <li><p>Let <var title="">target</var>'s <a href="#browsing-context">browsing
+   context</a> has no <a href="#top-level-browsing-context">top-level browsing context</a> (e.g.
+   it is a <a href="#nested-browsing-context">nested browsing context</a> with no <a href="#parent-browsing-context">parent
+   browsing context</a>), abort these steps.</li>
+
    <li><p>If <var title="">target</var>'s <a href="#browsing-context">browsing
    context</a> had the <a href="#sandboxed-automatic-features-browsing-context-flag">sandboxed automatic features browsing
    context flag</a> set when <var title="">target</var> was
@@ -49380,7 +49388,14 @@
 
   <hr><p>The <dfn id="focusing-steps">focusing steps</dfn> are as follows:</p>
 
-  <ol><li><p>If focusing the element will remove the focus from another
+  <ol><li><p>If the element is not <a href="#in-a-document" title="in a Document">in a
+   <code>Document</code></a>, or if the element's
+   <code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing context</a>, or if
+   the element's <code><a href="#document">Document</a></code>' <a href="#browsing-context">browsing context</a>
+   has no <a href="#top-level-browsing-context">top-level browsing context</a>, then abort these
+   steps.</p>
+
+   <li><p>If focusing the element will remove the focus from another
    element, then run the <a href="#unfocusing-steps">unfocusing steps</a> for that
    element.</li>
 
@@ -49474,10 +49489,13 @@
 
   <p>The <dfn id="dom-document-hasfocus" title="dom-document-hasFocus"><code>hasFocus()</code></dfn> method
   on <code><a href="#htmldocument">HTMLDocument</a></code> objects must return true if the
-  document's <a href="#browsing-context">browsing context</a> is focused, and all its
-  <a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor browsing
-  contexts</a> are also focused, and the <a href="#top-level-browsing-context">top-level browsing
-  context</a> has the <i>system focus</i>.</p>
+  <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> is focused,
+  and all its <a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor
+  browsing contexts</a> are also focused, and the <a href="#top-level-browsing-context">top-level
+  browsing context</a> has the <i>system focus</i>. If the
+  <code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing context</a> or if its
+  <a href="#browsing-context">browsing context</a> has no <a href="#top-level-browsing-context">top-level browsing
+  context</a>, then the method will always return false.</p>
 
   <p>The <dfn id="dom-window-focus" title="dom-window-focus"><code>focus()</code></dfn>
   method on the <code><a href="#window">Window</a></code> object, when invoked, provides a

Received on Tuesday, 7 December 2010 00:20:54 UTC