diff --git a/fetch.bs b/fetch.bs index 484f1f2c..14372390 100644 --- a/fetch.bs +++ b/fetch.bs @@ -6711,67 +6711,71 @@ 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's source is null, then throw a - {{TypeError}}. - -

    This disallows sending deferred fetches with a live {{ReadableStream}}. -

  • If the result of calling is feature enabled in document for origin? given "deferred-fetch", document, and request's origin is Disabled, then throw a {{NotAllowedError}}. -

  • Let totalScheduledDeferredBytesForTopLevelDocument be - request's body's length. +

  • +

    If request's body is not null then: -

  • Let totalScheduledDeferredBytesForOrigin be request's - body's length. +

      +
    1. If request's + body's length is null, then throw a {{TypeError}}. -

    2. -

      For each navigable of document's - node navigable's top-level traversable's - inclusive descendant navigables: +

    3. +

      If request's body's source is null, then throw a + {{TypeError}}. -

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

      This disallows sending deferred fetches with a live {{ReadableStream}}. + +

    4. Let totalScheduledDeferredBytesForTopLevelDocument be + request's body's length. + +

    5. Let totalScheduledDeferredBytesForOrigin be request's + body's length. -

      1. -

        For each deferred fetch record deferredRecord in - navigable's active document's fetch group's - deferred fetch records:

        +

        For each navigable of document's + node navigable's top-level traversable's + inclusive descendant navigables: + +

        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.

          -
        1. Let length be deferredRecord's - request's body's - length. +

        2. +

          For each deferred fetch record deferredRecord in + navigable's active document's fetch group's + deferred fetch records:

          -
        3. Increment totalScheduledDeferredBytesForTopLevelDocument by length. +

            +
          1. Let length be deferredRecord's + request's body's + length. + +

          2. Increment totalScheduledDeferredBytesForTopLevelDocument by length. -

          3. If totalScheduledDeferredBytesForTopLevelDocument is greater than 640 - kilobytes, then throw a "{{QuotaExceededError}}" {{DOMException}}. +

          4. If totalScheduledDeferredBytesForTopLevelDocument is greater than 640 + kilobytes, then throw a "{{QuotaExceededError}}" {{DOMException}}. -

          5. If deferredRecord's request's - URL's origin is same origin with - request's origin, then increment - totalScheduledDeferredBytesForOrigin by length. +

          6. If deferredRecord's request's + URL's origin is same origin with + request's origin, then increment + totalScheduledDeferredBytesForOrigin by length. -

          7. If totalScheduledDeferredBytesForOrigin is greater than 64 kilobytes, then - throw a "{{QuotaExceededError}}" {{DOMException}}. +

          8. If totalScheduledDeferredBytesForOrigin is greater than 64 kilobytes, then + throw a "{{QuotaExceededError}}" {{DOMException}}. +

          +
      +
    6. Set request's service-workers mode to "none". +

    7. Set request's keepalive to true.

    8. Let deferredRecord be a new deferred fetch record whose