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
Fetch request with processResponseConsumeBody set to the following steps - given response response:
+ given response response and null, failure, or + a byte sequence bodyBytes:Finalize and report timing with response, el's node document's relevant global object, and initiatorType.
Let success be true.
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.
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.
Process the linked resource given el, - success, and response.
Process the linked resource given el, success, + response, and bodyBytes.
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.
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:
link
element el, boolean success, response response, and byte sequence
+ bodyBytes:
If response's Content-Type metadata is not a JSON MIME type, then set success to false.
If success is true, then process the manifest given el - and response.
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: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:
link
element el, boolean success, response response, and byte sequence
+ bodyBytes:
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:
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 " bodyBytes is null or failure; or response's status is not an
ok status,
-
error
"; or
Let source text be the result of UTF-8 - decoding response's body.
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.
Let response be null.
Let bodyBytes be null.
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.
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:
+ +Set bodyBytes to bb.
Set response to res.
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
Let source text be the result of UTF-8 - decoding response's body.
Let muted errors be true if response was CORS-cross-origin, and false otherwise.
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:Let requestURL be request's queue a task on the networking task source to proceed with running the following steps.
If moduleResponsesMap[requestURL] exists, then run processCustomFetchResponse with - moduleResponsesMap[requestURL] and return.
If moduleResponsesMap[requestURL] exists, then:
+ +Let cached be moduleResponsesMap[requestURL].
Run processCustomFetchResponse with cached[0] and + cached[1].
Return.
Set moduleResponsesMap[requestURL] to
"fetching
".
Fetch request, with processResponseConsumeBody set to the following steps - given response response:
+ given response response and null, failure, or a + byte sequence bodyBytes:Set moduleResponsesMap[requestURL] to - response.
Set moduleResponsesMap[requestURL] to (response, + bodyBytes).
Run processCustomFetchResponse with response.
Run processCustomFetchResponse with response and + bodyBytes.
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).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).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).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).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). If performFetch was given, run performFetch with request,
- isTopLevel, and with processResponse 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.
then set moduleMap[(url, @@ -93929,8 +93966,7 @@ document.querySelector("button").addEventListener("click", bound);
Let source text be the result of UTF-8 - decoding response's body.
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: If isTopLevel is false, fetch
- request with processCustomFetchResponse as processResponseConsumeBody and return.
Fetch request. Return from this - algorithm, and run the remaining steps as part of the fetch's process response for - the response response.
Fetch request with processResponseConsumeBody set to the following steps + given response response and null, failure, + or a byte sequence bodyBytes:
-Set worker global scope's url to response's url.
Set worker global scope's url to response's url.
Initialize worker global scope's - policy container given worker global scope, response, and - inside settings.
Initialize worker global scope's + policy container given worker global scope, response, and + inside settings.
If the Run CSP initialization for a global object algorithm returns "Blocked
" when executed upon worker global scope, set
- response to a network error.
If the Run CSP initialization for a global object algorithm returns "Blocked
" when executed upon worker global scope, set
+ response to a network error.
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.
-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.
+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.
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.
Set worker global scope's cross-origin isolated
- capability to true if agent's agent cluster's cross-origin isolation mode is "concrete
".
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 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.
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.
Run processCustomFetchResponse with response and + bodyBytes.
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:
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.
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