[html5] r2596 - [] (0) window.close(), window.focus(), window.blur().

whatwg at whatwg.org whatwg at whatwg.org
Sat Dec 27 22:16:23 PST 2008


Author: ianh
Date: 2008-12-27 22:16:21 -0800 (Sat, 27 Dec 2008)
New Revision: 2596

Modified:
   index
   source
Log:
[] (0) window.close(), window.focus(), window.blur().

Modified: index
===================================================================
--- index	2008-12-27 12:07:06 UTC (rev 2595)
+++ index	2008-12-28 06:16:21 UTC (rev 2596)
@@ -21,7 +21,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 27 December 2008</h2>
+   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 28 December 2008</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <dl><dt>Multiple-page version:</dt>
@@ -33212,6 +33212,9 @@
   readonly attribute <a href=#history-1>History</a> <a href=#dom-history title=dom-history>history</a>;
   readonly attribute <a href=#undomanager>UndoManager</a> <a href=#dom-undomanager title=dom-undoManager>undoManager</a>;
   <a href=#selection-0>Selection</a> <a href=#dom-getselection title=dom-getSelection>getSelection</a>();
+  void <a href=#dom-window-close title=dom-window-close>close</a>();
+  void <a href=#dom-window-focus title=dom-window-focus>focus</a>();
+  void <a href=#dom-window-blur title=dom-window-blur>blur</a>();
 
   // other browsing contexts
   readonly attribute <a href=#window>Window</a> <a href=#dom-frames title=dom-frames>frames</a>;
@@ -33292,7 +33295,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 id=dom-window title=dom-window><code>window</code></dfn>, <dfn id=dom-frames title=dom-frames><code>frames</code></dfn>, and <dfn id=dom-self title=dom-self><code>self</code></dfn> DOM attributes must all
@@ -33412,8 +33414,19 @@
   <p class=note>The name <a href=#resetBCName>gets reset</a> when
   the browsing context is navigated to another domain.</p>
 
+  <p>The <dfn id=dom-window-close title=dom-window-close><code>close()</code></dfn>
+  method on <code><a href=#window>Window</a></code> objects should, if the corresponding
+  <a href=#browsing-context>browsing context</a> <var title="">A</var> is an
+  <a href=#auxiliary-browsing-context>auxiliary browsing context</a> that was created by a script
+  (as opposed to by an action of the user), and if the <a href="#script's-browsing-context" title="script's browsing context">browsing context</a> of the
+  <a href=#concept-script title=concept-script>script</a> that invokes the method
+  is <a href=#allowed-to-navigate>allowed to navigate</a> the <a href=#browsing-context>browsing
+  context</a> <var title="">A</var>, close the <a href=#browsing-context>browsing
+  context</a> <var title="">A</var> (and may <a href=#a-browsing-context-is-discarded title="a
+  browsing context is discarded">discard</a> it too).</p>
 
 
+
   <h4 id=accessing-other-browsing-contexts><span class=secno>5.2.3 </span>Accessing other browsing contexts</h4>
 
   <p>The <dfn id=dom-length title=dom-length><code>length</code></dfn> DOM
@@ -35184,7 +35197,10 @@
   of its browsing context, and on setting, must set the <a href=#return-value>return
   value</a> to the given new value.</p>
 
+  <p class=note>The <code title=dom-window-close><a href=#dom-window-close>window.close()</a></code> method can be used to
+  close the browsing context.</p>
 
+
   <h4 id=notifications><span class=secno>5.5.4 </span>Notifications</h4>
 
 <!-- v2 feature requests:
@@ -40993,15 +41009,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
@@ -41186,18 +41199,42 @@
   <h4 id=document-level-focus-apis><span class=secno>6.5.3 </span>Document-level focus APIs</h4>
 
   <p>The <dfn id=dom-document-activeelement 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 <a href=#the-body-element-1>the <code>body</code> element</a>.</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 <a href=#the-body-element-1>the
+  <code>body</code> element</a>.</p>
 
   <p>The <dfn id=dom-document-hasfocus title=dom-document-hasFocus><code>hasFocus()</code></dfn> method
-  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>
+  on <code>DocumentHTML</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>
 
+  <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
+  hint to the user agent that the script believes the user might be
+  interested in the contents of the <a href=#browsing-context>browsing context</a> of
+  the <code><a href=#window>Window</a></code> object on which the method was invoked.</p>
 
+  <p>User agents are encouraged to have this <code title=dom-window-blur><a href=#dom-window-blur>focus()</a></code> method trigger some kind of
+  notification.</p>
+
+  <p>The <dfn id=dom-window-blur title=dom-window-blur><code>blur()</code></dfn> method
+  on the <code><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>browsing
+  context</a> of the <code><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>
+
+  <p>User agents are encouraged to ignore calls to this <code title=dom-window-blur><a href=#dom-window-blur>blur()</a></code> method entirely.</p>
+
+  <p class=note>Historically the <code title=dom-window-blur><a href=#dom-window-blur>focus()</a></code> and <code title=dom-window-blur><a href=#dom-window-blur>blur()</a></code> methods actually affected the
+  system focus, but hostile sites widely abuse this behavior to the
+  user's detriment.</p>
+
+
   <h4 id=element-level-focus-apis><span class=secno>6.5.4 </span>Element-level focus APIs</h4>
 
   <p>The <dfn id=dom-focus title=dom-focus><code>focus()</code></dfn> method,

Modified: source
===================================================================
--- source	2008-12-27 12:07:06 UTC (rev 2595)
+++ source	2008-12-28 06:16:21 UTC (rev 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,




More information about the Commit-Watchers mailing list