@@ -8002,13 +8002,24 @@ interface <dfn>DOMStringList</dfn> {
8002
8002
<p>If ! <span>IsSharedArrayBuffer</span>(<var>value</var>) is true, then:
8003
8003
8004
8004
<ol>
8005
+ <li><p>Let <var>agentCluster</var> be the <span>surrounding agent</span>'s
8006
+ <span>agent cluster</span>.</p></li>
8007
+
8008
+ <li>
8009
+ <p>If <var>agentCluster</var>'s <span>cross-origin isolated</span> is false, then throw a
8010
+ <span>"<code>DataCloneError</code>"</span> <code>DOMException</code>.</p>
8011
+
8012
+ <p class="note">This check is only needed when serializing (and not when deserializing) as
8013
+ <span>cross-origin isolated</span> cannot change over time and a
8014
+ <code>SharedArrayBuffer</code> cannot leave an <span>agent cluster</span>.</p>
8015
+ </li>
8016
+
8005
8017
<li><p>If <var>forStorage</var> is true, then throw a
8006
8018
<span>"<code>DataCloneError</code>"</span> <code>DOMException</code>.</p></li>
8007
8019
8008
8020
<li><p>Set <var>serialized</var> to { [[Type]]: "SharedArrayBuffer", [[ArrayBufferData]]:
8009
8021
<var>value</var>.[[ArrayBufferData]], [[ArrayBufferByteLength]]: <var>size</var>,
8010
- [[AgentCluster]]: the <span>current Realm Record</span>'s corresponding <span>agent
8011
- cluster</span> }.</p></li>
8022
+ [[AgentCluster]]: <var>agentCluster</var> }.</p></li>
8012
8023
</ol>
8013
8024
</li>
8014
8025
@@ -77229,10 +77240,6 @@ console.assert(iframeWindow.frameElement === null);
77229
77240
<p>A <span>browsing context group</span> has a <dfn data-x="bcg cross-origin
77230
77241
isolated">cross-origin isolated</dfn> boolean. It is initially false.</p>
77231
77242
77232
- <p class="XXX">The impact of <span data-x="bcg cross-origin isolated">cross-origin
77233
- isolated</span> is under discussion in <a href="https://github.com/whatwg/html/pull/4734">issue
77234
- #4734</a>.</p>
77235
-
77236
77243
<p>To <dfn data-x="creating a new browsing context group">create a new browsing context
77237
77244
group</dfn>, run these steps:</p>
77238
77245
@@ -79650,6 +79657,9 @@ interface <dfn>BarProp</dfn> {
79650
79657
a registrable domain suffix of and is not equal to</span> <var>effectiveDomain</var>, then throw
79651
79658
a <span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p></li>
79652
79659
79660
+ <li><p>If the <span>surrounding agent</span>'s <span>agent cluster</span>'s <span>cross-origin
79661
+ isolated</span> is true, then return.</p></li>
79662
+
79653
79663
<li><p>Set this <code>Document</code> object's <span>origin</span>'s <span
79654
79664
data-x="concept-origin-domain">domain</span> to the result of <span data-x="host
79655
79665
parser">parsing</span> the given value.</p></li>
@@ -86819,6 +86829,10 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86819
86829
<p>Contains various <code>Window</code> objects which can potentially reach each other, either
86820
86830
directly or by using <code data-x="dom-document-domain">document.domain</code>.</p>
86821
86831
86832
+ <p>If the encompassing <span>agent cluster</span>'s <span>cross-origin isolated</span> is true,
86833
+ then all the <code>Window</code> objects will be <span>same origin</span>, can reach each other,
86834
+ and <code data-x="dom-document-domain">document.domain</code> will no-op.</p>
86835
+
86822
86836
<p class="note">Two <code>Window</code> objects that are <span>same origin</span> can be in
86823
86837
different <span data-x="similar-origin window agent">similar-origin window agents</span>, for
86824
86838
instance if they are each in their own <span>browsing context group</span>.</p>
@@ -86897,51 +86911,44 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86897
86911
ensure that web developers see interoperable behavior with regard to shared memory, even in the
86898
86912
face of varying and changing user agent process models.</p>
86899
86913
86914
+ <p>An <span>agent cluster</span> has an associated <dfn>cross-origin isolated</dfn> (a boolean),
86915
+ which is initially false.</p>
86916
+
86917
+
86900
86918
<div w-nodev>
86901
86919
86902
86920
<hr>
86903
86921
86904
86922
<p>The following defines the allocation of the <span data-x="agent cluster">agent clusters</span>
86905
86923
of <span data-x="similar-origin window agent">similar-origin window agents</span>.</p>
86906
86924
86907
- <p>An <dfn>agent cluster key</dfn> is a <span>site</span>.</p>
86908
-
86909
- <p class="XXX"><a href="https://github.com/whatwg/html/pull/4734">whatwg/html #4734</a> is
86910
- expected to widen <span>agent cluster key</span> (but not <span>site</span>) to encompass all
86911
- <span data-x="concept-origin-tuple">tuple origins</span>.</p>
86912
-
86913
- <p>To <dfn data-x="obtain-agent-cluster-key">obtain an agent cluster key</dfn>, given an origin
86914
- <var>origin</var>, return the result of <span data-x="obtain a site">obtaining a site</span> with
86915
- <var>origin</var>.</p>
86925
+ <p>An <dfn>agent cluster key</dfn> is a <span>site</span> or <span
86926
+ data-x="concept-origin-tuple">tuple origin</span> whose <span
86927
+ data-x="concept-origin-host">host</span>'s <span>registrable domain</span> is non-null. I.e., an
86928
+ <span>agent cluster key</span> can be any <span>origin</span>.</p>
86916
86929
86917
86930
<p>To <dfn data-x="obtain-similar-origin-window-agent">obtain a similar-origin window agent</dfn>,
86918
86931
given an <span>origin</span> <var>origin</var> and <span>browsing context group</span>
86919
86932
<var>group</var>, run these steps:</p>
86920
86933
86921
86934
<ol>
86922
- <li><p>Let <var>clusterKey</var> be the result of <span
86923
- data-x="obtain-agent-cluster-key" data-export="">obtaining an agent cluster key</span> given
86924
- <var>origin</var>.</p></li>
86925
-
86926
- <li><p>Let <var>agentCluster</var> be the result of <span
86927
- data-x="obtain-browsing-agent-cluster">obtaining a browsing context agent cluster</span> with
86928
- <var>group</var> and <var>clusterKey</var>.</p></li>
86935
+ <li><p>Let <var>clusterKey</var> be the result of <span data-x="obtain a site">obtaining a
86936
+ site</span> with <var>origin</var>.</p></li>
86929
86937
86930
- <li><p>Return the single <span>similar-origin window agent</span> contained in
86931
- <var>agentCluster</var>.</p></li>
86932
- </ol>
86933
-
86934
- <p>To <dfn data-x="obtain-browsing-agent-cluster">obtain a browsing context agent cluster</dfn>,
86935
- given a <span>browsing context group</span> <var>group</var> and <span>agent cluster key</span>
86936
- <var>key</var>, run these steps:</p>
86938
+ <li><p>If <var>group</var>'s <span data-x="bcg cross-origin isolated">cross-origin
86939
+ isolated</span> is true, then set <var>clusterKey</var> to <var>origin</var>.</p></li>
86937
86940
86938
- <ol>
86939
86941
<li>
86940
86942
<p>If <var>group</var>'s <span>agent cluster map</span>[<var>key</var>] <span data-x="map
86941
86943
exists">does not exist, then:</span></p>
86944
+
86942
86945
<ol>
86943
86946
<li><p>Let <var>agentCluster</var> be a new <span>agent cluster</span>.</p></li>
86944
86947
86948
+ <li><p>If <var>group</var>'s <span data-x="bcg cross-origin isolated">cross-origin
86949
+ isolated</span> is true, then set <var>agentCluster</var>'s <span>cross-origin isolated</span>
86950
+ to true.</p></li>
86951
+
86945
86952
<li><p>Add the result of <span data-x="create an agent">creating an agent</span>, given false,
86946
86953
to <var>agentCluster</var>.</p></li>
86947
86954
@@ -86950,7 +86957,8 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86950
86957
</ol>
86951
86958
</li>
86952
86959
86953
- <li><p>Return <var>group</var>'s <span>agent cluster map</span>[<var>key</var>].</p></li>
86960
+ <li><p>Return the single <span>similar-origin window agent</span> contained in <var>group</var>'s
86961
+ <span>agent cluster map</span>[<var>key</var>].</p></li>
86954
86962
</ol>
86955
86963
86956
86964
<p class="note">This means that there is only one <span>similar-origin window agent</span> per
@@ -87304,6 +87312,19 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
87304
87312
is not yet defined in the JavaScript specification; see <a
87305
87313
href="https://github.com/tc39/ecma262/issues/1357">tc39/ecma262#1357</a>.</span></p></li>
87306
87314
87315
+ <li><p>Let <var>crossOriginIsolated</var> be <var>agent</var>'s <span>agent cluster</span>'s
87316
+ <span>cross-origin isolated</span>.</p></li>
87317
+
87318
+ <li>
87319
+ <p>If <var>crossOriginIsolated</var> is false, then remove the own property with name "<code
87320
+ data-x="">SharedArrayBuffer</code>" from <var>realm</var>'s <span>global object</span>.</p>
87321
+
87322
+ <p class="note">This is done for compatibility with web content and there is some hope that this
87323
+ can be removed in the future. Web developers can still get at the constructor through
87324
+ <code data-x="">new WebAssembly.Memory({ shared:true, initial:0, maximum:0
87325
+ }).buffer.constructor</code>.</p>
87326
+ </li>
87327
+
87307
87328
<li><p>Return <var>realm execution context</var>.</p></li>
87308
87329
</ol>
87309
87330
@@ -92109,6 +92130,7 @@ interface mixin <dfn>DocumentAndElementEventHandlers</dfn> {
92109
92130
interface mixin <dfn>WindowOrWorkerGlobalScope</dfn> {
92110
92131
[Replaceable] readonly attribute USVString <span data-x="dom-origin">origin</span>;
92111
92132
readonly attribute boolean <span data-x="dom-isSecureContext">isSecureContext</span>;
92133
+ readonly attribute boolean <span data-x="dom-crossOriginIsolated">crossOriginIsolated</span>;
92112
92134
92113
92135
// base64 utility methods
92114
92136
DOMString <span data-x="dom-btoa">btoa</span>(DOMString data);
@@ -92132,13 +92154,21 @@ interface mixin <dfn>WindowOrWorkerGlobalScope</dfn> {
92132
92154
92133
92155
<dl class="domintro">
92134
92156
<dt>self . <code subdfn data-x="dom-isSecureContext">isSecureContext</code></dt>
92135
-
92136
92157
<dd><p>Returns whether or not this global object represents a <span>secure context</span>. <ref
92137
92158
spec=SECURE-CONTEXTS></p></dd>
92138
92159
92139
92160
<dt>self . <code subdfn data-x="dom-origin">origin</code></dt>
92140
-
92141
92161
<dd><p>Returns the global object's <span>origin</span>, serialized as string.</p></dd>
92162
+
92163
+ <dt>self . <code subdfn data-x="dom-crossOriginIsolated">crossOriginIsolated</code></dt>
92164
+ <dd>
92165
+ <p>Returns the <span>surrounding agent</span>'s <span>agent cluster</span>'s <span>cross-origin
92166
+ isolated</span>.</p>
92167
+
92168
+ <p>(This value depends on the <code data-x="">Cross-Origin-Opener-Policy</code> and <code
92169
+ data-x="">Cross-Origin-Embedder-Policy</code> HTTP response headers and determines whether
92170
+ <code>SharedArrayBuffer</code> can be used with <code data-x="">postMessage()</code> APIs.)</p>
92171
+ </dd>
92142
92172
</dl>
92143
92173
92144
92174
<div class="example">
@@ -92169,6 +92199,10 @@ document.body.appendChild(frame)</code></pre>
92169
92199
data-x="concept-settings-object-origin">origin</span>, <span data-x="serialization of an
92170
92200
origin">serialized</span>.</p>
92171
92201
92202
+ <p>The <dfn data-x="dom-crossOriginIsolated"><code>crossOriginIsolated</code></dfn> attribute's
92203
+ getter must return the <span>surrounding agent</span>'s <span>agent cluster</span>'s
92204
+ <span>cross-origin isolated</span>.</p>
92205
+
92172
92206
</div>
92173
92207
92174
92208
@@ -99061,6 +99095,17 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
99061
99095
<span data-x="obtain an embedder policy">obtaining an embedder policy</span> from
99062
99096
<var>response</var>.</p></li>
99063
99097
99098
+ <li>
99099
+ <p>If <var>worker global scope</var>'s <span
99100
+ data-x="concept-WorkerGlobalScope-embedder-policy">embedder policy</span> is "<code
99101
+ data-x="coep-require-corp">require-corp</code>" and <var>is shared</var> is true, then set
99102
+ <var>agent</var>'s <span>agent cluster</span>'s <span>cross-origin isolated</span> to
99103
+ true.</p>
99104
+
99105
+ <p class="XXX">This really ought to be set when the agent cluster is created, which requires a
99106
+ redesign of this section.</p>
99107
+ </li>
99108
+
99064
99109
<li><p>If the result of <span data-x="check a global object's embedder policy">checking a
99065
99110
global object's embedder policy</span> with <var>worker global scope</var>, <var>owner</var>,
99066
99111
and <var>response</var> is false, then set <var>response</var> to a <span>network
0 commit comments