Skip to content

Commit 2f6e75f

Browse files
authored
Collapse disowned into opener browsing context
Tests: web-platform-tests/wpt#38447. Fixes #5569.
1 parent 69998ed commit 2f6e75f

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

source

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86154,8 +86154,6 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri
8615486154

8615586155
<li><p>If <var>current</var> is null, then return null.</p></li>
8615686156

86157-
<li><p>If <var>current</var>'s <span>disowned</span> is true, then return null.</p></li>
86158-
8615986157
<li><p>If <var>current</var>'s <span>opener browsing context</span> is null, then return
8616086158
null.</p></li>
8616186159

@@ -86168,7 +86166,7 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri
8616886166
<ol>
8616986167
<li><p>If the given value is null and <span>this</span>'s <span data-x="window bc">browsing
8617086168
context</span> is non-null, then set <span>this</span>'s <span data-x="window bc">browsing
86171-
context</span>'s <span>disowned</span> to true.</p></li>
86169+
context</span>'s <span>opener browsing context</span> to null.</p></li>
8617286170

8617386171
<li><p>If the given value is non-null, then return ?
8617486172
<span>OrdinaryDefineOwnProperty</span>(<span>this</span>, "<code data-x="">opener</code>", {
@@ -86177,18 +86175,14 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri
8617786175
</ol>
8617886176

8617986177
<div class="note">
86180-
<p>If a <span>browsing context</span>'s <span>disowned</span> is true, its <code
86181-
data-x="dom-opener">window.opener</code> attribute is null. That prevents scripts in the
86182-
<span>browsing context</span> from changing any properties of its <span>opener browsing
86183-
context</span>'s <code>Window</code> object (i.e., the <code>Window</code> object from which the
86184-
<span>browsing context</span> was created).</p>
86178+
<p>Setting <code data-x="dom-opener">window.opener</code> to null clears the <span>opener
86179+
browsing context</span> reference. In practice, this prevents future scripts from accessing their
86180+
<span>opener browsing context</span>'s <code>Window</code> object.</p>
8618586181

86186-
<p>Otherwise, if a <span>browsing context</span>'s <span>disowned</span> is false, then scripts
86187-
in that <span>browsing context</span> can use <code data-x="dom-opener">window.opener</code> to
86188-
change properties of its <span>opener browsing context</span>'s <code>Window</code> object. For
86189-
example, a script running in the <span>browsing context</span> can change the value of <code
86190-
data-x="">window.opener.location</code>, causing the <span>opener browsing context</span> to
86191-
navigate to a completely different document.</p>
86182+
<p>By default, scripts can access their <span>opener browsing context</span>'s
86183+
<code>Window</code> object through the <code data-x="dom-opener">window.opener</code> getter.
86184+
E.g., a script can set <code data-x="">window.opener.location</code>, causing the <span>opener
86185+
browsing context</span> to navigate.</p>
8619286186
</div>
8619386187

8619486188
<p>The <dfn attribute for="Window"><code data-x="dom-parent">parent</code></dfn> getter steps
@@ -89358,8 +89352,6 @@ interface <dfn interface>BeforeUnloadEvent</dfn> : <span>Event</span> {
8935889352
<li><p>An <dfn data-x="opener-origin-at-creation">opener origin at creation</dfn>, an
8935989353
<span>origin</span> or null, initially null.</p>
8936089354

89361-
<li><p>A <dfn id="disowned-its-opener">disowned</dfn> boolean, initially false.</p></li>
89362-
8936389355
<li>
8936489356
<p>An <dfn>is popup</dfn> boolean, initially false.</p>
8936589357

@@ -91318,7 +91310,7 @@ location.href = '#foo';</code></pre>
9131891310

9131991311
<li><p><var>historyEntry</var>'s <span data-x="she-document">document</span>'s <span
9132091312
data-x="concept-document-bc">browsing context</span> is not an <span>auxiliary browsing
91321-
context</span> whose <span>disowned</span> is false; and</p></li>
91313+
context</span> whose <span>opener browsing context</span> is non-null; and</p></li>
9132291314

9132391315
<li><p><var>historyEntry</var>'s <span data-x="she-document">document</span>'s <span
9132491316
data-x="concept-document-origin">origin</span> is not <var>navigable</var>'s <span
@@ -93605,7 +93597,7 @@ location.href = '#foo';</code></pre>
9360593597

9360693598
<li><p><var>targetEntry</var>'s <span data-x="she-document">document</span>'s <span
9360793599
data-x="concept-document-bc">browsing context</span> is not an <span>auxiliary browsing
93608-
context</span> whose <span>disowned</span> is false; and</p></li>
93600+
context</span> whose <span>opener browsing context</span> is non-null; and</p></li>
9360993601

9361093602
<li><p><var>targetEntry</var>'s <span data-x="she-document">document</span>'s <span
9361193603
data-x="concept-document-origin">origin</span> is not <var>oldOrigin</var></p></li>

0 commit comments

Comments
 (0)