diff --git a/fetch.bs b/fetch.bs index b4760f69f..b9c7ed60e 100644 --- a/fetch.bs +++ b/fetch.bs @@ -6705,40 +6705,90 @@ i.e. when a fetch group is terminated, or after
If request's URL is not a [=potentially trustworthy url=], then throw a "{{SecurityError}}" {{DOMException}}. +
If request's body is null then throw a {{TypeError}}. + +
If request's + body's length is null, then throw a {{TypeError}}. +
Set request's service-workers mode to "none
".
If request's body is not null and request's - body's source is null, then throw a {{TypeError}}. +
If request's body's source is null, then throw a + {{TypeError}}.
This disallows sending deferred fetches with a live {{ReadableStream}}. -
Let quotaRelevantTopLevelNavigables be an the + quota-relevant top-level navigables given request's client. + +
In most cases this will list will contain a single {{Document}}. The exception would + be when the request comes from a {{SharedWorker}}, in which case all the documents that directly + or indirectly obtain this worker would have to check their quota.
If request's body is not null then: +
For each topLevelNavigable in + quotaRelevantTopLevelNavigables: + +
This algorithm asserts that this deferred fetch doesn't exceed two quotas: one for + the top-level document (640kb), and one for the reporting origin (64kb). The larger quota ensures + that the top-level {{Document}} and its subresources don't continue using an unlimited amount of + bandwidth after being destroyed. The smaller quota ensures that a single reporting sink doesn't + reserve the whole quota to itself.
-For each deferred fetch record deferredRecord in - request's client's fetch group's - deferred fetch records: if deferredRecord's - request's body is not null and - deferredRecord's request's URL's - origin is same origin with request's URL's - origin, then increment totalScheduledDeferredBytesForOrigin by - deferredRecord's request's body's - length. +
Let participatingClients be an empty set. + +
For each navigable of topLevelNavigable's + active document's inclusive descendant navigables, + append navigable's active document to + participatingClients. + +
For each {{WorkerGlobalScope}} worker: + +
+ +For each client of participatingClients: +
For each deferred fetch record deferredRecord in + client's fetch group's + deferred fetch records:
+ +Let length be deferredRecord's + request's body's + length. -
If totalScheduledDeferredBytesForOrigin is greater than 64 kilobytes, then - throw a "{{QuotaExceededError}}" {{DOMException}}. +
Increment totalScheduledDeferredBytesForTopLevelDocument by length. + +
If totalScheduledDeferredBytesForTopLevelDocument is greater than 640 + kilobytes, then throw a "{{QuotaExceededError}}" {{DOMException}}. + +
If deferredRecord's request's + URL's origin is same origin with + request's origin, then increment + totalScheduledDeferredBytesForOrigin by length. + +
If totalScheduledDeferredBytesForOrigin is greater than 64 kilobytes, then + throw a "{{QuotaExceededError}}" {{DOMException}}. +
Set request's keepalive to true. @@ -6771,6 +6821,30 @@ i.e. when a fetch group is terminated, or after +
To retrieve the quota-relevant top-level navigables given an +environment settings object client:
+ +If client is a {{Document}}, then: + +
If client is fully active then return + « client's inclusive ancestor navigables[0] ». + +
Return « ». +
Let topLevelNavigables be « ». + +
For each owner in client's + owner set, extend + topLevelNavigables with owner's quota-relevant top-level navigables. + +
Return topLevelNavigables. +
To process deferred fetches given a fetch group fetchGroup: