Commit graph

2 commits

Author SHA1 Message Date
Shannon Booth
ef6753a9f9 LibWeb+LibTextCodec: Wire decoder options through TextDecoder
Add explicit IgnoreBOM and ErrorMode options to LibTextCodec decoders,
and thread them through TextDecoder and TextDecoderStream.

This lets Web-facing decoder APIs preserve BOMs when requested and use
fatal error handling without post-processing decoded output.

NB: RemoveBOM was renamed to IgnoreBOM as "RemoveBOM" is the name
used by encoding_rs and was previously an implementation detail.
The new name matches what is used by the encoding standard as it
is now also used in LibWeb.
2026-06-23 07:25:11 +02:00
Andreas Kling
e629e6a323 LibWeb: Extract TextDecoderCommon mixin into its own files
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.
2026-04-28 19:17:09 +02:00