W3C home > Mailing lists > Public > public-html-diffs@w3.org > December 2008

spec/Overview.html 1.1767 2596 window.close(), window.focus(), window.b

From: poot <cvsmail@w3.org>
Date: Sun, 28 Dec 2008 15:19:29 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20081228061930.0134E2BBFB@toro.w3.mag.keio.ac.jp>

window.close(), window.focus(), window.blur(). (whatwg r2596)

focus()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-window-focus
window
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-window
6.4 Scrolling elements into view
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#scrolling-elements-into-view
Status of this document
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#status-of-this-document
6.5.4 Element-level focus APIs
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#element-level-focus-apis
close()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-window-close
A vocabulary and associated APIs for HTML and XHTML
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#a-vocabulary-and-associated-apis-for-html-and-xhtml
returnValue
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-modalwindow-returnvalue
blur()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-window-blur
6.5 Focus
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#focus
name
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-name
5.5.4 Notifications
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#notifications
Window
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#window
VoidCallback
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#voidcallback
hasFocus()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#dom-document-hasfocus
unfocusing steps
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#unfocusing-steps
Editor's Draft 28 December 2008
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#editor-s-draft-date-zzz-9-june-2008
6.5.3 Document-level focus APIs
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#document-level-focus-apis
5.2.3 Accessing other browsing contexts
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1767.html#accessing-other-browsing-contexts

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1766&r2=1.1767&f=h
http://html5.org/tools/web-apps-tracker?from=2595&to=2596

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1766
retrieving revision 1.1767
diff -u -d -r1.1766 -r1.1767
--- Overview.html	27 Dec 2008 12:07:11 -0000	1.1766
+++ Overview.html	28 Dec 2008 06:16:28 -0000	1.1767
@@ -8,7 +8,7 @@
    <p><a href=http://www.w3.org/><img alt=W3C height=48 src=http://www.w3.org/Icons/w3c_home width=72></a></p>
    <h1>HTML 5</h1>
    <h2 class="no-num no-toc" id=a-vocabulary-and-associated-apis-for-html-and-xhtml>A vocabulary and associated APIs for HTML and XHTML</h2>
-   <h2 class="no-num no-toc" id=editor-s-draft-date-zzz-9-june-2008><!-- "W3C Working Draft" --> Editor's Draft <!--ZZZ-->27 December 2008</h2>
+   <h2 class="no-num no-toc" id=editor-s-draft-date-zzz-9-june-2008><!-- "W3C Working Draft" --> Editor's Draft <!--ZZZ-->28 December 2008</h2>
    <dl><!-- ZZZ: update the month/day
     <dt>This Version:</dt>
     <dd><a href="http://www.w3.org/TR/2008/WD-html5-20080610/">http://www.w3.org/TR/2008/WD-html5-20080610/</a></dd>
@@ -97,7 +97,7 @@
   specification's progress along the W3C Recommendation
   track.
   <!--ZZZ:-->
-  This specification is the 27 December 2008 <!--ZZZ "Working Draft"-->Editor's Draft.
+  This specification is the 28 December 2008 <!--ZZZ "Working Draft"-->Editor's Draft.
   <!--:ZZZ-->
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href=http://www.whatwg.org/>WHATWG</a>. The two specifications are
   identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of)
@@ -26917,6 +26917,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>;
@@ -26995,7 +26998,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
   return the <code><a href=#window>Window</a></code> object itself.<p>The <code><a href=#window>Window</a></code> object also provides the scope for <a href=#concept-script title=concept-script>script</a>
   execution. Each <code>Document</code> in a <a href=#browsing-context>browsing
@@ -27072,7 +27074,16 @@
   the <code><a href=#window>Window</a></code> object must, on getting, return the current
   name of the <a href=#browsing-context>browsing context</a>, and, on setting, set the
   name of the <a href=#browsing-context>browsing context</a> to the new value.<p class=note>The name <a href=#resetBCName>gets reset</a> when
-  the browsing context is navigated to another domain.<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
+  the browsing context is navigated to another domain.<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).<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
   attribute on the <code><a href=#window>Window</a></code> interface must return the
   number of <a href=#child-browsing-context title="child browsing context">child browsing
   contexts</a> of the <a href=#active-document title="active document">active</a>
