Skip to content

Commit 0c98215

Browse files
author
clamy
committed
Merge branch 'issue-4580' of https://github.com/camillelamy/html
2 parents 916a923 + 065b8c9 commit 0c98215

File tree

1 file changed

+273
-5
lines changed

1 file changed

+273
-5
lines changed

source

+273-5
Original file line numberDiff line numberDiff line change
@@ -2750,6 +2750,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
27502750
<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>
27512751
</ul>
27522752
</li>
2753+
<li><dfn data-x="concept-header-list-get"
2754+
data-x-href="https://fetch.spec.whatwg.org/#concept-header-list-get">Getting a header</dfn>
2755+
from a header list.</li>
27532756
</ul>
27542757

27552758
<p>The following terms are defined in <cite>Referrer Policy</cite>: <ref
@@ -4143,6 +4146,19 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
41434146
</ul>
41444147
</dd>
41454148

4149+
<dt>Cross-Origin Embedder Policy</dt>
4150+
4151+
<dd>
4152+
<p>The following feature is defined in <cite>Cross-Origin Embedder Policy</cite>: <ref
4153+
spec=COEP></p>
4154+
4155+
<ul class="brief">
4156+
<li><dfn data-x="cross-origin-embedder-policy"
4157+
data-x-href="https://mikewest.github.io/corpp/#embedder-policy"><code>Cross-Origin Embedder
4158+
Policy</code></dfn></li>
4159+
</ul>
4160+
</dd>
4161+
41464162
</dl>
41474163

41484164
<hr>
@@ -9356,6 +9372,11 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
93569372
data-x="concept-document-module-map">module map</dfn>, which is a <span>module map</span>,
93579373
initially empty.</p>
93589374

9375+
<p>The <code>Document</code> has a <dfn data-dfn-for="Document"
9376+
data-x="concept-document-coop">cross-origin opener policy</dfn>, which is a
9377+
<span data-x="cross-origin-opener-policy">cross-origin opener policy</span>,
9378+
initially "<code data-x="">unsafe-none</code>.</p>
9379+
93599380
<h4>The <code>DocumentOrShadowRoot</code> interface</h4>
93609381

93619382
<p><cite>DOM</cite> defines the <code data-x="DOM
@@ -79322,13 +79343,24 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7932279343
settings object">setting up a window environment settings object</span> given <var>realm
7932379344
execution context</var> and <var>topLevelOrigin</var>.</p></li>
7932479345

79346+
<li><p>Let <var>COOP</var> be a <span
79347+
data-x="cross-origin-opener-policy">cross-origin-opener-policy</span> with value "<code
79348+
data-x="">unsafe-none</code>".</p></li>
79349+
79350+
<li><p>If <var>creator</var> is non-null and <var>creator</var> is
79351+
<span>same origin</span> with its <span>top-level browsing context</span>'s
79352+
<code>Document</code>, then set <var>COOP</var> to <var>creator</var>'s
79353+
<span>top-level browsing context</span>'s <code>Document</code>'s <span
79354+
data-x="concept-document-coop">cross-origin opener policy</span>.</p></li>
79355+
7932579356
<li><p>Let <var>document</var> be a new <code>Document</code>, marked as an <span data-x="HTML
7932679357
documents">HTML document</span> in <span>quirks mode</span>, whose <span
7932779358
data-x="concept-document-content-type">content type</span> is "<code data-x="">text/html</code>",
7932879359
<span>origin</span> is <var>origin</var>, <span>active sandboxing flag set</span> is
7932979360
<var>sandboxFlags</var>, <span data-x="concept-document-feature-policy">feature policy</span> is
79330-
<var>feature policy</var>, and which is both <span>ready for post-load tasks</span> and
79331-
<span>completely loaded</span> immediately.</p></li>
79361+
<var>feature policy</var>, <span data-x="concept-document-coop">cross-origin opener policy</span>
79362+
is <var>COOP</var>, and which is both <span>ready for post-load tasks</span> and <span>completely
79363+
loaded</span> immediately.</p></li>
7933279364

