From 83e05e8528c64d507d6aaaefa261d51d2f535a76 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 30 May 2022 13:59:47 +0200 Subject: [PATCH] Correct and consistify TransformStream boilerplate --- fetch.bs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fetch.bs b/fetch.bs index 275cae0e4..26efa08e2 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4324,20 +4324,20 @@ steps:

Otherwise:

    -
  1. Let transformStream be a new a {{TransformStream}}. +

  2. Let transformStream be a new {{TransformStream}}.

  3. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream. -

  4. Set up transformStream with +

  5. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm set to processResponseEndOfBody. -

  6. Set response's body to the result of - piping response's - body through transformStream. +

  7. Set response's body's stream to the result + of response's body's stream + piped through transformStream.

This {{TransformStream}} is needed for the purpose of receiving a notification when @@ -4532,6 +4532,8 @@ these steps:

If requestForServiceWorker's body is non-null, then:

    +
  1. Let transformStream be a new {{TransformStream}}. +

  2. Let transformAlgorithm given chunk be these steps: @@ -4543,22 +4545,20 @@ these steps: terminate fetchParams's controller. -

  3. Otherwise, enqueue chunk. The user agent may - split the chunk into implementation-defined practical sizes and - enqueue each of them. The user agent also may concatenate the - chunks into an implementation-defined practical size and - enqueue it. +

  4. Otherwise, enqueue chunk in + transformStream. The user agent may split the chunk into + implementation-defined practical sizes and enqueue each of + them. The user agent also may concatenate the chunks into an implementation-defined + practical size and enqueue it.

-
  • Let transformStream be the result of setting up a - {{TransformStream}} with transformAlgorithm. - -

  • Let transformedStream be the result of requestForServiceWorker's - body's stream piped through - transformStream. +

  • Set up transformStream with + transformAlgorithm set to + transformAlgorithm.

  • Set requestForServiceWorker's body's stream to - transformedStream. + the result of requestForServiceWorker's body's stream + piped through transformStream.

  • Let serviceWorkerStartTime be the coarsened shared current time