diff --git a/encoding.bs b/encoding.bs index fe69752..684c72d 100644 --- a/encoding.bs +++ b/encoding.bs @@ -1851,23 +1851,41 @@ constructor steps are:
If encoding is failure or replacement, then throw a {{RangeError}}. -
Let errorMode be "fatal" if
+ options["{{TextDecoderOptions/fatal}}"] is true; otherwise "replacement".
-
If options["{{TextDecoderOptions/fatal}}"] is true, then set this's
- error mode to "fatal".
+
Set up a text decoder stream with this, encoding, + errorMode, and options["{{TextDecoderOptions/ignoreBOM}}"]. + + -
Set this's ignore BOM to - options["{{TextDecoderOptions/ignoreBOM}}"]. +
To set up a text decoder stream given a {{TextDecoderStream}} object
+stream, an optional [=/encoding=] encoding (default UTF-8), an optional
+error mode errorMode (default "replacement"), and an optional
+boolean ignoreBOM (default false), run these steps:
-
Set this's decoder to a new instance of this's - encoding's decoder, and set this's - I/O queue to a new I/O queue. +
Assert: encoding is not replacement. + +
Set stream's encoding to encoding. + +
Set stream's error mode to errorMode. + +
Set stream's ignore BOM to ignoreBOM. + +
Set stream's decoder to a new instance of + encoding's decoder. + +
Set stream's I/O queue to a new I/O + queue.
Let transformAlgorithm be an algorithm which takes a chunk argument - and runs the decode and enqueue a chunk algorithm with this and chunk. + and runs the decode and enqueue a chunk algorithm with stream and + chunk. -
Let flushAlgorithm be an algorithm which takes no arguments and runs the - flush and enqueue algorithm with this. +
Let flushAlgorithm be an algorithm which takes no arguments and runs the flush + and enqueue algorithm with stream.
Let transformStream be a [=new=] {{TransformStream}}. @@ -1877,7 +1895,8 @@ constructor steps are: flushAlgorithm set to flushAlgorithm. -
Set stream's transform to + transformStream.