From 12f1e28c3b881422eee23d7c756d61b303fa633c Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 25 Feb 2025 00:40:38 +0100 Subject: [PATCH 1/3] Editorial: use bikeshed variable syntax --- index.bs | 64 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/index.bs b/index.bs index 4e45c3b..e76ba50 100644 --- a/index.bs +++ b/index.bs @@ -80,26 +80,26 @@ CompressionStream includes GenericTransformStream; A {{CompressionStream}} has an associated format and compression context context. The new CompressionStream(|format|) steps are: - 1. If *format* is unsupported in {{CompressionStream}}, then throw a {{TypeError}}. - 1. Set [=this=]'s format to *format*. - 1. Let *transformAlgorithm* be an algorithm which takes a *chunk* argument and runs the compress and enqueue a chunk algorithm with [=this=] and *chunk*. - 1. Let *flushAlgorithm* be an algorithm which takes no argument and runs the compress flush and enqueue algorithm with [=this=]. + 1. If |format| is unsupported in {{CompressionStream}}, then throw a {{TypeError}}. + 1. Set [=this=]'s format to |format|. + 1. Let |transformAlgorithm| be an algorithm which takes a |chunk| argument and runs the compress and enqueue a chunk algorithm with [=this=] and |chunk|. + 1. Let |flushAlgorithm| be an algorithm which takes no argument and runs the compress flush and enqueue algorithm with [=this=]. 1. Set [=this=]'s [=GenericTransformStream/transform=] to a [=new=] {{TransformStream}}. - 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to *transformAlgorithm* and [=TransformStream/set up/flushAlgorithm=] set to *flushAlgorithm*. + 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm| and [=TransformStream/set up/flushAlgorithm=] set to |flushAlgorithm|. -The compress and enqueue a chunk algorithm, given a {{CompressionStream}} object *cs* and a *chunk*, runs these steps: - 1. If *chunk* is not a {{BufferSource}} type, then throw a {{TypeError}}. - 1. Let *buffer* be the result of compressing *chunk* with *cs*'s format and context. - 1. If *buffer* is empty, return. - 1. Split *buffer* into one or more non-empty pieces and convert them into {{Uint8Array}}s. - 1. For each {{Uint8Array}} *array*, [=TransformStream/enqueue=] *array* in *cs*'s [=GenericTransformStream/transform=]. +The compress and enqueue a chunk algorithm, given a {{CompressionStream}} object |cs| and a |chunk|, runs these steps: + 1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}. + 1. Let |buffer| be the result of compressing |chunk| with |cs|'s format and context. + 1. If |buffer| is empty, return. + 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. + 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=]. -The compress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{CompressionStream}} object *cs*, runs these steps: +The compress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{CompressionStream}} object |cs|, runs these steps: - 1. Let *buffer* be the result of compressing an empty input with *cs*'s format and context, with the finish flag. - 1. If *buffer* is empty, return. - 1. Split *buffer* into one or more non-empty pieces and convert them into {{Uint8Array}}s. - 1. For each {{Uint8Array}} *array*, [=TransformStream/enqueue=] *array* in *cs*'s [=GenericTransformStream/transform=]. + 1. Let |buffer| be the result of compressing an empty input with |cs|'s format and context, with the finish flag. + 1. If |buffer| is empty, return. + 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. + 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=]. # Interface `DecompressionStream` # {#decompression-stream} @@ -115,27 +115,27 @@ DecompressionStream includes GenericTransformStream; A {{DecompressionStream}} has an associated format and compression context context. The new DecompressionStream(|format|) steps are: - 1. If *format* is unsupported in {{DecompressionStream}}, then throw a {{TypeError}}. - 1. Set [=this=]'s format to *format*. - 1. Let *transformAlgorithm* be an algorithm which takes a *chunk* argument and runs the decompress and enqueue a chunk algorithm with [=this=] and *chunk*. - 1. Let *flushAlgorithm* be an algorithm which takes no argument and runs the decompress flush and enqueue algorithm with [=this=]. + 1. If |format| is unsupported in {{DecompressionStream}}, then throw a {{TypeError}}. + 1. Set [=this=]'s format to |format|. + 1. Let |transformAlgorithm| be an algorithm which takes a |chunk| argument and runs the decompress and enqueue a chunk algorithm with [=this=] and |chunk|. + 1. Let |flushAlgorithm| be an algorithm which takes no argument and runs the decompress flush and enqueue algorithm with [=this=]. 1. Set [=this=]'s [=GenericTransformStream/transform=] to a [=new=] {{TransformStream}}. - 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to *transformAlgorithm* and [=TransformStream/set up/flushAlgorithm=] set to *flushAlgorithm*. + 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm| and [=TransformStream/set up/flushAlgorithm=] set to |flushAlgorithm|. -The decompress and enqueue a chunk algorithm, given a {{DecompressionStream}} object *ds* and a *chunk*, runs these steps: - 1. If *chunk* is not a {{BufferSource}} type, then throw a {{TypeError}}. - 1. Let *buffer* be the result of decompressing *chunk* with *ds*'s format and context. If this results in an error, then throw a {{TypeError}}. - 1. If *buffer* is empty, return. - 1. Split *buffer* into one or more non-empty pieces and convert them into {{Uint8Array}}s. - 1. For each {{Uint8Array}} *array*, [=TransformStream/enqueue=] *array* in *ds*'s [=GenericTransformStream/transform=]. +The decompress and enqueue a chunk algorithm, given a {{DecompressionStream}} object |ds| and a |chunk|, runs these steps: + 1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}. + 1. Let |buffer| be the result of decompressing |chunk| with |ds|'s format and context. If this results in an error, then throw a {{TypeError}}. + 1. If |buffer| is empty, return. + 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. + 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. -The decompress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object *ds*, runs these steps: +The decompress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object |ds|, runs these steps: - 1. Let *buffer* be the result of decompressing an empty input with *ds*'s format and context, with the finish flag. + 1. Let |buffer| be the result of decompressing an empty input with |ds|'s format and context, with the finish flag. 1. If the end of the compressed input has not been reached, then throw a {{TypeError}}. - 1. If *buffer* is empty, return. - 1. Split *buffer* into one or more non-empty pieces and convert them into {{Uint8Array}}s. - 1. For each {{Uint8Array}} *array*, [=TransformStream/enqueue=] *array* in *ds*'s [=GenericTransformStream/transform=]. + 1. If |buffer| is empty, return. + 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. + 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. # Privacy and security considerations # {#privacy-security} From 03ba502d6bb1af02723cb97a30a996e66b4a528a Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 25 Feb 2025 00:50:46 +0100 Subject: [PATCH 2/3] Add
--- index.bs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index e76ba50..7937987 100644 --- a/index.bs +++ b/index.bs @@ -79,6 +79,7 @@ CompressionStream includes GenericTransformStream; A {{CompressionStream}} has an associated format and compression context context. +
The new CompressionStream(|format|) steps are: 1. If |format| is unsupported in {{CompressionStream}}, then throw a {{TypeError}}. 1. Set [=this=]'s format to |format|. @@ -86,20 +87,24 @@ The 1. Let |flushAlgorithm| be an algorithm which takes no argument and runs the compress flush and enqueue algorithm with [=this=]. 1. Set [=this=]'s [=GenericTransformStream/transform=] to a [=new=] {{TransformStream}}. 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm| and [=TransformStream/set up/flushAlgorithm=] set to |flushAlgorithm|. +
+
The compress and enqueue a chunk algorithm, given a {{CompressionStream}} object |cs| and a |chunk|, runs these steps: 1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}. 1. Let |buffer| be the result of compressing |chunk| with |cs|'s format and context. 1. If |buffer| is empty, return. 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=]. +
+
The compress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{CompressionStream}} object |cs|, runs these steps: - 1. Let |buffer| be the result of compressing an empty input with |cs|'s format and context, with the finish flag. 1. If |buffer| is empty, return. 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=]. +
# Interface `DecompressionStream` # {#decompression-stream} @@ -114,6 +119,7 @@ DecompressionStream includes GenericTransformStream; A {{DecompressionStream}} has an associated format and compression context context. +
The new DecompressionStream(|format|) steps are: 1. If |format| is unsupported in {{DecompressionStream}}, then throw a {{TypeError}}. 1. Set [=this=]'s format to |format|. @@ -121,7 +127,9 @@ The decompress flush and enqueue algorithm with [=this=]. 1. Set [=this=]'s [=GenericTransformStream/transform=] to a [=new=] {{TransformStream}}. 1. [=TransformStream/Set up=] [=this=]'s [=GenericTransformStream/transform=] with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm| and [=TransformStream/set up/flushAlgorithm=] set to |flushAlgorithm|. +
+
The decompress and enqueue a chunk algorithm, given a {{DecompressionStream}} object |ds| and a |chunk|, runs these steps: 1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}. 1. Let |buffer| be the result of decompressing |chunk| with |ds|'s format and context. If this results in an error, then throw a {{TypeError}}. @@ -129,13 +137,14 @@ The decompress and enqueue a chunk algorithm, given a {{Decompression 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. +
The decompress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object |ds|, runs these steps: - 1. Let |buffer| be the result of decompressing an empty input with |ds|'s format and context, with the finish flag. 1. If the end of the compressed input has not been reached, then throw a {{TypeError}}. 1. If |buffer| is empty, return. 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. +
# Privacy and security considerations # {#privacy-security} From 7d137ecf0faf0d81612cc732b2f5731120f6ec66 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 25 Feb 2025 00:53:37 +0100 Subject: [PATCH 3/3] Missing end tag --- index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/index.bs b/index.bs index 7937987..4a37586 100644 --- a/index.bs +++ b/index.bs @@ -136,6 +136,7 @@ The decompress and enqueue a chunk algorithm, given a {{Decompression 1. If |buffer| is empty, return. 1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s. 1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. +
The decompress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object |ds|, runs these steps: