diff --git a/source b/source index 7790765471f..420ccc60cb5 100644 --- a/source +++ b/source @@ -2955,6 +2955,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute constructing callback functions
  • overload resolution algorithm
  • exposed
  • +
  • global names of an interface
  • a promise resolved with
  • a promise rejected with
  • wait for all
  • @@ -3137,7 +3138,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The HostLoadImportedModule abstract operation
  • The HostMakeJobCallback abstract operation
  • The HostPromiseRejectionTracker abstract operation
  • -
  • The InitializeHostDefinedRealm abstract operation
  • +
  • The MakeRealm abstract operation
  • The IsArrayBufferViewOutOfBounds abstract operation
  • The IsAccessorDescriptor abstract operation
  • The IsCallable abstract operation
  • @@ -96290,14 +96291,14 @@ interface Origin { is not "blob":

      -
    1. Assert: workerGlobalScope's owner set's size is 1.

    2. +
    3. Assert: workerGlobalScope's relevant settings + object's owner set's size is 1.

    4. Set workerGlobalScope's policy container to a clone of workerGlobalScope's owner - set[0]'s relevant settings object's policy container.

    5. + data-x="clone a policy container">clone of workerGlobalScope's relevant + settings object's owner set[0]'s relevant settings object's + policy container.

    @@ -97800,17 +97801,19 @@ interface BarProp {

    To set up a window environment settings object, given a URL - creationURL, a JavaScript execution context execution context, + creationURL, a JavaScript execution context executionContext, null or an environment reservedEnvironment, a URL - topLevelCreationURL, and an origin topLevelOrigin, run these - steps:

    + topLevelCreationURL, and an origin topLevelOrigin:

      -
    1. Let realm be the value of execution context's Realm - component.

    2. +
    3. +

      Let realm be executionContext's Realm component.

      -
    4. Let window be realm's global - object.

    5. +

      This algorithm is invoked before realm's global object is allocated. The closures defined below read + the global object lazily when they are invoked, by which time the realm has been fully + wired.

      +
    6. Let settings object be a new environment settings object whose @@ -97818,33 +97821,30 @@ interface BarProp {

      The realm execution context
      -
      -

      Return execution context.

      -
      +

      Return executionContext.

      The module map
      -
      -

      Return the module map of - window's associated - Document.

      -
      +

      Return realm's global object's + associated Document's module map.

      The API base URL
      -
      -

      Return the current base URL of window's - associated Document.

      -
      +

      Return realm's global object's + associated Document's base URL.

      The origin
      -
      -

      Return the origin of window's - associated Document.

      -
      +

      Return realm's global object's + associated Document's origin.

      The has cross-site ancestor
        +
      1. Let window be realm's global object.

      2. +
      3. If window's navigable's parent is null, then return false.

      4. @@ -97866,11 +97866,9 @@ interface BarProp {
      The policy container
      -
      -

      Return the policy container of - window's associated - Document.

      -
      +

      Return the policy container of + realm's global object's associated Document.

      The cross-origin isolated capability
      @@ -97878,21 +97876,23 @@ interface BarProp {

      Return true if both of the following hold, and false otherwise:

      • realm's agent cluster's cross-origin-isolation mode is "cross-origin isolation mode is "concrete", and

      • -
      • window's associated - Document is allowed to use the "

        realm's global object's associated Document is + allowed to use the "cross-origin-isolated" feature.

      The time origin
      -
      -

      Return window's associated - Document's load timing info's navigation start - time.

      -
      +

      Return realm's global object's + associated Document's load + timing info's navigation start time.

      + +
      The global names
      +

      Return Window's global names.

    7. @@ -104386,7 +104386,7 @@ interface NotRestoredReasons {
      "sharedworker"
      This Document was in the owner set of a - SharedWorkerGlobalScope. + SharedWorkerGlobalScope's relevant settings object.

      User agents that support the back/forward cache for documents using shared workers can use more specific reasons such as NotRestoredReasons {

      "sharedworker-message"
      While the page was stored in back/forward cache, a message was - received from a SharedWorkerGlobalScope whose owner set contains this Document.
      + received from a SharedWorkerGlobalScope whose relevant settings + object's owner set contains this + Document.
      "sharedworker-with-no-active-client"
      This Document was in the owner set of a - SharedWorkerGlobalScope that is not actively - needed.
      + SharedWorkerGlobalScope's relevant settings object that is not + actively needed.
      "smartcardconnection"
      The Document had an active SmartCardConnection while NotRestoredReasons { data-x="obtain-similar-origin-window-agent">obtaining a similar-origin window agent given origin, group, and false.

      -
    8. -

      Let realm execution context be the result of creating a new realm - given agent and the following customizations:

      - -
        -
      • For the global object, create a new Window object.

      • - -
      • For the global this binding, use browsingContext's - WindowProxy object.

      • -
      -
    9. -
    10. Let topLevelCreationURL be about:blank if embedder is null; otherwise embedder's relevant settings object's top-level creation URL.

    11. @@ -106075,9 +106064,25 @@ interface NotRestoredReasons { otherwise embedder's relevant settings object's top-level origin.

      -
    12. Set up a window environment settings object with about:blank, - realm execution context, null, topLevelCreationURL, and - topLevelOrigin.

    13. +
    14. +

      Let customizations be the following abstract closure given a + JavaScript execution context executionContext:

      + +
        +
      1. Set up a window environment settings object with + about:blank, executionContext, null, + topLevelCreationURL, and topLevelOrigin.

      2. + +
      3. Let window be a new Window object created in + executionContext's Realm component.

      4. + +
      5. Return « window, browsingContext's WindowProxy + object ».

      6. +
      +
    15. + +
    16. Let executionContext be the result of creating a new realm + given agent and customizations.

    17. Let loadTimingInfo be a new document load timing info with its navigation start time set to the result of calling coarsen time @@ -112947,21 +112952,6 @@ location.href = '#foo'; browsingContext's group, and requestsOAC.

    18. -
    19. -

      Let realmExecutionContext be the result of creating a new realm - given agent and the following customizations:

      - -
        -
      • For the global object, create a new Window object.

      • - -
      • For the global this binding, use browsingContext's - WindowProxy object.

      • -
      -
    20. - -
    21. Set window to the global - object of realmExecutionContext's Realm component.

    22. -
    23. Let topLevelCreationURL be creationURL.

    24. Let topLevelOrigin be navigationParams's

    -
  • Set up a window environment settings object with creationURL, - realmExecutionContext, navigationParams's reserved environment, - topLevelCreationURL, and topLevelOrigin.

  • +
  • +

    Let customizations be the following abstract closure given a + JavaScript execution context executionContext:

    + +
      +
    1. Set up a window environment settings object with creationURL, + executionContext, navigationParams's reserved environment, + topLevelCreationURL, and topLevelOrigin.

    2. + +
    3. Let newWindow be a new Window object created in + executionContext's Realm component.

    4. + +
    5. Return « newWindow, browsingContext's WindowProxy + object ».

    6. +
    +
  • + +
  • Let executionContext be the result of creating a new + realm given agent and customizations.

  • + +
  • Set window to the global + object of executionContext's Realm component.

  • This is the usual case, where the new Document we're about to @@ -113991,9 +114000,9 @@ new PaymentRequest(…); // Allowed to use data-x="she-document-state">document state's document to null.

    -
  • Remove document from the - owner set of each WorkerGlobalScope object whose set contains document.

  • +
  • Remove document from the owner + set of each WorkerGlobalScope object's relevant settings object + whose set contains document.

  • For each workletGlobalScope in document's worklet global @@ -117026,6 +117035,15 @@ new PaymentRequest(…); // Allowed to use for="environment settings object">time origin

    A number used as the baseline for performance-related timestamps. HRT
    + +
    A global names
    +

    A set of identifiers (strings), corresponding to the global + names of the global object's + interface. Used by Web IDL to determine which constructs are exposed in the realm, including during the realm's creation.

    @@ -117130,26 +117148,30 @@ new PaymentRequest(…); // Allowed to use

    To create a new - realm in an agent agent, optionally with instructions to create a - global object or a global this binding (or both), the following steps are taken:

    + realm in an agent agent, given an abstract closure + customizations taking a JavaScript execution context and returning a + list containing an object (the global object) and an object or null (the global + this binding):

      -
    1. Perform InitializeHostDefinedRealm() - with the provided customizations for creating the global object and the global this - binding.

    2. -
    3. -

      Let realm execution context be the running JavaScript execution - context.

      +

      Let executionContext be MakeRealm(customizations).

      -

      This is the JavaScript execution context created in the previous - step.

      +

      customizations runs at the point during realm initialization when the + realm record exists (with its intrinsics), but its [[GlobalObject]] is not yet set. The closure + is expected to set up the realm's environment settings object (writing the realm's + [[HostDefined]] field) and then construct the global object and global this binding, + returning them. Doing the environment settings object setup before global + allocation is necessary so that Web IDL's is exposed check + can be answered during global allocation: the exposure check reads the environment + settings object's global + names, secure context status, and cross-origin isolated + capability, none of which require the global object to exist yet.

    4. -
    5. Remove realm execution context from the JavaScript execution context - stack.

    6. - -
    7. Let realm be realm execution context's Realm component.

    8. +
    9. Let realm be executionContext's Realm component.

    10. If agent's agent cluster's .

    11. -
    12. Return realm execution context.

    13. +
    14. Return executionContext.

    @@ -117757,16 +117779,17 @@ document.querySelector("button").addEventListener("click", bound);

    If environment is an environment settings object:

      -
    1. Let global be environment's global object.

    2. +
    3. Let globalNames be environment's global names.

    4. -

      If global is a WorkerGlobalScope: +

      If globalNames contains + "Worker":

      1. -

        If global's owner set[0]'s relevant settings object - is a secure context, then return true.

        +

        If environment's owner set[0]'s relevant settings + object is a secure context, then return true.

        We only need to check the 0th item since they will necessarily all be consistent.

        @@ -117777,7 +117800,8 @@ document.querySelector("button").addEventListener("click", bound);
      2. -

        If global is a WorkletGlobalScope, then return true.

        +

        If globalNames contains + "Worklet", then return true.

        Worklets can only be created in secure contexts.

      3. @@ -132071,11 +132095,11 @@ interface mixin AnimationFrameProvider {
        • provider is a Window.

        • -
        • provider's owner set contains - a Document object.

        • +
        • provider's relevant settings object's owner set contains a Document object.

        • Any of the DedicatedWorkerGlobalScope objects in provider's - owner set are relevant settings object's owner set are supported.

    @@ -134863,13 +134887,15 @@ interface WorkerGlobalScope : EventTarget {
    -

    A WorkerGlobalScope object has an associated owner set (a - set of Document and WorkerGlobalScope objects). It is - initially empty and populated when the worker is created or obtained.

    +

    A worker environment settings object has an + associated owner set (a set of Document + and WorkerGlobalScope items). It is set when the worker + environment settings object is set up.

    -

    It is a set, instead of a single owner, to accommodate - SharedWorkerGlobalScope objects.

    +

    It is a set, instead of a single owner, to accommodate shared + workers (SharedWorkerGlobalScope).

    A WorkerGlobalScope object has an associated type ("classic" or "WorkerGlobalScope : EventTarget { data-x="concept-WorkerGlobalScope-module-map">module map. It is a module map, initially empty.

    -

    A WorkerGlobalScope object has an associated cross-origin isolated - capability boolean. It is initially false.

    -
    @@ -135214,13 +135236,13 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope data-x="concept-SharedWorkerGlobalScope-extended-lifetime">extended lifetime is false, then return false.

  • -
  • If global's owner set is - empty, but has been empty for less than the user agent's extended lifetime shared - worker timeout, then return true.

  • +
  • If global's relevant settings object's owner set + is empty, but has been empty for less than the user agent's + extended lifetime shared worker timeout, then return true.

  • For each owner of global's - owner set:

    + relevant settings object's owner set:

    1. @@ -135235,7 +135257,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
    2. For each owner of global's - owner set:

      + relevant settings object's owner set:

      1. If owner is a Document and the amount of time that @@ -135261,7 +135283,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope

      2. For each owner of global's - owner set:

        + relevant settings object's owner set:

        1. If owner is a Document, and owner is fully @@ -135305,8 +135327,8 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope worker">permissible if the following algorithm returns true:

            -
          1. If global's owner set is not empty, then return true.

          2. +
          3. If global's relevant settings object's owner set is + not empty, then return true.

          4. If global is in extended lifetime, then return true.

          5. @@ -135317,9 +135339,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
            • global is a SharedWorkerGlobalScope;

            • -
            • global's owner set has been empty for no more than the user agent's between-loads shared worker - timeout; and

              +
            • global's relevant settings object's owner set has + been empty for no more than the user agent's + between-loads shared worker timeout; and

            • the user agent has a navigable whose active document is not completely loaded,

            • @@ -135440,36 +135462,43 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope agent">obtaining a dedicated/shared worker agent given outside settings and is shared. Run the rest of these steps in that agent.

              +
            • Let globalScopeType be SharedWorkerGlobalScope if is + shared is true; otherwise DedicatedWorkerGlobalScope.

            • + +
            • Let ownerSet be « owner ».

            • +
            • -

              Let realm execution context be the result of creating a new realm - given agent and the following customizations:

              +

              Let customizations be the following abstract closure given a + JavaScript execution context executionContext:

              -
                -
              • For the global object, if is shared is true, create a new - SharedWorkerGlobalScope object. Otherwise, create a new - DedicatedWorkerGlobalScope object.

              • -
              +
                +
              1. Let inside settings be the result of setting up a worker environment settings object with + executionContext, globalScopeType, url, outside + settings, ownerSet, and unsafeWorkerCreationTime.

              2. + +
              3. Let workerScope be a new object of type globalScopeType + created in executionContext's Realm component.

              4. + +
              5. Return « workerScope, null ».

              6. +
            • +
            • Let executionContext be the result of creating a new realm + given agent and customizations.

            • +
            • Let worker global scope be the global - object of realm execution context's Realm component. + object of executionContext's Realm component.

              This is the DedicatedWorkerGlobalScope or SharedWorkerGlobalScope object created in the previous step.

            • -
            • Set up a worker environment settings object with realm execution - context, outside settings, and unsafeWorkerCreationTime, and let - inside settings be the result.

            • -
            • Set worker global scope's name to options["name"].

            • -
            • Append owner to worker global - scope's owner set.

            • -
            • If is shared is true:

              @@ -135573,34 +135602,6 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope settings, and response is false, then set response to a network error.

            • -
            • Set worker global scope's cross-origin isolated - capability to true if agent's agent cluster's cross-origin isolation mode is "concrete".

            • - -
            • If is shared is false and owner's cross-origin isolated - capability is false, then set worker global scope's cross-origin isolated - capability to false.

            • - -
            • -

              If is shared is false and response's - url's scheme is "data", then set - worker global scope's cross-origin isolated - capability to false.

              - -

              This is a conservative default for now, while we figure out how workers in - general, and data: URL workers in particular (which are - cross-origin from their owner), will be treated in the context of permissions policies. See - w3c/webappsec-permissions-policy - issue #207 for more details.

              -
            • -
            • Run processCustomFetchResponse with response and bodyBytes.

          @@ -135720,7 +135721,8 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
        2. Empty - worker global scope's owner set.

        3. + worker global scope's relevant settings object's owner + set.

      @@ -135798,19 +135800,26 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope

      To set up a worker environment settings object, given a JavaScript execution - context execution context, an environment settings object - outside settings, and a number unsafeWorkerCreationTime:

      + context executionContext, an interface globalScopeType, a + URL workerURL, an environment settings object outside + settings, a set ownerSet of Document and + WorkerGlobalScope items, and a number unsafeWorkerCreationTime:

        -
      1. Let realm be the value of execution context's Realm - component.

      2. +
      3. +

        Let realm be executionContext's Realm component.

        + +

        This algorithm is invoked before realm's global object is allocated. The closures defined below read + the global object lazily when they are invoked, by which time the realm has been fully + wired.

        +
      4. -
      5. Let worker global scope be realm's global object.

      6. +
      7. Let globalNames be globalScopeType's global + names.

      8. Let origin be a unique opaque origin if worker global scope's - url's opaque origin if workerURL's scheme is "data"; otherwise outside settings's origin.

      9. @@ -135821,20 +135830,18 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
        The realm execution context
        -
        -

        Return execution context. -

        +

        Return executionContext.

        The module map
        -

        Return worker global scope's module map.

        +

        Return realm's global object's + module map.

        The API base URL
        -

        Return worker global scope's url.

        +

        Return realm's global object's + url.

        The origin
        @@ -135848,8 +135855,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope data-x="concept-settings-object-has-cross-site-ancestor">has cross-site ancestor is true, then return true.

        -
      10. If worker global scope's url's

        If workerURL's scheme is "data", then return true.

      11. @@ -135858,35 +135864,67 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
        The policy container
        -
        -

        Return worker global scope's policy container.

        -
        +

        Return realm's global object's + policy container.

        The cross-origin isolated capability
        -

        Return worker global scope's cross-origin isolated - capability.

        +
        +
          +
        1. If realm's agent cluster's cross-origin isolation mode is not + "concrete", then return + false.

        2. + +
        3. +

          If globalNames contains + "DedicatedWorker":

          + +
            +
          1. If outside settings's cross-origin isolated + capability is false, then return false.

          2. + +
          3. If workerURL's scheme is + "data", then return false.

          4. +
          +
        4. + +
        5. Return true.

        6. +
        + +

        The data-URL downgrade preserves the existing conservative default for + data: URL workers. See w3c/webappsec-permissions-policy + issue #207. Using the request URL here (rather than the post-fetch response URL) is safe + because fetch errors on redirects to data: URLs.

        +
        The time origin

        Return the result of coarsening - unsafeWorkerCreationTime with worker global scope's cross-origin isolated + unsafeWorkerCreationTime with settings object's cross-origin isolated capability.

        + +
        The global names
        +

        Return globalNames.

      12. Set settings object's id to a new unique opaque string, creation URL to - worker global scope's url, top-level creation URL to null, + workerURL, top-level creation URL to null, target browsing context to null, and active service worker to null.

      13. -
      14. If worker global scope is a DedicatedWorkerGlobalScope object, - then set settings object's top-level origin to outside - settings's top-level origin.

      15. +
      16. Set settings object's owner set to ownerSet.

      17. + +
      18. If globalNames contains + "DedicatedWorker", then set settings object's + top-level origin to outside settings's + top-level origin.

      19. Otherwise, set settings object's top-level origin to an @@ -136324,7 +136362,8 @@ dictionary SharedWorkerOptions : WorkerOptionsinsidePort.

      20. Append the relevant owner to add given - outsideSettings to workerGlobalScope's owner set.

      21. + outsideSettings to workerGlobalScope's relevant settings + object's owner set.

    3. @@ -137035,22 +137074,31 @@ interface WorkletGlobalScope {};
      worklet agent given outsideSettings. Run the rest of these steps in that agent.

      +
    4. Let workletGlobalScopeType be worklet's worklet global + scope type.

    5. +
    6. -

      Let realmExecutionContext be the result of creating a new realm given - agent and the following customizations:

      +

      Let customizations be the following abstract closure given a + JavaScript execution context executionContext:

      -
        -
      • For the global object, create a new object of the type given by worklet's - worklet global scope type.

      • -
      +
        +
      1. Let insideSettings be the result of setting up a worklet environment settings object + given executionContext, workletGlobalScopeType, and + outsideSettings.

      2. + +
      3. Let workletScope be a new object of type workletGlobalScopeType + created in executionContext's Realm component.

      4. + +
      5. Return « workletScope, null ».

      6. +
    7. -
    8. Let workletGlobalScope be the global - object of realmExecutionContext's Realm component.

    9. +
    10. Let executionContext be the result of creating a new realm + given agent and customizations.

    11. -
    12. Let insideSettings be the result of setting up a worklet environment settings object given - realmExecutionContext and outsideSettings.

    13. +
    14. Let workletGlobalScope be the global + object of executionContext's Realm component.

    15. Let pendingAddedModules be a clone of worklet's added modules @@ -137151,10 +137199,20 @@ interface WorkletGlobalScope {};

      To set up a worklet environment settings object, given a JavaScript - execution context executionContext and an environment settings - object outsideSettings:

      + execution context executionContext, an interface + workletGlobalScopeType, and an environment settings object + outsideSettings:

        +
      1. +

        Let realm be executionContext's Realm component.

        + +

        This algorithm is invoked before realm's global object is allocated. The closures defined below read + the global object lazily when they are invoked, by which time the realm has been fully + wired.

        +
      2. +
      3. Let origin be a unique opaque origin.

      4. @@ -137165,11 +137223,8 @@ interface WorkletGlobalScope {};
        container">clone of outsideSettings's policy container.

        -
      5. Let realm be the value of executionContext's Realm - component.

      6. - -
      7. Let workletGlobalScope be realm's global object.

      8. +
      9. Let globalNames be workletGlobalScopeType's global + names.

      10. Let settingsObject be a new environment settings object whose @@ -137177,14 +137232,12 @@ interface WorkletGlobalScope {};

        The realm execution context
        -
        -

        Return executionContext.

        -
        +

        Return executionContext.

        The module map
        -

        Return workletGlobalScope's module map.

        +

        Return realm's global object's + module map.

        The API base URL
        @@ -137221,6 +137274,9 @@ interface WorkletGlobalScope {};

        Assert: this algorithm is never called, because the time origin is not available in a worklet context.

        + +
        The global names
        +

        Return globalNames.