@@ -28603,7 +28614,8 @@
   created.<p>The <dfn id=dom-modalwindow-returnvalue title=dom-modalWindow-returnValue><code>returnValue</code></dfn>
   DOM attribute, on getting, must return the <a href=#return-value>return value</a>
   of its browsing context, and on setting, must set the <a href=#return-value>return
-  value</a> to the given new value.<h4 id=notifications><span class=secno>5.5.4 </span>Notifications</h4><!-- v2 feature requests:
+  value</a> to the given new value.<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.<h4 id=notifications><span class=secno>5.5.4 </span>Notifications</h4><!-- v2 feature requests:
 
    - ability to snooze a notification so it comes again later
       - shouldn't be on all messages, only those for which it makes
@@ -33078,15 +33090,12 @@
   attention of the user.<p>Non-visual user agents may ignore the argument, or may treat it
   in some media-specific manner most useful to the user.</p><!-- XXX maybe this should move to CSSOM --><h3 id=focus><span class=secno>6.5 </span>Focus</h3><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%20%0A...%3Cform%3E%3Cinput%20name%3Da%20onfocus%3D%22value%2B%3D1%3Bd.name%3D%27a%27%3Bname%3D%27d%27%3Bb.focus()%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22value%2B%3D1%3Bc.focus()%22%3E%0A%3Cinput%20name%3Dc%20onfocus%3D%22value%2B%3D1%3Bd.focus()%22%3E%0A%3Cinput%20name%3Dd%20onfocus%3D%22value%2B%3D1%3Ba.focus()%22%3E --><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cform%3E%0A%3Ctextarea%20name%3Dt%20cols%3D100%20rows%3D3%3E%3C%2Ftextarea%3E%3Cp%3E%0A%3Cinput%20name%3Da%20onfocus%3D%22t.value%2B%3D%27af1%20%27%3Bb.focus()%3Balert(document.activeElement.name)%3Bt.value%2B%3D%27af2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27ab%20%27%3B%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22t.value%2B%3D%27bf1%20%27%3Bc.focus()%3Bt.value%2B%D%27bf2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27bb%20%27%3B%22%3E%0A%3Cinput%20name%3Dc%20onfocus%3D%22t.value%2B%3D%27cf1%20%27%3Bc.focus()%3Bt.value%2B%3D%27cf2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27cb%20%27%3B%22%3E%0A --><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cbody%20onload%3D%22document.forms%5B0%5D.a.focus()%22%3E%0A...%3Cform%3E%0A%3Ctextarea%20name%3Dt%20cols%3D100%20rows%3D3%3E%3C%2Ftextarea%3E%3Cp%3E%0A%3Cinput%20name%3Da%20onblur%3D%22t.value%2B%3D'ab%20'%3B%20b.focus()%3B%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22t.value%2B%3D'bf1%20'%3Ba.focus()%3Bt.value%2B%3D'bf2%20'%3B%22%20onblur%3D%22t.value%2B%3D'bb%20'%3B%22%3E --><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cbody%3E...%3Cform%3E%0A%3Ctextarea%20name%3Dt%20cols%3D100%20rows%3D3%3E%3C%2Ftextarea%3E%3Cp%3E%0A%3Cinput%20name%3Da%20onfocus%3D%22t.value%2B%3D%27af%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27ab1%20%27%3Bb.focus()%3Bt.value%2B%3D%27ab2%20%27%B%22%3E%0A%3Cinput%20name%3Db%20onfocus%3D%22t.value%2B%3D%27bf1%20%27%3Ba.focus()%3Bt.value%2B%3D%27bf2%20%27%3B%22%20onblur%3D%22t.value%2B%3D%27bb%20%27%3B%22%3E --><!-- 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
   document must be targeted at that element. There may be no element
   focused; when no element is focused, key events received by the
@@ -33230,14 +33239,28 @@
   </ol><p>User agents should run the <a href=#unfocusing-steps>unfocusing steps</a> for an
   element whenever the user moves the focus away from any
   <a href=#focusable>focusable</a> element.<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>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>.<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,
+  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>The <dfn id=dom-document-hasfocus title=dom-document-hasFocus><code>hasFocus()</code></dfn> method
+  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>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>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>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>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 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.<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,
   when invoked, must run the following algorithm:<ol><li><p>If the element is marked as <i><a href=#locked-for-focus>locked for focus</a></i>, then abort
    these steps.</li>
Received on Sunday, 28 December 2008 06:20:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:13:57 GMT