diff --git a/source b/source index 4d8cb26a588..53df0cae46c 100644 --- a/source +++ b/source @@ -2569,6 +2569,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • connection pool
  • obtain a connection
  • determine the network partition key
  • +
  • as a body
  • response and its @@ -14750,24 +14751,34 @@ interface HTMLLinkElement : HTMLElement {
  • Fetch request with processResponseConsumeBody set to the following steps - given response response:

    + given response response and null, failure, or + a byte sequence bodyBytes:

    1. Finalize and report timing with response, el's node document's relevant global object, and initiatorType.

    2. +
    3. Let success be true.

    4. +
    5. -

      If response is a network error or its status is not an ok - status, set success to false.

      +

      If either of the following conditions are met:

      + +
        +
      • bodyBytes is null or failure; or

      • + +
      • response's status is not an + ok status,

      • +
      + +

      then set success to false.

      Note that content-specific errors, e.g., CSS parse errors or PNG decoding errors, do not affect success.

    6. -

      If success is true, wait for the link +

      Otherwise, wait for the link resource's critical subresources to finish loading.

      The specification that defines a link type's critical subresources @@ -14777,8 +14788,8 @@ interface HTMLLinkElement : HTMLElement { be fetched and processed, with the expectation that this will be done correctly.

    7. -
    8. Process the linked resource given el, - success, and response.

    9. +
    10. Process the linked resource given el, success, + response, and bodyBytes.

  • @@ -14834,9 +14845,10 @@ interface HTMLLinkElement : HTMLElement {

    Similar to the fetch and process the linked resource algorithm, all external resource links have a process the linked resource algorithm which takes a link element el, boolean - success, and response response. - Individual link types may provide their own process the linked resource algorithm, - but unless explicitly stated, that algorithm does nothing.

    + success, a response response, and a + byte sequence bodyBytes. Individual link types may provide their own + process the linked resource algorithm, but unless explicitly stated, that algorithm + does nothing.

    Unless otherwise specified for a given rel keyword, the element must delay the load event of the element's node document until @@ -25551,15 +25563,16 @@ document.body.appendChild(wbr);

    To process this type of linked resource given - a link element el, boolean success, and response response:

    + a link element el, boolean success, response response, and byte sequence + bodyBytes:

    1. If response's Content-Type metadata is not a JSON MIME type, then set success to false.

    2. -
    3. If success is true, then process the manifest given el - and response.

    4. +
    5. If success is true, then process the manifest given el, + response, and bodyBytes.

    The process a link header steps for this type of linked resource are to do @@ -26212,13 +26225,13 @@ document.body.appendChild(wbr);

    Fetch request, with processResponseConsumeBody set to the following steps given a response response and null, failure, - or a byte sequence bytesOrNull:

    + or a byte sequence bodyBytes:

    1. -

      If bytesOrNull is a byte sequence, then set response's - body to the first return value of safely extracting bytesOrNull.

      +

      If bodyBytes is a byte sequence, then set response's + body to bodyBytes as a + body.

      By using processResponseConsumeBody, we have extracted the entire link element is currently render-blocking.

      To process this type of linked resource - given a link element el, boolean success, and response response, the user agent must run these - steps:

      + given a link element el, boolean success, response response, and byte sequence + bodyBytes:

    2. If performFetch was given, run performFetch with request, - true, and with processResponse as defined below.

      + true, and with processResponseConsumeBody as defined below.

      Otherwise, fetch request with processResponseConsumeBody set to - processResponse as defined below.

      + processResponseConsumeBody as defined below.

      -

      In both cases, let processResponse given response response be the following algorithm:

      +

      In both cases, let processResponseConsumeBody given response response and null, failure, or a byte + sequence bodyBytes be the following algorithm:

      1. Finalize and report timing with response, fetch client @@ -93196,8 +93204,7 @@ document.querySelector("button").addEventListener("click", bound);

        If either of the following conditions are met:

          -
        • response's type is "error"; or

        • +
        • bodyBytes is null or failure; or

        • response's status is not an ok status,

        • @@ -93226,8 +93233,7 @@ document.querySelector("button").addEventListener("click", bound);
        • Let source text be the result of UTF-8 - decoding response's body.

        • + decoding bodyBytes.

        • Let script be the result of creating a classic script using source text, script settings object, response's

          To fetch a classic worker-imported script given a url, a - settings object, and an optional synchronous perform the fetch hook - performFetch, run these steps. The algorithm will synchronously complete with a - classic script on success, or throw an exception on failure.

          + settings object, and an optional perform + the fetch hook performFetch, run these steps. The algorithm will synchronously + complete with a classic script on success, or throw an exception on failure.

            +
          1. Let response be null.

          2. + +
          3. Let bodyBytes be null.

          4. +
          5. Let request be a new request whose URL is url, client is settings object, destination is "script", parser metadata is "not - parser-inserted", synchronous flag is set, and whose - use-URL-credentials flag is set.

          6. + parser-inserted", and whose use-URL-credentials flag is set.

          7. -

            If performFetch was given, let response be the result of running - performFetch given request and true.

            +

            If performFetch was given, run performFetch with request, + isTopLevel, and with processResponseConsumeBody as defined below.

            + +

            Otherwise, fetch request with processResponseConsumeBody set to + processResponseConsumeBody as defined below.

            -

            Otherwise, let response be the result of fetching request.

            +

            In both cases, let processResponseConsumeBody given response res and null, failure, or a + byte sequence bb be the following algorithm:

            + +
              +
            1. Set bodyBytes to bb.

            2. + +
            3. Set response to res.

            4. +
            +
          8. + +
          9. +

            Pause until response is not null.

            Unlike other algorithms in this section, the fetching process is synchronous here.

            @@ -93274,8 +93298,7 @@ document.querySelector("button").addEventListener("click", bound);

            If any of the following conditions are met:

              -
            • response's type is "error"; or

            • +
            • bodyBytes is null or failure;

            • response's status is not an ok status; or

            • @@ -93289,7 +93312,7 @@ document.querySelector("button").addEventListener("click", bound);
            • Let source text be the result of UTF-8 - decoding response's body.

            • + decoding bodyBytes.

            • Let muted errors be true if response was CORS-cross-origin, and false otherwise.

            • @@ -93445,12 +93468,12 @@ document.querySelector("button").addEventListener("click", bound);

              To fetch a worklet script graph given a url, a fetch client settings object, a destination, a credentials mode, a module map settings - object, a module responses map, and an onComplete algorithm, - fetch a worklet/module worker script graph given url, fetch client - settings object, destination, credentials mode, module map - settings object, onComplete, and the following asynchronous perform - the fetch hook given request and processCustomFetchResponse:

              + object, a moduleResponsesMap, and an onComplete algorithm, fetch + a worklet/module worker script graph given url, fetch client settings + object, destination, credentials mode, module map settings + object, onComplete, and the following perform the fetch hook given request and + processCustomFetchResponse:

              1. Let requestURL be request's queue a task on the networking task source to proceed with running the following steps.

              2. -
              3. If moduleResponsesMap[requestURL] exists, then run processCustomFetchResponse with - moduleResponsesMap[requestURL] and return.

              4. +
              5. +

                If moduleResponsesMap[requestURL] exists, then:

                + +
                  +
                1. Let cached be moduleResponsesMap[requestURL].

                2. + +
                3. Run processCustomFetchResponse with cached[0] and + cached[1].

                4. + +
                5. Return.

                6. +
                +
              6. Set moduleResponsesMap[requestURL] to "fetching".

              7. @@ -93471,13 +93504,15 @@ document.querySelector("button").addEventListener("click", bound);
              8. Fetch request, with processResponseConsumeBody set to the following steps - given response response:

                + given response response and null, failure, or a + byte sequence bodyBytes:

                  -
                1. Set moduleResponsesMap[requestURL] to - response.

                2. +
                3. Set moduleResponsesMap[requestURL] to (response, + bodyBytes).

                4. -
                5. Run processCustomFetchResponse with response.

                6. +
                7. Run processCustomFetchResponse with response and + bodyBytes.

              @@ -93602,10 +93637,10 @@ document.querySelector("button").addEventListener("click", bound);

              To fetch a worklet/module worker script graph given a url, a fetch client settings object, a destination, a credentials mode, a - module map settings object, an onComplete algorithm, and an optional - asynchronous perform the fetch hook performFetch, run these steps. - onComplete must be an algorithm accepting null (on failure) or a module - script (on success).

              + module map settings object, an onComplete algorithm, and an optional perform the fetch hook performFetch, run + these steps. onComplete must be an algorithm accepting null (on failure) or a + module script (on success).

              1. Let options be a script fetch options whose To fetch the descendants of and link a module script module script, given a fetch client settings object, a destination, a - visited set, an onComplete algorithm, and an optional asynchronous - perform the fetch hook performFetch, run these steps. - onComplete must be an algorithm accepting null (on failure) or a module - script (on success).

                + visited set, an onComplete algorithm, and an optional perform the fetch hook performFetch, run + these steps. onComplete must be an algorithm accepting null (on failure) or a + module script (on success).

                1. @@ -93697,9 +93732,10 @@ document.querySelector("button").addEventListener("click", bound);

                  To fetch the descendants of a module script module script, given a fetch client settings object, a destination, a visited set, an - onComplete algorithm, and an optional asynchronous perform the fetch hook - performFetch, run these steps. onComplete must be an algorithm accepting - null (on failure) or a module script (on success).

                  + onComplete algorithm, and an optional perform the fetch hook performFetch, run + these steps. onComplete must be an algorithm accepting null (on failure) or a + module script (on success).

                  1. If module script's record is null, @@ -93791,9 +93827,10 @@ document.querySelector("button").addEventListener("click", bound);

                    To perform the internal module script graph fetching procedure given a moduleRequest, a fetch client settings object, a destination, some options, a referringScript, a visited set, an - onComplete algorithm, and an optional asynchronous perform the fetch hook - performFetch, run these steps. onComplete must be an algorithm accepting - null (on failure) or a module script (on success).

                    + onComplete algorithm, and an optional perform the fetch hook performFetch, run + these steps. onComplete must be an algorithm accepting null (on failure) or a + module script (on success).

                    1. Let url be the result of resolving @@ -93838,8 +93875,8 @@ document.querySelector("button").addEventListener("click", bound);

                      To fetch a single module script, given a url, a fetch client settings object, a destination, some options, a module map settings object, a referrer, an optional moduleRequest, a boolean - isTopLevel, an onComplete - algorithm, and an optional asynchronous perform the fetch hook + isTopLevel, an onComplete algorithm, + and an optional perform the fetch hook performFetch, run these steps. onComplete must be an algorithm accepting null (on failure) or a module script (on success).

                      @@ -93896,14 +93933,15 @@ document.querySelector("button").addEventListener("click", bound);
                    2. If performFetch was given, run performFetch with request, - isTopLevel, and with processResponse as defined below.

                      + isTopLevel, and with processResponseConsumeBody as defined below.

                      -

                      Otherwise, fetch request with - processResponse as processResponseConsumeBody.

                      +

                      Otherwise, fetch request with processResponseConsumeBody set to + processResponseConsumeBody as defined below.

                      -

                      In both cases, let processResponse given response response be the following algorithm:

                      +

                      In both cases, let processResponseConsumeBody given response response and null, failure, or a + byte sequence bodyBytes be the following algorithm:

                      response is always CORS-same-origin.

                      @@ -93916,11 +93954,10 @@ document.querySelector("button").addEventListener("click", bound);

                      If either of the following conditions are met:

                        -
                      • response's type is "error"; or

                      • +
                      • bodyBytes is null or failure; or

                      • response's status is not an - ok status.

                      • + ok status,

                      then set moduleMap[(url, @@ -93929,8 +93966,7 @@ document.querySelector("button").addEventListener("click", bound);

                    3. Let source text be the result of UTF-8 - decoding response's body.

                    4. + decoding bodyBytes.

                    5. Let MIME type be the result of extracting a MIME type from response's SharedWorkerGlobalScope : WorkerGlobalScope performFetch as defined below. -

                      In both cases, let performFetch be the following asynchronous perform the - fetch hook given request, is - top-level and In both cases, let performFetch be the following perform the fetch hook given request, + isTopLevel and processCustomFetchResponse:

                      1. If isTopLevel is false, fetch - request with processCustomFetchResponse as processResponseConsumeBody and return.

                      2. + request with processResponseConsumeBody + set to processCustomFetchResponse, and abort these steps.

                      3. Set request's reserved client to inside settings.
                      4. -
                      5. Fetch request. Return from this - algorithm, and run the remaining steps as part of the fetch's process response for - the response response.

                      6. +
                      7. +

                        Fetch request with processResponseConsumeBody set to the following steps + given response response and null, failure, + or a byte sequence bodyBytes:

                        -
                      8. Set worker global scope's url to response's url.

                      9. +
                          +
                        1. Set worker global scope's url to response's url.

                        2. -
                        3. Initialize worker global scope's - policy container given worker global scope, response, and - inside settings.

                        4. +
                        5. Initialize worker global scope's + policy container given worker global scope, response, and + inside settings.

                        6. -
                        7. If the Run CSP initialization for a global object algorithm returns "Blocked" when executed upon worker global scope, set - response to a network error.

                        8. +
                        9. If the Run CSP initialization for a global object algorithm returns "Blocked" when executed upon worker global scope, set + response to a network error.

                        10. -
                        11. -

                          If worker global scope's embedder policy's value is compatible with cross-origin - isolation and is shared is true, then set agent's agent - cluster's cross-origin isolation - mode to "logical" or "concrete". The one chosen is - implementation-defined.

                          - -

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

                          -
                        12. +
                        13. +

                          If worker global scope's embedder policy's value is compatible with cross-origin + isolation and is shared is true, then set agent's agent + cluster's cross-origin isolation + mode to "logical" or "concrete". The one chosen is + implementation-defined.

                          + +

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

                          +
                        14. -
                        15. If the result of checking a - global object's embedder policy with worker global scope, outside - settings, and response is false, then set response to a - network error.

                        16. +
                        17. If the result of checking a + global object's embedder policy with worker global scope, outside + settings, and response is false, then set response to a + network error.

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

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

                        22. -
                        23. 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.

                        24. +
                        25. 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.

                        26. -
                        27. -

                          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.

                          -
                        28. +
                        29. +

                          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.

                          +
                        30. -
                        31. Run processCustomFetchResponse with response.

                        32. +
                        33. Run processCustomFetchResponse with response and + bodyBytes.

                        34. +
                        +

                      In both cases, let onComplete given script be the following steps:

                      @@ -105474,7 +105516,8 @@ interface SharedWorker : EventTarget {

                      To import scripts into worker global scope, given a WorkerGlobalScope object worker global scope, a list of scalar value strings urls, and an optional - synchronous perform the fetch hook performFetch:

                      + perform the fetch hook + performFetch:

                      1. If worker global scope's SharedWorker : EventTarget {

                      Service Workers is an example of a specification that runs this - algorithm with its own synchronous perform the fetch hook.

                      + algorithm with its own perform the fetch + hook.

                      @@ -106326,8 +106370,10 @@ dictionary WorkletOptions {

                      A Worklet has a module responses map, which is an ordered map from URLs to - responses, initially empty. Access to this map should be - thread-safe.

                      + either "fetching" or tuples consisting of a + response and either null, failure, or a byte + sequence representing the response body. This map is initially empty, and access to it + should be thread-safe.

                      The added modules list and