7933379365
<li><p>Ensure that <var>document</var> has a single child <code>html</code> node, which itself
7933479366
has two empty child nodes: a <code>head</code> element, and a <code>body</code> element.</p></li>
@@ -79879,6 +79911,10 @@ console.assert(iframeWindow.frameElement === null);
7987979911
keys</span> to <span data-x="agent cluster">agent clusters</span>). User agents are responsible
7988079912
for collecting agent clusters when it is deemed that nothing can access them anymore.</p>
7988179913

79914+
<p>A <span>browsing context group</span> has a <dfn data-x="cross-origin-isolated">cross-origin
79915+
isolated</dfn> boolean. It is initially false. When it is true, the <span>agent cluster map</span>
79916+
will be keyed using <span data-x="origin">origins</span>.</p>
79917+
7988279918
<p>To <dfn data-x="creating a new browsing context group">create a new browsing context
7988379919
group</dfn>, run these steps:</p>
7988479920

@@ -80177,6 +80213,23 @@ console.assert(iframeWindow.frameElement === null);
8017780213

8017880214
<dd>
8017980215
<ol>
80216+
<li>
80217+
<p>If <var>current</var>'s <span>top-level browsing context</span>'s <span>active
80218+
document</span>'s <span data-x="cross-origin-opener-policy">cross-origin opener
80219+
policy</span> is "<code data-x="">same-origin</code>" or "<code
80220+
data-x="">same-origin-plus-COEP</code>", then:</p>
80221+
80222+
<ol>
80223+
<li><p>Let <var>currentDocument</var> be <var>current</var>'s
80224+
<span>active document</span>.</p> </li>
80225+
80226+
<li><p>If <var>currentDocument</var>'s <span>origin</span> is not <span>same origin</span>
80227+
with <var>current</var>'s <span>top-level browsing context</span>'s
80228+
<span>active document</span> 's <span>origin</span>, then set <var>noopener</var> to
80229+
true.</p></li>
80230+
</ol>
80231+
</li>
80232+
8018080233
<li><p>Set <var>new</var> to true.</p></li>
8018180234

