diff --git a/fetch.bs b/fetch.bs index 69b917675..f5cb91850 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2737,14 +2737,6 @@ a list of fetch records. deferred fetch records, a list of deferred fetch records. -
A fetch group has an associated boolean -is eligible for full-quota deferred fetching. - -To initialize a fetch group for a given environment settings object -settings, set its is eligible for full-quota deferred fetching -to the result of calling check full-quota deferred fetching eligibility given -settings. -
A fetch record is a [=struct=]. It has the following items:
A navigable has an associated allotted deferred fetching quota, initially +zero.
This algorithm asserts that this deferred fetch doesn't exceed two quotas: one for the -top-level document (640 kibibytes), and one for the reporting origin (64 kibibytes). 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. - +document and it's same-origin same-tree relatives, and one for the reporting origin (64 kibibytes). +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.
If request's client's fetch group - is eligible for full-quota deferred fetching is false, the user agent may - return 0. - -
This allows implementations to prevent 3rd party environments from taking up - non-abortable bandwidth without the consent of the top-level document. Without this constraint, - those environments can still take up a small amount of bandwidth (16 kibibytes) for deferred - fetching. +
Let relativeNavigables be all navigables whose + active document's relevant agent is document's relevant agent's, + top-level traversable is document's node navigable's + top-level traversable, and whose active document's + origin is same origin with document's + origin. -
Let closestSameOriginInclusiveAncestor be document's - node navigable. - -
While closestSameOriginInclusiveAncestor's parent is a - navigable whose active document's origin is same origin - with document's origin, set - closestSameOriginInclusiveAncestor to closestSameOriginInclusiveAncestor's - parent. - -
Let directRelativeSameOriginNavigables be the - inclusive direct same origin descendants of closestSameOriginInclusiveAncestor. +
Let remainingTotalQuota be zero.
Let remainingTotalQuota be the result of the first matching statement: - -
For each navigable in relativeNavigables: +
Increment remainingTotalQuota by navigable's + allotted deferred fetching quota.
+Let remainingQuotaForOrigin be remainingTotalQuota. +
If remainingQuotaForOrigin is greater than 64 kibibytes, then set + remainingQuotaForOrigin to 64 kibibytes.
For each navigable in - directRelativeSameOriginNavigables: - -
For each navigable in relativeNavigables:
For each deferred fetch record deferredRecord in navigable's active document's fetch group's @@ -6879,21 +6851,13 @@ doesn't reserve the whole quota to itself.
Let navigableContainers be a list of all shadow-including descendants of - navigable's active document that are navigable containers. +
For each descendant of navigable's + active document's shadow-including descendants that are + navigable containers, decrement remainingTotalQuota by descendant's + content navigable's allotted deferred fetching quota. -
For each childNavigable of navigableContainers: - -
If childNavigable's active document's origin is - not same origin with navigable's active document's - origin and childNavigable's active document's - fetch group's - is eligible for full-quota deferred fetching is true, - then decrement remainingTotalQuota by 64 kibibytes. -
If remainingTotalQuota is greater than remainingQuotaForOrigin + return remainingQuotaForOrigin; Otherwise return remainingTotalQuota.
If settings is not a Document
, return false.
-
-
If the result of calling [$Is feature enabled in document for origin?$] given
- settings is Disabled
, return false.
-
-
Let parentDocument be settings's node navigable's - parent's active document. - -
If parentDocument is null, then return true. - -
If parentDocument's origin is same origin with - settings's origin then return true. - -
If the available deferred fetching quota given parentDocument and null is - less than 64 kibibytes, return false. - -
Return true. -
To process deferred fetches given a fetch group fetchGroup: