Files
ladybird/Libraries/LibWeb/Encoding/TextDecoderStream.idl
Andreas Kling d48db4e881 LibWeb: Implement TextDecoderStream
This is the streaming counterpart to TextDecoder, used by sites that
process responses with `pipeThrough(new TextDecoderStream())` or that
otherwise consume a Response body as decoded text.

The transform algorithm appends each chunk's bytes to the I/O queue
and decodes them via the underlying LibTextCodec decoder, holding back
any trailing partial UTF-8 sequence so chunk boundaries don't produce
spurious replacement characters. The flush algorithm emits a single
replacement character if a partial sequence was still pending. For
non-UTF-8 encodings the underlying decoders are stateless across
calls, so each chunk is decoded in full with nothing carried over.
2026-04-28 19:17:09 +02:00

9 lines
293 B
Plaintext

// https://encoding.spec.whatwg.org/#textdecoderstream
[Exposed=*]
interface TextDecoderStream {
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
};
TextDecoderStream includes TextDecoderCommon;
TextDecoderStream includes GenericTransformStream;