8018280235
<li id="noopener"><p>If <var>noopener</var> is true, then set <var>chosen</var> to the result
@@ -82720,6 +82773,155 @@ interface <dfn>BarProp</dfn> {
8272082773

8272182774

8272282775

82776+
<h3>Cross-origin opener policy</h3>
82777+
82778+
<p>A <dfn data-x="cross-origin-opener-policy">cross-origin opener policy</dfn> restricts the set
82779+
of <span data-x="browsing context">browsing contexts</span> which can live together in a single
82780+
<span>browsing context group</span>. It has one of the following values, defaulting to "<code
82781+
data-x="">unsafe-none</code>" unless otherwise specified:</p>
82782+
82783+
<ul>
82784+
<li><p>"<code data-x="">same-origin-plus-COEP</code>"</p></li>
82785+
82786+
<li><p>"<code data-x="">same-origin</code>"</p></li>
82787+
82788+
<li><p>"<code data-x="">same-origin-allow-popups</code>"</p></li>
82789+
82790+
<li><p>"<code data-x="">unsafe-none</code>"</p></li>
82791+
82792+
<li><p class="note">"<code data-x="">same-origin-plus-COEP</code>" cannot be directly set via the
82793+
`<code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code>` header, but
82794+
results from a combination of setting both <code data-x="">Cross-Origin-Opener-Policy: same-origin</code>
82795+
and <code data-x="">Cross-Origin-Embedder-Policy: require-corp</code> together.
82796+
</ul>
82797+
82798+
<p>To <dfn data-x="obtain-coop">obtain a cross-origin opener policy</dfn> from a <span
82799+
data-x="concept-response">response</span> <var>response</var> and an <span>environment</span>
82800+
<var>environment</var>:</p>
82801+
82802+
<ol>
82803+
<li><p>Let <var>securityState</var> be the result of executing <span>Is environment
82804+
settings object a secure context?</span> on <var>environment</var>.</p></li>
82805+
82806+
<li><p>If <var>securityState</var> is "<code data-x="">Not Secure</code>", then return "<code
82807+
data-x="">unsafe-none</code>".</p> </li>
82808+
82809+
<li><p>Let <var>value</var> be the result of <span data-x="concept-header-list-get">getting
82810+
</span> `<code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code>` from
82811+
<var>response</var>'s <span data-x="concept-response-header-list">header list</span>.</p></li>
82812+
82813+
<li><p>If <var>value</var> is null, then return "<code data-x="">unsafe-none</code>".</p></li>
82814+
82815+
<li><p>Let <var>decodedValue</var> be the <span data-x="isomorphic decode">isomorphic
82816+
decoding</span> of <var>value</var></p></li>
82817+
82818+
<li><p>If <var>decodedValue</var> is not "<code data-x="">same-origin</code>" or "<code
82819+
data-x="">same-origin-allow-popups</code>", then return "<code
82820+
data-x="">unsafe-none</code>".</p></li>
82821+
82822+
<li><p>If <var>decodedValue</var> is "<code data-x="">same-origin</code>", then:</p>
82823+
82824+
<ol>
82825+
<li><p>Let <var>coep</var> be the result of obtaining a <span
82826+
data-x="cross-origin-embedder-policy">cross-origin embedder policy</span> from
82827+
<var>response</var>.</p></li>
82828+
82829+
<li><p>If <var>coep</var> is "<code data-x="">require-corp</code>", then return "<code
82830+
data-x="">same-origin-plus-COEP</code>".</p></li>
82831+
</ol>
82832+
</li>
82833+
82834+
<li><p>Return <var>decodedValue</var></p></li>
82835+
</ol>
82836+
82837+
<p>To <dfn data-x="matching-coop">match cross-origin opener policies</dfn>, given a <span
82838+
data-x="cross-origin-opener-policy">COOP</span> <var>A</var>, an <span>origin</span>
82839+
<var>originA</var>, a <span data-x="cross-origin-opener-policy">COOP</span> <var>B</var> and an
82840+
<span>origin</span> <var>originB</var>:</p>
82841+
82842+
<ol>
82843+
<li><p>If <var>A</var> is "<code data-x="">unsafe-none</code>" and <var>B</var> is "<code
82844+
data-x="">unsafe-none</code>", then return true.</p></li>
82845+
82846+
<li><p>If <var>A</var> or <var>B</var> is "<code data-x="">unsafe-none</code>", then return
82847+
false.</p></li>
82848+
82849+
<li><p>If <var>A</var> is the same value as <var>B</var> and
82850+
<var>originA</var> is <span>same origin</span> with <var>originB</var>, then
82851+
return true.</p></li>
82852+
82853+
<li><p>Return false.</p></li>
82854+
</ol>
82855+
82856+
<p>To <dfn data-x="obtain-browsing-context-navigation">obtain a browsing context to use for a
82857+
navigation response</dfn>, given a <span data-x="concept-response">response</span>
82858+
<var>response</var>, a <span data-x="browsing context">browsing context</span>
82859+
<var>browsingContext</var>, a <span>sandboxing flag set</span> <var>sandboxFlags</var>, two <span
82860+
data-x="origin">origins</span> <var>incumbentNavigationOrigin</var>,
82861+
<var>activeDocumentNavigationOrigin</var>,and a <span
82862+
data-x="cross-origin-opener-policy">cross-origin opener policy</span>
82863+
<var>responseCOOP</var>:</p>
82864+
82865+
<ol>
82866+
<li><p>Let <var>activeDocumentCOOP</var> be the <span data-x="concept-document-coop">
82867+
cross-origin opener policy</span> of <var>currentBrowsingContext</var>'s <span>active
82868+
document</span> .</p></li>
82869+
82870+
<li><p>If the result of <span data-x="matching-coop">matching</span>
82871+
<var>activeDocumentCOOP</var>, <var>activeDocumentNavigationOrigin</var>,
82872+
<var>responseCOOP</var> and <var>incumbentNavigationOrigin</var> is true, return
82873+
<var>browsingContext</var>.</p></li>
82874+
82875+
<li>
82876+
<p>If all of the following are true:</p>
82877+
82878+
<ul>
82879+
<li><p><var>currentBrowsingContext</var>'s only entry in its <span>session history</span> is
82880+
the <code>about:blank</code> <code>Document</code> that was added when
82881+
<var>browsingContext</var> was <span data-x="creating a new browsing
82882+
context">created</span>.</p></li>
82883+
82884+
<li><p><var>activeDocumentCOOP</var> is "<code
82885+
data-x="">same-origin-allow-popups</code>".</p></li>
82886+
82887+
<li><p><var>responseCOOP</var> is "<code data-x="">unsafe-none</code>".</p></li>
82888+
</ul>
82889+
82890+
<p>then return <var>browsingContext</var>.</p>
82891+
</li>
82892+
82893+
<li><p>Let <var>newBrowsingContextGroup</var> be the result of <span>creating a new
82894+
browsing context group</span>.</p></li>
82895+
82896+
<li><p>If <var>responseCOOP</var> is "<code data-x="">same-origin-plus-COEP</code>", then set
82897+
<var>newBrowsingContextGroup</var> <span data-x="cross-origin-isolated">cross-origin
82898+
isolated</span> to true.</p></li>
82899+
82900+
<li><p>Let <var>newBrowsingContext</var> be the result of <span data-x="creating a new browsing
82901+
context">creating a new browsingContext</span> in <var>newBrowsingContextGroup</var>.</p></li>
82902+
82903+
<li>
82904+
<p>If <var>sandboxFlags</var> is not empty, then:</p>
82905+
<ol>
82906+
<li><p>Assert <var>responseCOOP</var> is "<code data-x="">unsafe-none</code>".</p></li>
82907+
82908+
<li><p>Set <var>newBrowsingContext</var>'s <span>sandboxing flag set</span> to
82909+
<var>sandboxFlags</var>.</p></li>
82910+
</ol>
82911+
</li>
82912+
82913+
<li>
82914+
<p><span data-x="a browsing context is discarded">Discard</span>
82915+
<var>currentBrowsingContext</var>.</p>
82916+
82917+
<p class="note">This does not close <var>currentBrowsingContext</var>'s <span>browsing context
82918+
group</span> except if it was the sole top-level browsing context in which case it could be
82919+
collected</p>
82920+
</li>
82921+
82922+
<li><p>Return <var>newBrowsingContext</var>.</p></li>
82923+
</ol>
82924+
8272382925
<h3 split-filename="history" id="history">Session history and navigation</h3>
8272482926

8272582927
<h4>The session history of browsing contexts</h4>
@@ -85117,11 +85319,51 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8511785319
</div>
8511885320
</li>
8511985321

85322+
<li><p>Let <var>incumbentCOOP</var> be "<code data-x="">unsafe-none</code>".</p></li>
85323+
85324+
<li><p>If <var>browsingContext</var> is a top-level <span data-x="browsing context">browsing
85325+
context</span>, then:</p>
85326+
85327+
<ol>
85328+
<li><p>Set <var>incumbentCOOP</var> be the <span
85329+
data-x="cross-origin-opener-policy">cross-origin opener policy</span> <span
85330+
data-x="obtain-coop">obtained</span> given <var>response</var> and
85331+
<var>reservedEnvironment</var>.</p></li>
85332+
85333+
<li>
85334+
<p>If <var>sandboxFlags</var> is not empty and <var>incumbentCOOP</var> is not "<code
85335+
data-x="">unsafe-none</code>", then <span data-x="navigate-ua-inline">display the inline
85336+
content with an appropriate error shown to the user</span>, with the newly created
85337+
<code>Document</code> object's <span>origin</span> set to a new <span
85338+
data-x="concept-origin-opaque">opaque origin</span>, run the <span data-x="environment
85339+
discarding steps">environment discarding steps</span> for <var>reservedEnvironment</var>, and
85340+
return.</p>
85341+
85342+
<p class="note">This results in a network error as one cannot simultaneously provide a clean
85343+
slate to a response using cross-origin opener policy and sandbox the result of navigating to
85344+
that response.</p>
85345+
</li>
85346+
85347+
<li><p>Let <var>newBrowsingContext</var> be the value of <span
85348+
data-x="obtain-browsing-context-navigation">obtaining a browsing context for the navigation
85349+
response</span> given <var>response</var>, <var>browsingContext</var>, <var>sandboxFlags</var>,
85350+
<var>incumbentNavigationOrigin</var>, <var>activeDocumentNavigationOrigin</var>, and
85351+
<var>incumbentCOOP</var>.</p></li>
85352+
85353+
<li><p>Let <var>browsingContextSwitch</var> be false.</p></li>
85354+
85355+
<li><p>If <var>newBrowsingContext</var> is not equal to <var>browsingContext</var>, then set
85356+
<var>browsingContextSwitch</var> to true.</p></li>
85357+
85358+
<li><p>Set <var>browsingContext</var> to the value of <var>newBrowsingContext</var>.</p></li>
85359+
</ol>
85360+
</li>
85361+
8512085362
<li><p>If <var>browsingContext</var>'s only entry in its <span>session history</span> is the
8512185363
<code>about:blank</code> <code>Document</code> that was added when <var>browsingContext</var> was
8512285364
<span data-x="creating a new browsing context">created</span>, and navigation is occurring with
8512385365
<span>replacement enabled</span>, and that <code>Document</code> has the <span>same origin</span>
85124-
as <var>origin</var>, then do nothing.</p></li>
85366+
as <var>origin</var>, and <var>browsingContextSwitch</var> is false, then do nothing.</p></li>
8512585367

8512685368
<li>
8512785369
<p>Otherwise:</p>
@@ -85163,8 +85405,9 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8516385405
data-x="concept-document-type">type</span> is <var>type</var>, <span
8516485406
data-x="concept-document-content-type">content type</span> is <var>contentType</var>,
8516585407
<span>origin</span> is <var>origin</var>, <span data-x="concept-document-feature-policy">feature
85166-
policy</span> is <var>featurePolicy</var>, and <span>active sandboxing flag set</span> is
85167-
<var>finalSandboxFlags</var>.</p></li>
85408+
policy</span> is <var>featurePolicy</var>, <span>active sandboxing flag set</span> is
85409+
<var>finalSandboxFlags</var>, and <span data-x="concept-document-coop">cross-origin opener
85410+
policy</span> is <var>incumbentCOOP</var>.</p></li>
8516885411

8516985412
<li id="set-the-document's-address"><p>If <var>request</var> is non-null, then set
8517085413
<var>document</var>'s <span data-x="concept-document-url">URL</span> to <var>request</var>'s
@@ -120192,6 +120435,27 @@ interface <dfn>External</dfn> {
120192120435

120193120436
</div>
120194120437

120438+
<h3>`<dfn><code data-x="http-cross-origin-opener-policy">Cross-Origin-Opener-Policy</code></dfn>`</h3>
120439+
120440+
<p>This section describes a header for registration in the Permanent Message Header Field
120441+
Registry. <ref spec=RFC3864></p>
120442+
120443+
<dl>
120444+
<dt>Header field name:</dt>
120445+
<dd>Cross-Origin-Opener-Policy</dd>
120446+
<dt>Applicable protocol:</dt>
120447+
<dd>http</dd>
120448+
<dt>Status:</dt>
120449+
<dd>standard</dd>
120450+
<dt>Author/Change controller:</dt>
120451+
<dd>WHATWG</dd>
120452+
<dt>Specification document(s):</dt>
120453+
<dd>
120454+
This document is the relevant specification.
120455+
</dd>
120456+
<dt>Related information:</dt>
120457+
<dd>None.</dd>
120458+
</dl>
120195120459

120196120460

120197120461
<h2 split-filename="indices" id="index" class="no-num">Index</h2>
@@ -124725,6 +124989,10 @@ INSERT INTERFACES HERE
124725124989
<dt id="refsCOMPUTABLE">[COMPUTABLE]</dt>
124726124990
<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>
124727124991

124992+
<dt id="refsCOEP">[COEP]</dt>
124993+
<dd><cite><a href="https://mikewest.github.io/corpp/">Cross-Origin Embedder Policy</a></cite>, M.
124994+
West.</dd>
124995+
124728124996
<dt id="refsCOOKIES">[COOKIES]</dt>
124729124997
<dd><cite><a href="https://tools.ietf.org/html/rfc6265">HTTP State Management Mechanism</a></cite>, A. Barth. IETF.</dd>
124730124998

0 commit comments

Comments
 (0)