[html5] r7393 - [giow] (3) Better define window.close() and how to close tabs. Fixing https://ww [...]
whatwg at whatwg.org
whatwg at whatwg.org
Sun Sep 23 16:25:36 PDT 2012
Author: ianh
Date: 2012-09-23 16:25:34 -0700 (Sun, 23 Sep 2012)
New Revision: 7393
Modified:
complete.html
index
source
Log:
[giow] (3) Better define window.close() and how to close tabs.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17631
Affected topics: DOM APIs, HTML
Modified: complete.html
===================================================================
--- complete.html 2012-09-23 22:34:55 UTC (rev 7392)
+++ complete.html 2012-09-23 23:25:34 UTC (rev 7393)
@@ -881,8 +881,9 @@
<li><a href=#accessing-other-browsing-contexts><span class=secno>6.2.3 </span>Accessing other browsing contexts</a></li>
<li><a href=#named-access-on-the-window-object><span class=secno>6.2.4 </span>Named access on the <code>Window</code> object</a></li>
<li><a href=#garbage-collection-and-browsing-contexts><span class=secno>6.2.5 </span>Garbage collection and browsing contexts</a></li>
- <li><a href=#browser-interface-elements><span class=secno>6.2.6 </span>Browser interface elements</a></li>
- <li><a href=#the-windowproxy-object><span class=secno>6.2.7 </span>The <code>WindowProxy</code> object</a></ol></li>
+ <li><a href=#closing-browsing-contexts><span class=secno>6.2.6 </span>Closing browsing contexts</a></li>
+ <li><a href=#browser-interface-elements><span class=secno>6.2.7 </span>Browser interface elements</a></li>
+ <li><a href=#the-windowproxy-object><span class=secno>6.2.8 </span>The <code>WindowProxy</code> object</a></ol></li>
<li><a href=#origin-0><span class=secno>6.3 </span>Origin</a>
<ol>
<li><a href=#relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relaxing the same-origin restriction</a></ol></li>
@@ -68325,11 +68326,11 @@
<hr><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
- <a href=#script-closable>script-closable</a> and 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=#script-closable>script-closable</a> and 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>
+ <var title="">A</var>, <a href=#close-a-browsing-context title="close a browsing
+ context">close</a> the <a href=#browsing-context>browsing context</a> <var title="">A</var>.</p>
<p>A <a href=#browsing-context>browsing context</a> is <dfn id=script-closable>script-closable</dfn> if
it is an <a href=#auxiliary-browsing-context>auxiliary browsing context</a> that was created by
@@ -68562,7 +68563,7 @@
<p>User agents may <a href=#a-browsing-context-is-discarded title="a browsing context is
discarded">discard</a> <a href=#top-level-browsing-context title="top-level browsing
context">top-level browsing contexts</a> at any time (typically,
- in response to user requests, e.g. when a user closes a window
+ in response to user requests, e.g. when a user force-closes a window
containing one or more <a href=#top-level-browsing-context title="top-level browsing
context">top-level browsing contexts</a>). Other <a href=#browsing-context title="browsing context">browsing contexts</a> must be discarded
once their <code><a href=#windowproxy>WindowProxy</a></code> object is eligible for garbage
@@ -68571,9 +68572,34 @@
</div>
+ <h4 id=closing-browsing-contexts><span class=secno>6.2.6 </span>Closing browsing contexts</h4>
- <h4 id=browser-interface-elements><span class=secno>6.2.6 </span>Browser interface elements</h4>
+ <p>When the user agent is required to <dfn id=close-a-browsing-context>close a browsing context</dfn>, it must run the
+ following steps:</p>
+ <ol><li><p>Let <var title="">specified browsing context</var> be the <a href=#browsing-context>browsing context</a>
+ being closed.</li>
+
+ <li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the <a href=#active-document>active
+ document</a> of the <var title="">specified browsing context</var>. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused
+ to allow the document to be unloaded</a>, then abort these steps.</li>
+
+ <li><p><a href=#unload-a-document title="unload a document">Unload</a> the <a href=#active-document>active document</a> of the <var title="">specified browsing context</var> with the <var title="">recycle</var> parameter set to
+ false.</li>
+
+ <li><p>Remove the <var title="">specified browsing context</var> from the user interface (e.g.
+ close or hide its tab in a tabbed browser).</li>
+
+ <li><p><a href=#a-browsing-context-is-discarded title="a browsing context is discarded">Discard</a> the <var title="">specified
+ browsing context</var>.</li>
+
+ </ol><p>User agents should offer users the ability to arbitrarily <a href=#close-a-browsing-context title="close a browsing
+ context">close</a> any <a href=#top-level-browsing-context>top-level browsing context</a>.</p>
+
+
+
+ <h4 id=browser-interface-elements><span class=secno>6.2.7 </span>Browser interface elements</h4>
+
<p>To allow Web pages to integrate with Web browsers, certain Web
browser interface elements are exposed in a limited way to scripts
in Web pages.</p>
@@ -68711,7 +68737,7 @@
<div class=impl>
- <h4 id=the-windowproxy-object><span class=secno>6.2.7 </span>The <code><a href=#windowproxy>WindowProxy</a></code> object</h4>
+ <h4 id=the-windowproxy-object><span class=secno>6.2.8 </span>The <code><a href=#windowproxy>WindowProxy</a></code> object</h4>
<p>As mentioned earlier, each <a href=#browsing-context>browsing context</a> has a
Modified: index
===================================================================
--- index 2012-09-23 22:34:55 UTC (rev 7392)
+++ index 2012-09-23 23:25:34 UTC (rev 7393)
@@ -881,8 +881,9 @@
<li><a href=#accessing-other-browsing-contexts><span class=secno>6.2.3 </span>Accessing other browsing contexts</a></li>
<li><a href=#named-access-on-the-window-object><span class=secno>6.2.4 </span>Named access on the <code>Window</code> object</a></li>
<li><a href=#garbage-collection-and-browsing-contexts><span class=secno>6.2.5 </span>Garbage collection and browsing contexts</a></li>
- <li><a href=#browser-interface-elements><span class=secno>6.2.6 </span>Browser interface elements</a></li>
- <li><a href=#the-windowproxy-object><span class=secno>6.2.7 </span>The <code>WindowProxy</code> object</a></ol></li>
+ <li><a href=#closing-browsing-contexts><span class=secno>6.2.6 </span>Closing browsing contexts</a></li>
+ <li><a href=#browser-interface-elements><span class=secno>6.2.7 </span>Browser interface elements</a></li>
+ <li><a href=#the-windowproxy-object><span class=secno>6.2.8 </span>The <code>WindowProxy</code> object</a></ol></li>
<li><a href=#origin-0><span class=secno>6.3 </span>Origin</a>
<ol>
<li><a href=#relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relaxing the same-origin restriction</a></ol></li>
@@ -68325,11 +68326,11 @@
<hr><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
- <a href=#script-closable>script-closable</a> and 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=#script-closable>script-closable</a> and 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>
+ <var title="">A</var>, <a href=#close-a-browsing-context title="close a browsing
+ context">close</a> the <a href=#browsing-context>browsing context</a> <var title="">A</var>.</p>
<p>A <a href=#browsing-context>browsing context</a> is <dfn id=script-closable>script-closable</dfn> if
it is an <a href=#auxiliary-browsing-context>auxiliary browsing context</a> that was created by
@@ -68562,7 +68563,7 @@
<p>User agents may <a href=#a-browsing-context-is-discarded title="a browsing context is
discarded">discard</a> <a href=#top-level-browsing-context title="top-level browsing
context">top-level browsing contexts</a> at any time (typically,
- in response to user requests, e.g. when a user closes a window
+ in response to user requests, e.g. when a user force-closes a window
containing one or more <a href=#top-level-browsing-context title="top-level browsing
context">top-level browsing contexts</a>). Other <a href=#browsing-context title="browsing context">browsing contexts</a> must be discarded
once their <code><a href=#windowproxy>WindowProxy</a></code> object is eligible for garbage
@@ -68571,9 +68572,34 @@
</div>
+ <h4 id=closing-browsing-contexts><span class=secno>6.2.6 </span>Closing browsing contexts</h4>
- <h4 id=browser-interface-elements><span class=secno>6.2.6 </span>Browser interface elements</h4>
+ <p>When the user agent is required to <dfn id=close-a-browsing-context>close a browsing context</dfn>, it must run the
+ following steps:</p>
+ <ol><li><p>Let <var title="">specified browsing context</var> be the <a href=#browsing-context>browsing context</a>
+ being closed.</li>
+
+ <li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the <a href=#active-document>active
+ document</a> of the <var title="">specified browsing context</var>. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused
+ to allow the document to be unloaded</a>, then abort these steps.</li>
+
+ <li><p><a href=#unload-a-document title="unload a document">Unload</a> the <a href=#active-document>active document</a> of the <var title="">specified browsing context</var> with the <var title="">recycle</var> parameter set to
+ false.</li>
+
+ <li><p>Remove the <var title="">specified browsing context</var> from the user interface (e.g.
+ close or hide its tab in a tabbed browser).</li>
+
+ <li><p><a href=#a-browsing-context-is-discarded title="a browsing context is discarded">Discard</a> the <var title="">specified
+ browsing context</var>.</li>
+
+ </ol><p>User agents should offer users the ability to arbitrarily <a href=#close-a-browsing-context title="close a browsing
+ context">close</a> any <a href=#top-level-browsing-context>top-level browsing context</a>.</p>
+
+
+
+ <h4 id=browser-interface-elements><span class=secno>6.2.7 </span>Browser interface elements</h4>
+
<p>To allow Web pages to integrate with Web browsers, certain Web
browser interface elements are exposed in a limited way to scripts
in Web pages.</p>
@@ -68711,7 +68737,7 @@
<div class=impl>
- <h4 id=the-windowproxy-object><span class=secno>6.2.7 </span>The <code><a href=#windowproxy>WindowProxy</a></code> object</h4>
+ <h4 id=the-windowproxy-object><span class=secno>6.2.8 </span>The <code><a href=#windowproxy>WindowProxy</a></code> object</h4>
<p>As mentioned earlier, each <a href=#browsing-context>browsing context</a> has a
Modified: source
===================================================================
--- source 2012-09-23 22:34:55 UTC (rev 7392)
+++ source 2012-09-23 23:25:34 UTC (rev 7393)
@@ -1,4 +1,4 @@
-<!-- EDITOR NOTES
+<!-- EDITOR NOTES -*- mode: Text; fill-column: 100 -*-
!
! Adding a new element involves editing the following sections:
! - section for the element itself
@@ -79928,13 +79928,13 @@
<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
- <span>script-closable</span> and the <span title="script's
- browsing context">browsing context</span> of the <span
+ <span>script-closable</span> and 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>
+ <var title="">A</var>, <span title="close a browsing
+ context">close</span> the <span>browsing context</span> <var
+ title="">A</var>.</p>
<p>A <span>browsing context</span> is <dfn>script-closable</dfn> if
it is an <span>auxiliary browsing context</span> that was created by
@@ -80211,7 +80211,7 @@
<p>User agents may <span title="a browsing context is
discarded">discard</span> <span title="top-level browsing
context">top-level browsing contexts</span> at any time (typically,
- in response to user requests, e.g. when a user closes a window
+ in response to user requests, e.g. when a user force-closes a window
containing one or more <span title="top-level browsing
context">top-level browsing contexts</span>). Other <span
title="browsing context">browsing contexts</span> must be discarded
@@ -80221,7 +80221,37 @@
</div>
+ <h4>Closing browsing contexts</h4>
+ <p>When the user agent is required to <dfn>close a browsing context</dfn>, it must run the
+ following steps:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">specified browsing context</var> be the <span>browsing context</span>
+ being closed.</p></li>
+
+ <li><p><span title="prompt to unload a document">Prompt to unload</span> the <span>active
+ document</span> of the <var title="">specified browsing context</var>. If the user <span>refused
+ to allow the document to be unloaded</span>, then abort these steps.</p></li>
+
+ <li><p><span title="unload a document">Unload</span> the <span>active document</span> of the <var
+ title="">specified browsing context</var> with the <var title="">recycle</var> parameter set to
+ false.</p></li>
+
+ <li><p>Remove the <var title="">specified browsing context</var> from the user interface (e.g.
+ close or hide its tab in a tabbed browser).</p></li>
+
+ <li><p><span title="a browsing context is discarded">Discard</span> the <var title="">specified
+ browsing context</var>.</p></li>
+
+ </ol>
+
+ <p>User agents should offer users the ability to arbitrarily <span title="close a browsing
+ context">close</span> any <span>top-level browsing context</span>.</p>
+
+
+
<h4>Browser interface elements</h4>
<p>To allow Web pages to integrate with Web browsers, certain Web
More information about the Commit-Watchers
mailing list