Skip to content

Commit a1ad979

Browse files
authored
Extend "window open steps" to observe COOP
Specify that window.open() and document.open() must return null when COOP restrictions are being enforced. Closes #5759.
1 parent 2333203 commit a1ad979

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

source

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23313,9 +23313,9 @@ document.body.appendChild(wbr);</code></pre>
2331323313
an element's noopener</span> with <var>subject</var> and
2331423314
<var>targetAttributeValue</var>.</p></li>
2331523315

23316-
<li><p>Let <var>target</var> and <var>replace</var> be the result of applying <span>the rules for
23317-
choosing a browsing context</span> given <var>targetAttributeValue</var>, <var>source</var>, and
23318-
<var>noopener</var>.</p></li>
23316+
<li><p>Let <var>target</var> and <var>windowType</var> be the result of applying <span>the rules
23317+
for choosing a browsing context</span> given <var>targetAttributeValue</var>, <var>source</var>,
23318+
and <var>noopener</var>.</p></li>
2331923319

2332023320
<li><p>If <var>target</var> is null, then return.</p></li>
2332123321

@@ -23348,9 +23348,9 @@ document.body.appendChild(wbr);</code></pre>
2334823348

2334923349
<li><p><span>Queue an element task</span> on the <span>DOM manipulation task source</span> given
2335023350
<var>subject</var> to <span>navigate</span><!--DONAV hyperlink--> the <var>target</var>
23351-
<span>browsing context</span> to <var>request</var>. If <var>replace</var> is true, the
23352-
navigation must be performed with <span>replacement enabled</span>. The <span>source browsing
23353-
context</span> must be <var>source</var>.</p></li>
23351+
<span>browsing context</span> to <var>request</var>. If <var>windowType</var> is not "<code
23352+
data-x="">existing or none</code>", the navigation must be performed with <span>replacement
23353+
enabled</span>. The <span>source browsing context</span> must be <var>source</var>.</p></li>
2335423354
</ol>
2335523355

2335623356
</div>
@@ -55687,9 +55687,13 @@ fur
5568755687
<li><p>Let <var>noopener</var> be the result of <span data-x="get an element's noopener">getting
5568855688
an element's noopener</span> with <var>form</var> and <var>targetAttributeValue</var>.</p></li>
5568955689

55690-
<li><p>Let <var>target browsing context</var> and <var>replace</var> be the result of applying
55691-
<span>the rules for choosing a browsing context</span> using <var>target</var>, <var>form
55692-
browsing context</var>, and <var>noopener</var>.</p></li>
55690+
<li><p>Let <var>target browsing context</var> and <var>windowType</var> be the result of
55691+
applying <span>the rules for choosing a browsing context</span> using <var>target</var>,
55692+
<var>form browsing context</var>, and <var>noopener</var>.</p></li>
55693+
55694+
<li><p>Let <var>replace</var> be true if <var>windowType</var> is either "<code
55695+
data-x="">new and unrestricted</code>" or "<code data-x="">new with no opener</code>", and false
55696+
otherwise.</p></li>
5569355697

5569455698
<li><p>If <var>target browsing context</var> is null, then return.</p></li>
5569555699

@@ -77720,7 +77724,7 @@ console.assert(iframeWindow.frameElement === null);
7772077724
<ol>
7772177725
<li><p>Let <var>chosen</var> be null.</p></li>
7772277726

77723-
<li><p>Let <var>new</var> be false.</p></li>
77727+
<li><p>Let <var>windowType</var> be "<code data-x="">existing or none</code>".</p></li>
7772477728

7772577729
<li><p>Let <var>sandboxingFlagSet</var> be <var>current</var>'s <span>active document</span>'s
7772677730
<span>active sandboxing flag set</span>.</p></li>
@@ -77770,7 +77774,8 @@ console.assert(iframeWindow.frameElement === null);
7777077774

7777177775
<ol>
7777277776
<li><p>Set <var>chosen</var> to the result of <span>creating a new top-level browsing
77773-
context</span> and set <var>new</var> to true.</p></li>
77777+
context</span> and set <var>windowType</var> to "<code data-x="">new and
77778+
unrestricted</code>".</p></li>
7777477779

