- From: Adam Rice <notifications@github.com>
- Date: Fri, 03 Aug 2018 08:06:09 -0700
- To: whatwg/encoding <encoding@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/encoding/pull/149/review/143187017@github.com>
ricea commented on this pull request.
> @@ -15,6 +15,19 @@ Translate IDs: dictdef-textdecoderoptions textdecoderoptions,dictdef-textdecodeo
spec:infra; type:dfn;
text:code point
text:ascii case-insensitive
+spec:streams;
+ type:interface; text:ReadableStream
+ type:dfn; text:chunk
All except "transform stream" were already exported. I created https://github.com/whatwg/streams/pull/949 to export that too.
> @@ -1038,6 +1051,33 @@ function decodeArrayOfStrings(buffer, encoding) {
</div>
+<h3 id=interface-mixin-textdecoderattributes>Interface Mixin {{TextDecoderAttributes}}</h3>
Done.
> + Exposed=(Window,Worker)]
+interface TextEncoderStream {
+};
+
+TextEncoderStream includes TextEncoderAttributes;
+TextEncoderStream includes GenericTransformStream;
+</pre>
+
+<p>A {{TextEncoderStream}} object has an associated <dfn for=TextEncoderStream>encoder</dfn>,
+<dfn for=TextEncoderStream>transform</dfn> and <dfn for=TextEncoderStream>pending high
+surrogate</dfn> (initially null).
+
+<p class="note no-backref">A {{TextEncoderStream}} object offers no <var>label</var> argument as it
+only supports <a>UTF-8</a>.
+
+<hr>
Me neither. I've taken it out for now.
> + <li><p><a>Prepend</a> <var>token</var> to <var>input</var>.
+
+ <li><p>Return U+FFFD.
+ </ol>
+
+ <li><p>If <var>token</var> is in the range U+D800 to U+DBFF, inclusive, then set <a>pending high
+ surrogate</a> to <var>token</var> and return <a>continue</a>.
+
+ <li><p>If <var>token</var> is in the range U+DC00 to U+DFFF, inclusive, then return U+FFFD.
+
+ <li><p>Return <var>token</var>.
+</ol>
+
+<p class=note>This is equivalent to the "<a>convert</a> a <a>JavaScript string</a> into a <a>scalar
+value string</a>" algorithm from the Infra Standard, but allows for surrogate pairs that are split
+between strings.
Done.
> @@ -1305,6 +1350,404 @@ must run these steps:
</ol>
+<h3 id=interface-mixin-generictransformstream>Interface Mixin {{GenericTransformStream}}</h3>
+
+<p>{{GenericTransformStream}} represents the concept of a <a>transform stream</a> in IDL. It is not
+a {{TransformStream}}, though it has the same interface and it delegates to one.
+
+<pre class=idl>
+interface mixin GenericTransformStream {
+ readonly attribute ReadableStream readable;
+ readonly attribute WritableStream writable;
+};
+</pre>
+
+<p>An object that includes GenericTransformStream always has an associated
Done.
> @@ -1305,6 +1350,404 @@ must run these steps:
</ol>
+<h3 id=interface-mixin-generictransformstream>Interface Mixin {{GenericTransformStream}}</h3>
+
+<p>{{GenericTransformStream}} represents the concept of a <a>transform stream</a> in IDL. It is not
+a {{TransformStream}}, though it has the same interface and it delegates to one.
+
+<pre class=idl>
+interface mixin GenericTransformStream {
+ readonly attribute ReadableStream readable;
+ readonly attribute WritableStream writable;
+};
+</pre>
+
+<p>An object that includes GenericTransformStream always has an associated
+<dfn for=GenericTransformStream>transform</dfn>.
Done.
> +
+TextDecoderStream includes TextDecoderAttributes;
+TextDecoderStream includes GenericTransformStream;
+</pre>
+
+<p>A {{TextDecoderStream}} object has an associated <dfn for=TextDecoderStream>encoding</dfn>,
+<dfn for=TextDecoderStream>decoder</dfn>, <dfn for=TextDecoderStream>stream</dfn>,
+<dfn for=TextDecoderStream>ignore BOM flag</dfn> (initially unset),
+<dfn for=TextDecoderStream>BOM seen flag</dfn> (initially unset),
+<dfn for=TextDecoderStream>error mode</dfn> (initially "<code>replacement</code>"),
+<dfn for=TextDecoderStream>do not flush flag</dfn> (initially unset), and
+<dfn for=TextDecoderStream>transform</dfn>.
+
+<p>A {{TextDecoderStream}} object also has an associated <dfn id=concept-tds-serialize
+for=TextDecoderStream>serialize stream</dfn> algorithm, that is identical to the <a
+for=TextDecoder>serialize stream</a> algorithm for the equivalent {{TextDecoder}}.
I think I can do it if I rename TextDecoderAttributes to TextDecoderCommon and move more of the object's "slots" over. I won't have time to try it until next week.
> + Exposed=(Window,Worker)]
+interface TextDecoderStream {
+ USVString decode(optional BufferSource input, optional TextDecodeOptions options);
+};
+
+TextDecoderStream includes TextDecoderAttributes;
+TextDecoderStream includes GenericTransformStream;
+</pre>
+
+<p>A {{TextDecoderStream}} object has an associated <dfn for=TextDecoderStream>encoding</dfn>,
+<dfn for=TextDecoderStream>decoder</dfn>, <dfn for=TextDecoderStream>stream</dfn>,
+<dfn for=TextDecoderStream>ignore BOM flag</dfn> (initially unset),
+<dfn for=TextDecoderStream>BOM seen flag</dfn> (initially unset),
+<dfn for=TextDecoderStream>error mode</dfn> (initially "<code>replacement</code>"),
+<dfn for=TextDecoderStream>do not flush flag</dfn> (initially unset), and
+<dfn for=TextDecoderStream>transform</dfn>.
Done.
> +
+<pre class=idl>
+interface mixin TextDecoderAttributes {
+ readonly attribute DOMString encoding;
+ readonly attribute boolean fatal;
+ readonly attribute boolean ignoreBOM;
+};
+</pre>
+
+<p>The {{TextDecoderAttributes}} mixin defines common attributes that are shared between
+{{TextDecoder}} and {{TextDecoderStream}}. These objects have an associated
+<dfn for=TextDecoderAttributes>encoding</dfn>, <dfn for=TextDecoderAttributes>ignore BOM flag</dfn>,
+and <dfn for=TextDecoderAttributes>error mode</dfn>.
+
+<p>The <dfn attribute for=TextDecoderAttributes><code>encoding</code></dfn> attribute's getter must
+return <a for=TextDecoderAttributes>encoding</a>'s <a for=encoding>name</a> in <a>ASCII
I've added it to the accessors, but I will probably need to add it some of the algorithms as well.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/pull/149#discussion_r207549480
Received on Friday, 3 August 2018 15:07:50 UTC