Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37b1ce5

Browse files
authored
Fix Window's close(d) members
close() needed to queue a task to close, though closed needs to immediately know when close() is invoked too. Tests: web-platform-tests/wpt#15561 & web-platform-tests/wpt#15649. Fixes whatwg#4405. Helps with whatwg#4363.
1 parent f9e4c66 commit 37b1ce5

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

source

+37-21
Original file line numberDiff line numberDiff line change
@@ -77111,6 +77111,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7711177111
<p>A <span>browsing context</span> has a <dfn id="disowned-its-opener">disowned</dfn> boolean. It
7711277112
is initially false.</p>
7711377113

77114+
<p>A <span>browsing context</span> has an <dfn>is closing</dfn> boolean. It is initially
77115+
false.</p>
77116+
7711477117
<p>A <span>browsing context</span> has a <span>session history</span>, which lists the
7711577118
<code>Document</code> objects that the <span>browsing context</span> has presented, is presenting,
7711677119
or will present. A <span>browsing context</span>'s <dfn data-export="">active document</dfn> is
@@ -78845,8 +78848,7 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7884578848

7884678849
<hr>
7884778850

78848-
<p>The <dfn><code data-x="dom-name">name</code></dfn> attribute's getter, when invoked, must run
78849-
these steps:</p>
78851+
<p>The <dfn><code data-x="dom-name">name</code></dfn> attribute's getter must run these steps:</p>
7885078852

7885178853
<ol>
7885278854
<li><p>If this <code>Window</code> object's <span data-x="window bc">browsing context</span> is
@@ -78856,8 +78858,7 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7885678858
context</span>'s <span data-x="browsing context name">name</span>.</p></li>
7885778859
</ol>
7885878860

78859-
<p>The <code data-x="dom-name">name</code> attribute's setter, when invoked, must run these
78860-
steps:</p>
78861+
<p>The <code data-x="dom-name">name</code> attribute's setter must run these steps:</p>
7886178862

7886278863
<ol>
7886378864
<li><p>If this <code>Window</code> object's <span data-x="window bc">browsing context</span> is
@@ -78872,35 +78873,50 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7887278873

7887378874
<hr>
7887478875

78875-
<p>The <dfn><code data-x="dom-window-close">close()</code></dfn> method on <code>Window</code>
78876-
objects should, if all the following conditions are met, <span data-x="close a browsing
78877-
context">close</span> the <span>browsing context</span> <var>A</var>:
78876+
<p>The <dfn><code data-x="dom-window-close">close()</code></dfn> method must run these steps:
7887878877

78879-
<ul class="brief">
78878+
<ol>
78879+
<li><p>Let <var>current</var> be this <code>Window</code> object's <span data-x="window
78880+
bc">browsing context</span>.</p></li>
78881+
78882+
<li><p>If <var>current</var> is null or its <span>is closing</span> is true, then
78883+
return.</p></li>
78884+
78885+
<li>
78886+
<p>If all the following are true</p>
78887+
78888+
<ul class="brief">
78889+
<li><var>current</var> is <span>script-closable</span></li>
7888078890

78881-
<li>The corresponding <span>browsing context</span> <var>A</var> is
78882-
<span>script-closable</span>.</li>
78891+
<li>the <span>incumbent settings object</span>'s <span>responsible browsing context</span> is
78892+
<span>familiar with</span> <var>current</var> </li>
7888378893

78884-
<li>The <span>responsible browsing context</span> specified by the <span>incumbent settings
78885-
object</span> is <span>familiar with</span> the <span>browsing context</span> <var>A</var>.</li>
78894+
<li id="sandboxClose">the <span>incumbent settings object</span>'s <span>responsible browsing
78895+
context</span> is <span>allowed to navigate</span> <var>current</var></li>
78896+
</ul>
7888678897

78887-
<li id="sandboxClose">The <span>responsible browsing context</span> specified by the
78888-
<span>incumbent settings object</span> is <span>allowed to navigate</span> the <span>browsing
78889-
context</span> <var>A</var>.</li>
78898+
<p>then:</p>
7889078899

78891-
</ul>
78900+
<ol>
78901+
<li><p>Set <var>current</var>'s <span>is closing</span> to true.</p></li>
78902+
78903+
<li><p><span>Queue a task</span> on the <span>DOM manipulation task source</span> to <span
78904+
data-x="close a browsing context">close</span> <var>current</var>.</p></li>
78905+
</ol>
78906+
</li>
78907+
</ol>
7889278908

7889378909
<p>A <span>browsing context</span> is <dfn>script-closable</dfn> if it is an <span>auxiliary
7889478910
browsing context</span> that was created by a script (as opposed to by an action of the user), or
7889578911
if it is a <span>top-level browsing context</span> whose <span>session history</span> contains
7889678912
only one <code>Document</code>.</p>
7889778913

78898-
<p>The <dfn><code data-x="dom-window-closed">closed</code></dfn> attribute on <code>Window</code>
78899-
objects must return true if the <code>Window</code> object's <span>browsing context</span> has
78900-
been <span data-x="a browsing context is discarded">discarded</span>, and false otherwise.</p>
78914+
<p>The <dfn><code data-x="dom-window-closed">closed</code></dfn> attribute's getter must return
78915+
true if this <code>Window</code> object's <span data-x="window bc">browsing context</span> is
78916+
null or its <span>is closing</span> is true, and false otherwise.</p>
7890178917

78902-
<p>The <dfn><code data-x="dom-window-stop">stop()</code></dfn> method on <code>Window</code>
78903-
objects must <span>stop document loading</span> given this <code>Window</code> object's <span
78918+
<p>The <dfn><code data-x="dom-window-stop">stop()</code></dfn> method must <span>stop document
78919+
loading</span> given this <code>Window</code> object's <span
7890478920
data-x="concept-document-window">associated <code>Document</code></span>.</p>
7890578921

7890678922
</div>

0 commit comments

Comments
 (0)