@@ -2654,6 +2654,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2654
2654
<li><dfn data-x="concept-request-history-navigation-flag" data-x-href="https://fetch.spec.whatwg.org/#concept-request-history-navigation-flag">history-navigation flag</dfn></li>
2655
2655
</ul>
2656
2656
</li>
2657
+ <li><dfn data-x="concept-header-list-get"
2658
+ data-x-href="https://fetch.spec.whatwg.org/#concept-header-list-get">Getting a header</dfn>
2659
+ from a header list.</li>
2657
2660
</ul>
2658
2661
2659
2662
<p>The following terms are defined in <cite>Referrer Policy</cite>: <ref
@@ -4021,6 +4024,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
4021
4024
<li><dfn data-x-href="https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm">start an idle period algorithm</dfn></li>
4022
4025
</ul>
4023
4026
</dd>
4027
+
4028
+ <dt>Cross-Origin Embedder Policy</dt>
4029
+
4030
+ <dd>
4031
+ <p>The following feature is defined in <cite>Cross-Origin Embedder Policy</cite>: <ref
4032
+ spec=COEP></p>
4033
+
4034
+ <ul class="brief">
4035
+ <li><dfn data-x="cross-origin-embedder-policy"
4036
+ data-x-href="https://wicg.github.io/cross-origin-embedder-policy/#embedder-policy">embedder
4037
+ policy</dfn></li>
4038
+ </ul>
4039
+ </dd>
4040
+
4024
4041
</dl>
4025
4042
4026
4043
<hr>
@@ -8986,6 +9003,11 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
8986
9003
data-x="concept-document-module-map">module map</dfn>, which is a <span>module map</span>,
8987
9004
initially empty.</p>
8988
9005
9006
+ <p>The <code>Document</code> has a <dfn data-dfn-for="Document"
9007
+ data-x="concept-document-coop">cross-origin opener policy</dfn>, which is a
9008
+ <span data-x="cross-origin-opener-policy">cross-origin opener policy</span>,
9009
+ initially "<code data-x="">unsafe-none</code>".</p>
9010
+
8989
9011
<h4>The <code>DocumentOrShadowRoot</code> interface</h4>
8990
9012
8991
9013
<p><cite>DOM</cite> defines the <code data-x="DOM
@@ -76448,13 +76470,25 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
76448
76470
settings object">setting up a window environment settings object</span> given <var>realm
76449
76471
execution context</var> and <var>topLevelOrigin</var>.</p></li>
76450
76472
76473
+ <li><p>Let <var>COOP</var> be a <span
76474
+ data-x="cross-origin-opener-policy">cross-origin-opener-policy</span> with value "<code
76475
+ data-x="">unsafe-none</code>".</p></li>
76476
+
76477
+ <li><p>If <var>creator</var> is non-null, let <var>creatorOrigin</var> be its <span>origin</span>
76478
+ and let <var>creatorTopLevelOrigin</var> be its <span>top-level origin</span>. If
76479
+ <var>creatorOrigin</var> is <span>same origin</span> with <var>creatorTopLevelOrigin</var>, then
76480
+ set <var>COOP</var> to <var>creator</var>'s <span>top-level browsing context</span>'s
76481
+ <code>Document</code>'s <span data-x="concept-document-coop">cross-origin opener
76482
+ policy</span>.</p></li>
76483
+
76451
76484
<li><p>Let <var>document</var> be a new <code>Document</code>, marked as an <span data-x="HTML
76452
76485
documents">HTML document</span> in <span>quirks mode</span>, whose <span
76453
76486
data-x="concept-document-content-type">content type</span> is "<code data-x="">text/html</code>",
76454
76487
<span>origin</span> is <var>origin</var>, <span>active sandboxing flag set</span> is
76455
76488
<var>sandboxFlags</var>, <span data-x="concept-document-feature-policy">feature policy</span> is
76456
- <var>feature policy</var>, and which is both <span>ready for post-load tasks</span> and
76457
- <span>completely loaded</span> immediately.</p></li>
76489
+ <var>feature policy</var>, <span data-x="concept-document-coop">cross-origin opener policy</span>
76490
+ is <var>COOP</var>, and which is both <span>ready for post-load tasks</span> and <span>completely
76491
+ loaded</span> immediately.</p></li>
76458
76492
76459
76493
<li><p>Ensure that <var>document</var> has a single child <code>html</code> node, which itself
76460
76494
has two empty child nodes: a <code>head</code> element, and a <code>body</code> element.</p></li>
@@ -77002,6 +77036,13 @@ console.assert(iframeWindow.frameElement === null);
77002
77036
keys</span> to <span data-x="agent cluster">agent clusters</span>). User agents are responsible
77003
77037
for collecting agent clusters when it is deemed that nothing can access them anymore.</p>
77004
77038
77039
+ <p>A <span>browsing context group</span> has a <dfn data-x="bcg cross-origin
77040
+ isolated">cross-origin isolated</dfn> boolean. It is initially false.</p>
77041
+
77042
+ <p class="XXX">The impact of <span data-x="bcg cross-origin isolated">cross-origin
77043
+ isolated</span> is under discussion in <a href="https://github.com/whatwg/html/pull/4734">issue
77044
+ #4734</a>.</p>
77045
+
77005
77046
<p>To <dfn data-x="creating a new browsing context group">create a new browsing context
77006
77047
group</dfn>, run these steps:</p>
77007
77048
@@ -77300,6 +77341,27 @@ console.assert(iframeWindow.frameElement === null);
77300
77341
77301
77342
<dd>
77302
77343
<ol>
77344
+ <li>
77345
+ <p>If <var>current</var>'s <span>top-level browsing context</span>'s <span>active
77346
+ document</span>'s <span data-x="cross-origin-opener-policy">cross-origin opener
77347
+ policy</span> is "<code data-x="">same-origin</code>" or "<code
77348
+ data-x="">same-origin-plus-COEP</code>", then:</p>
77349
+
77350
+ <ol>
77351
+ <li><p>Let <var>currentDocument</var> be <var>current</var>'s
77352
+ <span>active document</span>.</p> </li>
77353
+
77354
+ <li>
77355
+ <p>If <var>currentDocument</var>'s <span>origin</span> is not <span>same origin</span>
77356
+ with <var>current</var>'s <span>top-level origin</span>, then set <var>noopener</var> to
77357
+ true and <var>name</var> to "<code data-x="">_blank</code>".</p>
77358
+
77359
+ <p class="note">In the presence of COOP, nested documents cross-origin with their
77360
+ top-level browsing context always set /noopener/.</p>
77361
+ </li>
77362
+ </ol>
77363
+ </li>
77364
+
77303
77365
<li><p>Set <var>new</var> to true.</p></li>
77304
77366
77305
77367
<li id="noopener"><p>If <var>noopener</var> is true, then set <var>chosen</var> to the result
@@ -79736,6 +79798,184 @@ interface <dfn>BarProp</dfn> {
79736
79798
79737
79799
79738
79800
79801
+ <h3>Cross-origin opener policy</h3>
79802
+
79803
+ <p>A <dfn data-x="cross-origin-opener-policy">cross-origin opener policy</dfn> restricts the set
79804
+ of <span data-x="browsing context">browsing contexts</span> which can live together in a single
79805
+ <span>browsing context group</span>. It has one of the following values, defaulting to "<code
79806
+ data-x="">unsafe-none</code>" unless otherwise specified:</p>
79807
+
79808
+ <dl>
79809
+ <dt>"<code data-x="">unsafe-none</code>"</dt>
79810
+
79811
+ <dd><p>The default value of the <span data-x="cross-origin-opener-policy">cross-origin opener
79812
+ policy</span>. <span data-x="document">Documents</span> with this policy can share their
79813
+ <span>browsing context group</span> with any other <span>document</span> that has the same
79814
+ policy, regardless of their <span>top-level origin</span>.</p></dd>
79815
+
79816
+ <dt>"<code data-x="">same-origin-allow-popups</code>"</dt>
79817
+
79818
+ <dd><p>When this policy is enabled, <span data-x="document">documents</span> will be placed in a
79819
+ new <span>browsing context group</span> when their opener's <span>top-level origin</span> is not
79820
+ same-origin with them. <span data-x="document">Documents</span> with this policy are still able
79821
+ to open cross-origin popups in their <span>browsing context group</span>.</p></dd>
79822
+
79823
+ <dt>"<code data-x="">same-origin</code>"</dt>
79824
+
79825
+ <dd><p>When this policy is enabled on a <span>document</span>, its <span>browsing context
79826
+ group</span> will only contain <span data-x="document">documents</span> with the same
79827
+ <span>top-level origin</span> and the same policy.</p></dd>
79828
+
79829
+ <dt>"<code data-x="">same-origin-plus-COEP</code>"</dt>
79830
+
79831
+ <dd>
79832
+ <p>This policy is meant to provide the highest degree of isolation to pages. When enabled on a
79833
+ <span>document</span>, its <span>browsing context group</span> will only contain
79834
+ <span data-x="document">documents</span> with the same <span>top-level origin</span> and the
79835
+ same policy. The <span>browsing context group</span> will also be <span data-x="bcg cross-origin
79836
+ isolated">cross-origin isolated</span>.</p>
79837
+
79838
+ <p class="note">"<code data-x="">same-origin-plus-COEP</code>" cannot be directly set via the
79839
+ `<code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code>` header, but
79840
+ results from a combination of setting both <code data-x="">Cross-Origin-Opener-Policy:
79841
+ same-origin</code> and <code data-x="">Cross-Origin-Embedder-Policy: require-corp</code>
79842
+ together.</p>
79843
+ </dd>
79844
+ </dl>
79845
+
79846
+ <p>To <dfn data-x="obtain-coop">obtain a cross-origin opener policy</dfn> from a <span
79847
+ data-x="concept-response">response</span> <var>response</var> and an <span>environment</span>
79848
+ <var>environment</var>:</p>
79849
+
79850
+ <ol>
79851
+ <li><p>Let <var>securityState</var> be the result of executing <span>Is environment
79852
+ settings object a secure context?</span> on <var>environment</var>.</p></li>
79853
+
79854
+ <li><p>If <var>securityState</var> is "<code data-x="">Not Secure</code>", then return "<code
79855
+ data-x="">unsafe-none</code>".</p> </li>
79856
+
79857
+ <li><p>Let <var>value</var> be the result of <span data-x="concept-header-list-get">getting
79858
+ </span> `<code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code>` from
79859
+ <var>response</var>'s <span data-x="concept-response-header-list">header list</span>.</p></li>
79860
+
79861
+ <li><p>If <var>value</var> is null, then return "<code data-x="">unsafe-none</code>".</p></li>
79862
+
79863
+ <li><p>Let <var>decodedValue</var> be the <span data-x="isomorphic decode">isomorphic
79864
+ decoding</span> of <var>value</var></p></li>
79865
+
79866
+ <li><p>If <var>decodedValue</var> is not "<code data-x="">same-origin</code>" or "<code
79867
+ data-x="">same-origin-allow-popups</code>", then return "<code
79868
+ data-x="">unsafe-none</code>".</p></li>
79869
+
79870
+ <li><p>If <var>decodedValue</var> is "<code data-x="">same-origin</code>", then:</p>
79871
+
79872
+ <ol>
79873
+ <li><p>Let <var>COEP</var> be the result of obtaining a <span
79874
+ data-x="cross-origin-embedder-policy">cross-origin embedder policy</span> from
79875
+ <var>response</var>.</p></li>
79876
+
79877
+ <li><p>If <var>COEP</var> is "<code data-x="">require-corp</code>", then return "<code
79878
+ data-x="">same-origin-plus-COEP</code>".</p></li>
79879
+ </ol>
79880
+ </li>
79881
+
79882
+ <li><p>Return <var>decodedValue</var></p></li>
79883
+ </ol>
79884
+
79885
+ <p>To <dfn data-x="matching-coop">match cross-origin opener policies</dfn>, given a <span
79886
+ data-x="cross-origin-opener-policy">COOP</span> <var>A</var>, an <span>origin</span>
79887
+ <var>originA</var>, a <span data-x="cross-origin-opener-policy">COOP</span> <var>B</var> and an
79888
+ <span>origin</span> <var>originB</var>:</p>
79889
+
79890
+ <ol>
79891
+ <li><p>If <var>A</var> is "<code data-x="">unsafe-none</code>" and <var>B</var> is "<code
79892
+ data-x="">unsafe-none</code>", then return true.</p></li>
79893
+
79894
+ <li><p>If <var>A</var> or <var>B</var> is "<code data-x="">unsafe-none</code>", then return
79895
+ false.</p></li>
79896
+
79897
+ <li><p>If <var>A</var> is the same value as <var>B</var> and
79898
+ <var>originA</var> is <span>same origin</span> with <var>originB</var>, then
79899
+ return true.</p></li>
79900
+
79901
+ <li><p>Return false.</p></li>
79902
+ </ol>
79903
+
79904
+ <p>To <dfn data-x="obtain-browsing-context-navigation">obtain a browsing context to use for a
79905
+ navigation response</dfn>, given a <span data-x="concept-response">response</span>
79906
+ <var>response</var>, a <span data-x="browsing context">browsing context</span>
79907
+ <var>browsingContext</var>, a <span>sandboxing flag set</span> <var>sandboxFlags</var>, two <span
79908
+ data-x="origin">origins</span> <var>incumbentNavigationOrigin</var>,
79909
+ <var>activeDocumentNavigationOrigin</var>, and a <span
79910
+ data-x="cross-origin-opener-policy">cross-origin opener policy</span>
79911
+ <var>responseCOOP</var>:</p>
79912
+
79913
+ <ol>
79914
+ <li><p>Let <var>activeDocumentCOOP</var> be the <span data-x="concept-document-coop">
79915
+ cross-origin opener policy</span> of <var>currentBrowsingContext</var>'s <span>active
79916
+ document</span>.</p></li>
79917
+
79918
+ <li><p>If the result of <span data-x="matching-coop">matching</span>
79919
+ <var>activeDocumentCOOP</var>, <var>activeDocumentNavigationOrigin</var>,
79920
+ <var>responseCOOP</var> and <var>incumbentNavigationOrigin</var> is true, return
79921
+ <var>browsingContext</var>.</p></li>
79922
+
79923
+ <li>
79924
+ <p>If all of the following are true:</p>
79925
+
79926
+ <ul>
79927
+ <li><p><var>currentBrowsingContext</var>'s only entry in its <span>session history</span> is
79928
+ the <code>about:blank</code> <code>Document</code> that was added when
79929
+ <var>browsingContext</var> was <span data-x="creating a new browsing
79930
+ context">created</span>.</p></li>
79931
+
79932
+ <li><p><var>activeDocumentCOOP</var> is "<code
79933
+ data-x="">same-origin-allow-popups</code>".</p></li>
79934
+
79935
+ <li><p><var>responseCOOP</var> is "<code data-x="">unsafe-none</code>".</p></li>
79936
+ </ul>
79937
+
79938
+ <p>then return <var>browsingContext</var>.</p>
79939
+ </li>
79940
+
79941
+ <li><p>Let <var>newBrowsingContextGroup</var> be the result of <span>creating a new
79942
+ browsing context group</span>.</p></li>
79943
+
79944
+ <li><p>If <var>responseCOOP</var> is "<code data-x="">same-origin-plus-COEP</code>", then set
79945
+ <var>newBrowsingContextGroup</var> <span data-x="bcg cross-origin isolated">cross-origin
79946
+ isolated</span> to true.</p></li>
79947
+
79948
+ <li><p>Let <var>newBrowsingContext</var> be the result of <span data-x="creating a new browsing
79949
+ context">creating a new browsingContext</span> in <var>newBrowsingContextGroup</var>.</p></li>
79950
+
79951
+ <li>
79952
+ <p>If <var>sandboxFlags</var> is not empty, then:</p>
79953
+ <ol>
79954
+ <li><p>Assert <var>responseCOOP</var> is "<code data-x="">unsafe-none</code>".</p></li>
79955
+
79956
+ <li><p>Set <var>newBrowsingContext</var>'s <span>sandboxing flag set</span> to
79957
+ <var>sandboxFlags</var>.</p></li>
79958
+ </ol>
79959
+ </li>
79960
+
79961
+ <li>
79962
+ <p><span data-x="a browsing context is discarded">Discard</span>
79963
+ <var>currentBrowsingContext</var>.</p>
79964
+
79965
+ <p class="note">This does not close <var>currentBrowsingContext</var>'s <span>browsing context
79966
+ group</span> except if it was the sole top-level browsing context in which case it could be
79967
+ collected</p>
79968
+ </li>
79969
+
79970
+ <li><p>Return <var>newBrowsingContext</var>.</p></li>
79971
+ </ol>
79972
+
79973
+ <p class="XXX">The impact of swapping browsing context groups following a navigation is not
79974
+ defined. It is currently under discussion in <a
79975
+ href="https://github.com/whatwg/html/issues/5350">issue 5350</a>.</p>
79976
+
79977
+
79978
+
79739
79979
<h3 split-filename="history" id="history">Session history and navigation</h3>
79740
79980
79741
79981
<h4>The session history of browsing contexts</h4>
@@ -82091,6 +82331,45 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
82091
82331
</div>
82092
82332
</li>
82093
82333
82334
+ <li><p>Let <var>incumbentCOOP</var> be "<code data-x="">unsafe-none</code>".</p></li>
82335
+
82336
+ <li><p>If <var>browsingContext</var> is a <span>top-level browsing context</span>, then:</p>
82337
+
82338
+ <ol>
82339
+ <li><p>Set <var>incumbentCOOP</var> to the <span
82340
+ data-x="cross-origin-opener-policy">cross-origin opener policy</span> <span
82341
+ data-x="obtain-coop">obtained</span> given <var>response</var> and
82342
+ <var>reservedEnvironment</var>.</p></li>
82343
+
82344
+ <li>
82345
+ <p>If <var>sandboxFlags</var> is not empty and <var>incumbentCOOP</var> is not "<code
82346
+ data-x="">unsafe-none</code>", then <span data-x="navigate-ua-inline">display the inline
82347
+ content with an appropriate error shown to the user</span>, with the newly created
82348
+ <code>Document</code> object's <span>origin</span> set to a new <span
82349
+ data-x="concept-origin-opaque">opaque origin</span>, run the <span data-x="environment
82350
+ discarding steps">environment discarding steps</span> for <var>reservedEnvironment</var>, and
82351
+ return.</p>
82352
+
82353
+ <p class="note">This results in a network error as one cannot simultaneously provide a clean
82354
+ slate to a response using cross-origin opener policy and sandbox the result of navigating to
82355
+ that response.</p>
82356
+ </li>
82357
+
82358
+ <li><p>Let <var>newBrowsingContext</var> be the value of <span
82359
+ data-x="obtain-browsing-context-navigation">obtaining a browsing context for the navigation
82360
+ response</span> given <var>response</var>, <var>browsingContext</var>, <var>sandboxFlags</var>,
82361
+ <var>incumbentNavigationOrigin</var>, <var>activeDocumentNavigationOrigin</var>, and
82362
+ <var>incumbentCOOP</var>.</p></li>
82363
+
82364
+ <li><p>Let <var>browsingContextSwitch</var> be false.</p></li>
82365
+
82366
+ <li><p>If <var>newBrowsingContext</var> is not equal to <var>browsingContext</var>, then set
82367
+ <var>browsingContextSwitch</var> to true.</p></li>
82368
+
82369
+ <li><p>Set <var>browsingContext</var> to the value of <var>newBrowsingContext</var>.</p></li>
82370
+ </ol>
82371
+ </li>
82372
+
82094
82373
<li><p>If <var>browsingContext</var>'s only entry in its <span>session history</span> is the
82095
82374
initial <code>about:blank</code> <code>Document</code> that was added when
82096
82375
<var>browsingContext</var> was <span data-x="creating a new browsing context">created</span>, and
@@ -82134,8 +82413,9 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
82134
82413
data-x="concept-document-type">type</span> is <var>type</var>, <span
82135
82414
data-x="concept-document-content-type">content type</span> is <var>contentType</var>,
82136
82415
<span>origin</span> is <var>origin</var>, <span data-x="concept-document-feature-policy">feature
82137
- policy</span> is <var>featurePolicy</var>, and <span>active sandboxing flag set</span> is
82138
- <var>finalSandboxFlags</var>.</p></li>
82416
+ policy</span> is <var>featurePolicy</var>, <span>active sandboxing flag set</span> is
82417
+ <var>finalSandboxFlags</var>, and <span data-x="concept-document-coop">cross-origin opener
82418
+ policy</span> is <var>incumbentCOOP</var>.</p></li>
82139
82419
82140
82420
<li id="set-the-document's-address"><p>If <var>request</var> is non-null, then set
82141
82421
<var>document</var>'s <span data-x="concept-document-url">URL</span> to <var>request</var>'s
@@ -115745,6 +116025,27 @@ interface <dfn>External</dfn> {
115745
116025
115746
116026
</div>
115747
116027
116028
+ <h3>`<dfn><code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code></dfn>`</h3>
116029
+
116030
+ <p>This section describes a header for registration in the Permanent Message Header Field
116031
+ Registry. <ref spec=RFC3864></p>
116032
+
116033
+ <dl>
116034
+ <dt>Header field name:</dt>
116035
+ <dd>Cross-Origin-Opener-Policy</dd>
116036
+ <dt>Applicable protocol:</dt>
116037
+ <dd>http</dd>
116038
+ <dt>Status:</dt>
116039
+ <dd>standard</dd>
116040
+ <dt>Author/Change controller:</dt>
116041
+ <dd>WHATWG</dd>
116042
+ <dt>Specification document(s):</dt>
116043
+ <dd>
116044
+ This document is the relevant specification.
116045
+ </dd>
116046
+ <dt>Related information:</dt>
116047
+ <dd>None.</dd>
116048
+ </dl>
115748
116049
115749
116050
115750
116051
<h2 split-filename="indices" id="index" class="no-num">Index</h2>
@@ -120276,6 +120577,10 @@ INSERT INTERFACES HERE
120276
120577
<dt id="refsCOMPUTABLE">[COMPUTABLE]</dt>
120277
120578
<dd>(Non-normative) <cite><a href="http://www.turingarchive.org/browse.php/B/12">On computable numbers, with an application to the Entscheidungsproblem</a></cite>, A. Turing. In <cite>Proceedings of the London Mathematical Society</cite>, series 2, volume 42, pages 230-265. London Mathematical Society, 1937.</dd>
120278
120579
120580
+ <dt id="refsCOEP">[COEP]</dt>
120581
+ <dd><cite><a href="https://wicg.github.io/cross-origin-embedder-policy/">Cross-Origin Embedder Policy</a></cite>, M.
120582
+ West.</dd>
120583
+
120279
120584
<dt id="refsCOOKIES">[COOKIES]</dt>
120280
120585
<dd><cite><a href="https://tools.ietf.org/html/rfc6265">HTTP State Management Mechanism</a></cite>, A. Barth. IETF.</dd>
120281
120586
0 commit comments