7777577780
<li><p>Set <var>chosen</var> to an existing <span>top-level browsing context</span>.</p>
7777677781
</ol>
@@ -77787,6 +77792,8 @@ console.assert(iframeWindow.frameElement === null);
7778777792

7778877793
<dd>
7778977794
<ol>
77795+
<li><p>Set <var>windowType</var> to "<code data-x="">new and unrestricted</code>".</p></li>
77796+
7779077797
<li>
7779177798
<p>If <var>current</var>'s <span>top-level browsing context</span>'s <span>active
7779277799
document</span>'s <span data-x="concept-document-coop">cross-origin opener policy</span> is
@@ -77800,8 +77807,9 @@ console.assert(iframeWindow.frameElement === null);
7780077807
<li>
7780177808
<p>If <var>currentDocument</var>'s <span>origin</span> is not <span>same origin</span>
7780277809
with <var>currentDocument</var>'s <span>relevant settings object</span>'s <span>top-level
77803-
origin</span>, then set <var>noopener</var> to true and <var>name</var> to "<code
77804-
data-x="">_blank</code>".</p>
77810+
origin</span>, then set <var>noopener</var> to true, <var>name</var> to "<code
77811+
data-x="">_blank</code>", and <var>windowType</var> to "<code data-x="">new with no
77812+
opener</code>".</p>
7780577813

7780677814
<p class="note">In the presence of a <span>cross-origin opener policy</span>, nested
7780777815
documents that are cross-origin with their top-level browsing context's active document
@@ -77810,7 +77818,6 @@ console.assert(iframeWindow.frameElement === null);
7781077818
</ol>
7781177819
</li>
7781277820

77813-
<li><p>Set <var>new</var> to true.</p></li>
7781477821

7781577822
<li id="noopener"><p>If <var>noopener</var> is true, then set <var>chosen</var> to the result
7781677823
of <span>creating a new top-level browsing context</span>.</p></li>
@@ -77857,7 +77864,7 @@ console.assert(iframeWindow.frameElement === null);
7785777864
agent to always reuse <var>current</var>.</p>
7785877865
</li>
7785977866

77860-
<li><p>Return <var>chosen</var> and <var>new</var>.</p></li>
77867+
<li><p>Return <var>chosen</var> and <var>windowType</var>.</p></li>
7786177868
</ol>
7786277869

7786377870

@@ -78390,9 +78397,9 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7839078397
<li><p>If <var>noreferrer</var> is true, then set <var>noopener</var> to true.</p></li>
7839178398

7839278399
<li>
78393-
<p>Let <var>target browsing context</var> and <var>new</var> be the result of applying <span>the
78394-
rules for choosing a browsing context</span> given <var>target</var>, <var>source browsing
78395-
context</var>, and <var>noopener</var>.</p>
78400+
<p>Let <var>target browsing context</var> and <var>windowType</var> be the result of applying
78401+
<span>the rules for choosing a browsing context</span> given <var>target</var>, <var>source
78402+
browsing context</var>, and <var>noopener</var>.</p>
7839678403

7839778404
<p class="example">If there is a user agent that supports control-clicking a link to open it in
7839878405
a new tab, and the user control-clicks on an element whose <code
@@ -78402,6 +78409,9 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7840278409
tab.</p>
7840378410
</li>
7840478411

78412+
<li><p>Let <var>new</var> be true if <var>windowType</var> is either "<code data-x="">new and
78413+
unrestricted</code>" or "<code data-x="">new with no opener</code>", and false otherwise.</p></li>
78414+
7840578415
<li><p>If <var>target browsing context</var> is null, then return null.</p></li>
7840678416

7840778417
<li><p>If <var>new</var> is true, then <span>set up browsing context features</span> for
@@ -78443,7 +78453,8 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
7844378453
</ol>
7844478454
</li>
7844578455

78446-
<li><p>If <var>noopener</var> is true, then return null.</p></li>
78456+
<li><p>If <var>noopener</var> is true or <var>windowType</var> is "<code
78457+
data-x="">new with no opener</code>", then return null.</p></li>
7844778458

7844878459
<li>
7844978460
<p>Otherwise, if <var>new</var> is false, set <var>target browsing context</var>'s <span>opener

0 commit comments

Comments
 (0)