mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-06-18 07:43:37 +00:00
This mirrors the existing TextEncoderCommon split and lets a future TextDecoderStream share the same encoding/fatal/ignoreBOM state with TextDecoder. The state (decoder reference, encoding name, error mode, ignore-BOM flag, and BOM-seen flag) all moves into a TextDecoderCommonMixin base class so both interfaces can inherit it.
20 lines
647 B
Text
20 lines
647 B
Text
// https://encoding.spec.whatwg.org/#textdecoderoptions
|
|
dictionary TextDecoderOptions {
|
|
boolean fatal = false;
|
|
boolean ignoreBOM = false;
|
|
};
|
|
|
|
// https://encoding.spec.whatwg.org/#textdecodeoptions
|
|
dictionary TextDecodeOptions {
|
|
boolean stream = false;
|
|
};
|
|
|
|
// https://encoding.spec.whatwg.org/#textdecoder
|
|
[Exposed=*]
|
|
interface TextDecoder {
|
|
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
|
|
|
|
// FIXME: BufferSource is really a AllowSharedBufferSource
|
|
USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
|
|
};
|
|
TextDecoder includes TextDecoderCommon;
|