Skip to content

Commit

Permalink
Fix Window's close(d) members
Browse files Browse the repository at this point in the history
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 #4405. Helps with #4363.
  • Loading branch information
annevk committed Mar 7, 2019
1 parent f9e4c66 commit 37b1ce5
Showing 1 changed file with 37 additions and 21 deletions.
58 changes: 37 additions & 21 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -77111,6 +77111,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<p>A <span>browsing context</span> has a <dfn id="disowned-its-opener">disowned</dfn> boolean. It
is initially false.</p>

<p>A <span>browsing context</span> has an <dfn>is closing</dfn> boolean. It is initially
false.</p>

<p>A <span>browsing context</span> has a <span>session history</span>, which lists the
<code>Document</code> objects that the <span>browsing context</span> has presented, is presenting,
or will present. A <span>browsing context</span>'s <dfn data-export="">active document</dfn> is
Expand Down Expand Up @@ -78845,8 +78848,7 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>

<hr>

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

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

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

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

<hr>

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

<ul class="brief">
<ol>
<li><p>Let <var>current</var> be this <code>Window</code> object's <span data-x="window
bc">browsing context</span>.</p></li>

<li><p>If <var>current</var> is null or its <span>is closing</span> is true, then
return.</p></li>

<li>
<p>If all the following are true</p>

<ul class="brief">
<li><var>current</var> is <span>script-closable</span></li>

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

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

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

</ul>
<ol>
<li><p>Set <var>current</var>'s <span>is closing</span> to true.</p></li>

<li><p><span>Queue a task</span> on the <span>DOM manipulation task source</span> to <span
data-x="close a browsing context">close</span> <var>current</var>.</p></li>
</ol>
</li>
</ol>

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

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

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

</div>
Expand Down

0 comments on commit 37b1ce5

Please sign in to comment.