1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibWeb: Port TextDecoder interface from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-09-06 16:06:53 +12:00 committed by Tim Flynn
parent 41928c2902
commit 278061e8b9
3 changed files with 10 additions and 10 deletions

View file

@ -21,24 +21,24 @@ class TextDecoder : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(TextDecoder, Bindings::PlatformObject);
public:
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, DeprecatedFlyString encoding);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, FlyString encoding);
virtual ~TextDecoder() override;
WebIDL::ExceptionOr<DeprecatedString> decode(Optional<JS::Handle<JS::Object>> const&) const;
WebIDL::ExceptionOr<String> decode(Optional<JS::Handle<JS::Object>> const&) const;
DeprecatedFlyString const& encoding() const { return m_encoding; }
FlyString const& encoding() const { return m_encoding; }
bool fatal() const { return m_fatal; }
bool ignore_bom() const { return m_ignore_bom; }
private:
// https://encoding.spec.whatwg.org/#dom-textdecoder
TextDecoder(JS::Realm&, TextCodec::Decoder&, DeprecatedFlyString encoding, bool fatal, bool ignore_bom);
TextDecoder(JS::Realm&, TextCodec::Decoder&, FlyString encoding, bool fatal, bool ignore_bom);
virtual void initialize(JS::Realm&) override;
TextCodec::Decoder& m_decoder;
DeprecatedFlyString m_encoding;
FlyString m_encoding;
bool m_fatal { false };
bool m_ignore_bom { false };
};