HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2596

File a bug

SVNBugCommentTime (UTC)
2596window.close(), window.focus(), window.blur().2008-12-28 06:16
Index: source
===================================================================
--- source	(revision 2595)
+++ source	(revision 2596)
@@ -37719,6 +37719,9 @@
   readonly attribute <span>History</span> <span title="dom-history">history</span>;
   readonly attribute <span>UndoManager</span> <span title="dom-undoManager">undoManager</span>;
   <span>Selection</span> <span title="dom-getSelection">getSelection</span>();
+  void <span title="dom-window-close">close</span>();
+  void <span title="dom-window-focus">focus</span>();
+  void <span title="dom-window-blur">blur</span>();
 
   // other browsing contexts
   readonly attribute <span>Window</span> <span title="dom-frames">frames</span>;
@@ -37799,7 +37802,6 @@
           http://www.mozilla.org/docs/dom/domref/dom_window_ref.html
           http://lxr.mozilla.org/mozilla/source/dom/public/idl/base/nsIDOMWindow.idl - scrollBy, etc
           http://lxr.mozilla.org/mozilla/source/dom/public/idl/base/nsIDOMWindowInternal.idl - DOM level 0
-      close() focus() blur() - when defining close(), mention it in showModalDialog() as a way to close the window
    -->
 
   <p>The <dfn title="dom-window"><code>window</code></dfn>, <dfn
@@ -37931,8 +37933,20 @@
   <p class="note">The name <a href="#resetBCName">gets reset</a> when
   the browsing context is navigated to another domain.</p>
 
+  <p>The <dfn title="dom-window-close"><code>close()</code></dfn>
+  method on <code>Window</code> objects should, if the corresponding
+  <span>browsing context</span> <var title="">A</var> is an
+  <span>auxiliary browsing context</span> that was created by a script
+  (as opposed to by an action of the user), and if the <span
+  title="script's browsing context">browsing context</span> of the
+  <span title="concept-script">script</span> that invokes the method
+  is <span>allowed to navigate</span> the <span>browsing
+  context</span> <var title="">A</var>, close the <span>browsing
+  context</span> <var title="">A</var> (and may <span title="a
+  browsing context is discarded">discard</span> it too).</p>
 
 
+
   <h4>Accessing other browsing contexts</h4>
 
   <p>The <dfn title="dom-length"><code>length</code></dfn> DOM
@@ -40013,7 +40027,11 @@
   of its browsing context, and on setting, must set the <span>return
   value</span> to the given new value.</p>
 
+  <p class="note">The <code
+  title="dom-window-close">window.close()</code> method can be used to
+  close the browsing context.</p>
 
+
   <h4>Notifications</h4>
 
 <!-- v2 feature requests:
@@ -46686,15 +46704,12 @@
 
   <!-- XXX
    - define onfocus/onblur behaviour for Window
-   - Other things to look at are IE's focus APIs (document.activeElement,
-     document.hasFocus, HTMLElement.setActive(), onBeforeActivate,
-     onActivate, onBeforeDeactivate, onDeactivate, document.hasFocus):
+   - Other things to look at are IE's focus APIs (HTMLElement.setActive(),
+     onBeforeActivate, onActivate, onBeforeDeactivate, onDeactivate):
        https://bugzilla.mozilla.org/show_bug.cgi?id=296471
        https://bugzilla.mozilla.org/show_bug.cgi?id=296469
-       http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/activeelement.asp
        http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setactive.asp
        http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeactivate.asp
-       http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/focus.asp
   -->
 
   <p>When an element is <i>focused</i>, key events received by the
@@ -46910,19 +46925,47 @@
 
   <p>The <dfn
   title="dom-document-activeElement"><code>activeElement</code></dfn>
-  attribute must return the element in the document that is
-  focused. If no element in the <code>Document</code> is focused, this
-  must return <span>the <code>body</code> element</span>.</p>
+  attribute on <code>DocumentHTML</code> objects must return the
+  element in the document that is focused. If no element in the
+  <code>Document</code> is focused, this must return <span>the
+  <code>body</code> element</span>.</p>
 
   <p>The <dfn
   title="dom-document-hasFocus"><code>hasFocus()</code></dfn> method
-  must return true if the document's <span>browsing context</span> is
-  focused, and all its <span title="ancestor browsing
-  context">ancestor browsing contexts</span> are also focused, and the
-  <span>top-level browsing context</span> has the <i>system
-  focus</i>.</p>
+  on <code>DocumentHTML</code> objects must return true if the
+  document's <span>browsing context</span> is focused, and all its
+  <span title="ancestor browsing context">ancestor browsing
+  contexts</span> are also focused, and the <span>top-level browsing
+  context</span> has the <i>system focus</i>.</p>
 
+  <p>The <dfn title="dom-window-focus"><code>focus()</code></dfn>
+  method on the <code>Window</code> object, when invoked, provides a
+  hint to the user agent that the script believes the user might be
+  interested in the contents of the <span>browsing context</span> of
+  the <code>Window</code> object on which the method was invoked.</p>
 
+  <p>User agents are encouraged to have this <code
+  title="dom-window-blur">focus()</code> method trigger some kind of
+  notification.</p>
+
+  <p>The <dfn title="dom-window-blur"><code>blur()</code></dfn> method
+  on the <code>Window</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 <span>browsing
+  context</span> of the <code>Window</code> object on which the method
+  was invoked, but that the contents might become interesting again in
+  the future.</p>
+
+  <p>User agents are encouraged to ignore calls to this <code
+  title="dom-window-blur">blur()</code> method entirely.</p>
+
+  <p class="note">Historically the <code
+  title="dom-window-blur">focus()</code> and <code
+  title="dom-window-blur">blur()</code> methods actually affected the
+  system focus, but hostile sites widely abuse this behavior to the
+  user's detriment.</p>
+
+
   <h4>Element-level focus APIs</h4>
 
   <p>The <dfn title="dom-focus"><code>focus()</code></dfn> method,

|