diff --git a/source b/source index dd65f1d4592..564153d84ec 100644 --- a/source +++ b/source @@ -8002,13 +8002,24 @@ interface DOMStringList {

If ! IsSharedArrayBuffer(value) is true, then:

    +
  1. Let agentCluster be the surrounding agent's + agent cluster.

  2. + +
  3. +

    If agentCluster's cross-origin isolated is false, then throw a + "DataCloneError" DOMException.

    + +

    This check is only needed when serializing (and not when deserializing) as + cross-origin isolated cannot change over time and a + SharedArrayBuffer cannot leave an agent cluster.

    +
  4. +
  5. If forStorage is true, then throw a "DataCloneError" DOMException.

  6. Set serialized to { [[Type]]: "SharedArrayBuffer", [[ArrayBufferData]]: value.[[ArrayBufferData]], [[ArrayBufferByteLength]]: size, - [[AgentCluster]]: the current Realm Record's corresponding agent - cluster }.

  7. + [[AgentCluster]]: agentCluster }.

@@ -77229,10 +77240,6 @@ console.assert(iframeWindow.frameElement === null);

A browsing context group has a cross-origin isolated boolean. It is initially false.

-

The impact of cross-origin - isolated is under discussion in issue - #4734.

-

To create a new browsing context group, run these steps:

@@ -79650,6 +79657,9 @@ interface BarProp { a registrable domain suffix of and is not equal to effectiveDomain, then throw a "SecurityError" DOMException.

+
  • If the surrounding agent's agent cluster's cross-origin + isolated is true, then return.

  • +
  • Set this Document object's origin's domain to the result of parsing the given value.

  • @@ -86819,6 +86829,10 @@ interface ApplicationCache : EventTarget {

    Contains various Window objects which can potentially reach each other, either directly or by using document.domain.

    +

    If the encompassing agent cluster's cross-origin isolated is true, + then all the Window objects will be same origin, can reach each other + directly, and document.domain will no-op.

    +

    Two Window objects that are same origin can be in different similar-origin window agents, for instance if they are each in their own browsing context group.

    @@ -86897,6 +86911,9 @@ interface ApplicationCache : EventTarget { ensure that web developers see interoperable behavior with regard to shared memory, even in the face of varying and changing user agent process models.

    +

    An agent cluster has an associated cross-origin isolated (a boolean), + which is initially false.

    +

    @@ -86904,44 +86921,33 @@ interface ApplicationCache : EventTarget {

    The following defines the allocation of the agent clusters of similar-origin window agents.

    -

    An agent cluster key is a site.

    - -

    whatwg/html #4734 is - expected to widen agent cluster key (but not site) to encompass all - tuple origins.

    - -

    To obtain an agent cluster key, given an origin - origin, return the result of obtaining a site with - origin.

    +

    An agent cluster key is a site or tuple origin whose host's registrable domain is non-null. I.e., an + agent cluster key can be a scheme-and-registrable-domain or any + origin.

    To obtain a similar-origin window agent, given an origin origin and browsing context group group, run these steps:

      -
    1. Let clusterKey be the result of obtaining an agent cluster key given - origin.

    2. - -
    3. Let agentCluster be the result of obtaining a browsing context agent cluster with - group and clusterKey.

    4. - -
    5. Return the single similar-origin window agent contained in - agentCluster.

    6. -
    +
  • Let clusterKey be the result of obtaining a + site with origin.

  • -

    To obtain a browsing context agent cluster, - given a browsing context group group and agent cluster key - key, run these steps:

    +
  • If group's cross-origin + isolated is true, then set clusterKey to origin.

  • -
    1. If group's agent cluster map[key] does not exist, then:

      + exists">does not exist, then:

      +
      1. Let agentCluster be a new agent cluster.

      2. +
      3. Set agentCluster's cross-origin isolated to group's + cross-origin isolated.

      4. +
      5. Add the result of creating an agent, given false, to agentCluster.

      6. @@ -86950,7 +86956,8 @@ interface ApplicationCache : EventTarget {
    2. -
    3. Return group's agent cluster map[key].

    4. +
    5. Return the single similar-origin window agent contained in group's + agent cluster map[key].

    This means that there is only one similar-origin window agent per @@ -87304,6 +87311,26 @@ interface ApplicationCache : EventTarget { is not yet defined in the JavaScript specification; see tc39/ecma262#1357.

    +
  • +

    If agent's agent cluster's cross-origin isolated is + false, then:

    + +
      +
    1. Let global be realm's global + object.

    2. + +
    3. Let status be ! global.[[Delete]]("SharedArrayBuffer").

    4. + +
    5. Assert: status is true.

    6. +
    + +

    This is done for compatibility with web content and there is some hope that this + can be removed in the future. Web developers can still get at the constructor through + new WebAssembly.Memory({ shared:true, initial:0, maximum:0 + }).buffer.constructor.

    +
  • +
  • Return realm execution context.

  • @@ -92109,6 +92136,7 @@ interface mixin DocumentAndElementEventHandlers { interface mixin WindowOrWorkerGlobalScope { [Replaceable] readonly attribute USVString origin; readonly attribute boolean isSecureContext; + readonly attribute boolean crossOriginIsolated; // base64 utility methods DOMString btoa(DOMString data); @@ -92132,13 +92160,19 @@ interface mixin WindowOrWorkerGlobalScope {
    self . isSecureContext
    -

    Returns whether or not this global object represents a secure context.

    self . origin
    -

    Returns the global object's origin, serialized as string.

    + +
    self . crossOriginIsolated
    +

    Returns whether the surrounding agent's agent cluster is + cross-origin isolated. This depends on the `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy` HTTP response headers and determines whether + SharedArrayBuffer can be used with postMessage() + APIs.

    @@ -92169,6 +92203,10 @@ document.body.appendChild(frame) data-x="concept-settings-object-origin">origin, serialized.

    +

    The crossOriginIsolated getter steps + are to return the surrounding agent's agent cluster's cross-origin + isolated.

    +
    @@ -99061,6 +99099,17 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope { obtaining an embedder policy from response.

    +
  • +

    If worker global scope's embedder policy is "require-corp" and is shared is true, then set + agent's agent cluster's cross-origin isolated to + true.

    + +

    This really ought to be set when the agent cluster is created, which requires a + redesign of this section.

    +
  • +
  • If the result of checking a global object's embedder policy with worker global scope, owner, and response is false, then set response to a network