diff --git a/index.bs b/index.bs index 5cd4522..02f1d87 100644 --- a/index.bs +++ b/index.bs @@ -82,9 +82,9 @@ An object that includes {{GenericTransformStream}} has an associated transf ## Attributes ## {#outgoing-stream-attributes} : readable -:: The `readable` attribute's getter, when invoked, must return this object's transform \[[readable]]. +:: The `readable` attribute's getter, when invoked, must return this object's transform \[[readable](https://streams.spec.whatwg.org/#rs-class)]. : writable -:: The `writable` attribute's getter, when invoked, must return this object's transform \[[writable]]. +:: The `writable` attribute's getter, when invoked, must return this object's transform \[[writable](https://streams.spec.whatwg.org/#ws-class)]. # Interface `CompressionStream` # {#compression-stream} @@ -96,24 +96,24 @@ interface CompressionStream { CompressionStream includes GenericTransformStream; -The {{CompressionStream}}(format) constructor, when invoked, must run these steps: - 1. If format is unsupported in CompressionStream, then throw a TypeError. +The {{CompressionStream}} (format) constructor, when invoked, must run these steps: + 1. If format is unsupported in CompressionStream, then throw a [TypeError](https://www.ecma-international.org/ecma-262/6.0/#sec-native-error-types-used-in-this-standard-typeerror). 1. Let *cs* be a new CompressionStream object. 1. Set *cs*'s *format* to format. 1. Let *startAlgorithm* be an algorithm that takes no arguments and returns nothing. 1. Let *transformAlgorithm* be an algorithm which takes a *chunk* argument and runs the compress and enqueue a chunk algorithm with *cs* and *chunk*. 1. Let *flushAlgorithm* be an algorithm which takes no argument and runs the compress flush and enqueue algorithm with *cs*. - 1. Let *transform* be the result of calling CreateTransformStream(*startAlgorithm*, *transformAlgorithm*, *flushAlgorithm*). + 1. Let *transform* be the result of calling CreateTransformStream (*startAlgorithm*, *transformAlgorithm*, *flushAlgorithm*). 1. Set *cs*'s transform to *transform*. 1. Return *cs*. 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*. If this throws an exception, then return a promise rejected with that exception. - 1. Let *controller* be *cs*'s transform.\[[TransformStreamController]]. + 1. Let *controller* be *cs*'s transform.\[[TransformStreamController](https://streams.spec.whatwg.org/#ts-default-controller-class)]. 1. If *buffer* is empty, return a new promise resolved with undefined. 1. Split *buffer* into one or more non-empty pieces and convert them into Uint8Arrays. - 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue(*controller*, *array*). + 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue (*controller*, *array*). 1. Return a new promise resolved with undefined. 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: @@ -121,7 +121,7 @@ The compress flush and enqueue algorithm, which handles the end of da 1. Let *buffer* be the result of compressing an empty input with *cs*'s *format*, with the finish flag. 1. If *buffer* is empty, return a new promise resolved with undefined. 1. Split *buffer* into one or more non-empty pieces and convert them into Uint8Arrays. - 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue(*controller*, *array*). + 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue (*controller*, *array*). 1. Return a new promise resolved with undefined. @@ -135,24 +135,24 @@ interface DecompressionStream { DecompressionStream includes GenericTransformStream; -The {{DecompressionStream}}(format) constructor, when invoked, must run these steps: +The {{DecompressionStream}} (format) constructor, when invoked, must run these steps: 1. If format is unsupported in DecompressionStream, then throw a TypeError. 1. Let *ds* be a new DecompressionStream object. 1. Set *ds*'s *format* to format. 1. Let *startAlgorithm* be an algorithm that takes no arguments and returns nothing. 1. Let *transformAlgorithm* be an algorithm which takes a *chunk* argument and runs the decompress and enqueue a chunk algorithm with *ds* and *chunk*. 1. Let *flushAlgorithm* be an algorithm which takes no argument and runs the decompress flush and enqueue algorithm with *ds*. - 1. Let *transform* be the result of calling CreateTransformStream(*startAlgorithm*, *transformAlgorithm*, *flushAlgorithm*). + 1. Let *transform* be the result of calling CreateTransformStream (*startAlgorithm*, *transformAlgorithm*, *flushAlgorithm*). 1. Set *ds*'s transform to *transform*. 1. Return *ds*. 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*. If this throws an exception, then return a promise rejected with that exception. - 1. Let *controller* be *ds*'s transform.\[[TransformStreamController]]. + 1. Let *controller* be *ds*'s transform.\[[TransformStreamController](https://streams.spec.whatwg.org/#ts-default-controller-class)]. 1. If *buffer* is empty, return a new promise resolved with undefined. 1. Split *buffer* into one or more non-empty pieces and convert them into Uint8Arrays. - 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue(*controller*, *array*). + 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue (*controller*, *array*). 1. Return a new promise resolved with undefined. 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: @@ -160,7 +160,7 @@ The decompress flush and enqueue algorithm, which handles the end of 1. Let *buffer* be the result of decompressing an empty input with *ds*'s *format*, with the finish flag. 1. If *buffer* is empty, return a new promise resolved with undefined. 1. Split *buffer* into one or more non-empty pieces and convert them into Uint8Arrays. - 1. For each Uint8Array *array*, call TransformStreamDefaultControllerEnqueue(*controller*, *array*). + 1. For each `Uint8Array` *array*, call TransformStreamDefaultControllerEnqueue (*controller*, *array*). 1. Return a new promise resolved with undefined. @@ -218,4 +218,4 @@ async function DecompressBlob(blob) { # Acknowledgments # {#acknowledgments} -The editors wish to thank Domenic Denicola and Yutaka Hirano, for their support. \ No newline at end of file +The editors wish to thank Domenic Denicola and Yutaka Hirano, for their support.