diff --git a/fetch.bs b/fetch.bs index 5ac06793e..f4a97e62c 100644 --- a/fetch.bs +++ b/fetch.bs @@ -5337,16 +5337,15 @@ optional boolean forceNewConnection (default false), run these steps:
  • Let highWaterMark be a non-negative, non-NaN number, chosen by the user agent. -

  • Let sizeAlgorithm be an algorithm that accepts a chunk object and returns - a non-negative, non-NaN, non-infinite number, chosen by the user agent. -

  • Let stream be a new {{ReadableStream}}. -

  • Set up stream with - pullAlgorithm set to pullAlgorithm, - cancelAlgorithm set to cancelAlgorithm, - highWaterMark set to highWaterMark, and - sizeAlgorithm set to sizeAlgorithm. +

  • Set up with byte reading support stream with + pullAlgorithm set to + pullAlgorithm, + cancelAlgorithm set to + cancelAlgorithm, and + highWaterMark set to + highWaterMark.

  • Run these steps, but abort when the ongoing fetch is terminated: @@ -5398,6 +5397,10 @@ optional boolean forceNewConnection (default false), run these steps:

    While true:

      +
    1. If stream's current BYOB request view is + non-null, then user agents should use its byte length to inform the + transmission process about how many bytes are being requested for this stream. +

    2. If one or more bytes have been transmitted from response's message body, then: @@ -5423,8 +5426,19 @@ optional boolean forceNewConnection (default false), run these steps:

    3. If bytes is failure, then terminate the ongoing fetch. -

    4. Enqueue a {{Uint8Array}} wrapping an {{ArrayBuffer}} - containing bytes into stream. +

    5. Let view be null. + +

    6. If stream's current BYOB request view is + non-null, and bytes's length is less than + stream's current BYOB request view's + byte length, then set view to stream's + current BYOB request view, and write + bytes into view. + +

    7. Otherwise, set view to the result of creating + a {{Uint8Array}} from bytes. + +

    8. Enqueue view into stream.

    9. If stream is errored, then terminate the ongoing fetch.