diff --git a/encoding.bs b/encoding.bs index 78f353f..6664705 100644 --- a/encoding.bs +++ b/encoding.bs @@ -1604,29 +1604,6 @@ function convertString(buffer, input, callback) { -

Interface mixin {{GenericTransformStream}}

- -

The {{GenericTransformStream}} interface mixin represents the concept of a -transform stream in IDL. It is not a {{TransformStream}}, though it has the same interface -and it delegates to one. - -

-interface mixin GenericTransformStream {
-  readonly attribute ReadableStream readable;
-  readonly attribute WritableStream writable;
-};
-
- -

An object that includes {{GenericTransformStream}} has an associated -transform of type {{TransformStream}}. - -

The readable getter steps are to -return this's transform.\[[readable]]. - -

The writable getter steps are to -return this's transform.\[[writable]]. - -

Interface {{TextDecoderStream}}

@@ -1706,19 +1683,18 @@ constructor steps are:
  this's encoding, and set this's
  I/O queue to a new I/O queue.
 
- 
  • Let startAlgorithm be an algorithm that takes no arguments and returns nothing. -

  • Let transformAlgorithm be an algorithm which takes a chunk argument and runs the decode and enqueue a chunk algorithm with this and chunk.

  • Let flushAlgorithm be an algorithm which takes no arguments and runs the flush and enqueue algorithm with this. -

  • Let transform be the result of calling - CreateTransformStream(startAlgorithm, transformAlgorithm, - flushAlgorithm). - -

  • Set this's transform to transform. +

  • Set this's transform to the result of + creating a {{TransformStream}} with + transformAlgorithm set to + transformAlgorithm and + flushAlgorithm set to + flushAlgorithm.

    The decode and enqueue a chunk algorithm, given a {{TextDecoderStream}} object @@ -1727,20 +1703,15 @@ constructor steps are:

    1. Let bufferSource be the result of converting chunk to an - [AllowShared] BufferSource. If this throws an - exception, then return a promise rejected with that exception. + [AllowShared] BufferSource.

    2. Push a copy of bufferSource to - decoder's I/O queue. If this throws an exception, then - return a promise rejected with that exception. + decoder's I/O queue.

      See the warning for SharedArrayBuffer objects above. -

    3. Let controller be decoder's - transform.\[[transformStreamController]]. -

    4. Let output be the I/O queue of scalar values « end-of-queue ». @@ -1758,11 +1729,8 @@ constructor steps are:

    5. Let outputChunk be the result of running serialize I/O queue with decoder and output. -

    6. if outputChunk is non-empty, call - TransformStreamDefaultControllerEnqueue(controller, - outputChunk). - -

    7. Return a new promise resolved with undefined. +

    8. If outputChunk is non-empty, then enqueue + outputChunk in decoder's transform.

  • Let result be the result of processing item for @@ -1770,8 +1738,7 @@ constructor steps are: I/O queue, output, and decoder's error mode. -

  • If result is error, then return a new promise rejected with a - {{TypeError}} exception. +

  • If result is error, then throw a {{TypeError}} exception. @@ -1798,14 +1765,11 @@ steps:

  • Let controller be decoder's transform.\[[transformStreamController]]. -

  • If outputChunk is non-empty, call - TransformStreamDefaultControllerEnqueue(controller, - outputChunk). - -

  • Return a new promise resolved with undefined. +

  • If outputChunk is non-empty, then enqueue + outputChunk in decoder's transform. -

  • Otherwise, return a new promise rejected with a {{TypeError}} exception. +

  • Otherwise, throw a {{TypeError}} exception. @@ -1876,11 +1840,12 @@ constructor steps are:

  • Let flushAlgorithm be an algorithm which runs the encode and flush algorithm with this. -

  • Let transform be the result of calling - CreateTransformStream(startAlgorithm, transformAlgorithm, - flushAlgorithm). - -

  • Set this's transform to transform. +

  • Set this's transform to the result of + creating a {{TransformStream}} with + transformAlgorithm set to + transformAlgorithm and + flushAlgorithm set to + flushAlgorithm.


    @@ -1890,8 +1855,7 @@ constructor steps are:
    1. Let input be the result of converting - chunk to a {{DOMString}}. If this throws an exception, then return a promise rejected - with that exception. + chunk to a {{DOMString}}.

    2. Convert input to an I/O queue of code units. @@ -1903,9 +1867,6 @@ constructor steps are:

    3. Let output be the I/O queue of bytes « end-of-queue ». -

    4. Let controller be encoder's - transform.\[[transformStreamController]]. -

    5. While true: @@ -1925,11 +1886,11 @@ constructor steps are:

    6. Let chunk be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing output. -

    7. Call TransformStreamDefaultControllerEnqueue(controller, - chunk). +

    8. Enqueue chunk into encoder's + transform.

    -
  • Return a new promise resolved with undefined. +

  • Return.

  • Let result be the result of executing the convert code unit to scalar @@ -1983,9 +1944,6 @@ that are split between strings. [[!INFRA]]

    If encoder's pending high surrogate is non-null, then:

      -
    1. Let controller be encoder's - transform.\[[transformStreamController]]. -

    2. Let output be the byte sequence 0xEF 0xBF 0xBD. @@ -1994,11 +1952,9 @@ that are split between strings. [[!INFRA]]

    3. Let chunk be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing output. -

    4. Call TransformStreamDefaultControllerEnqueue(controller, - chunk). +

    5. Enqueue chunk into encoder's + transform.

    - -
  • Return a new promise resolved with undefined.