mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Extract the TextEncoderCommon mixin to its own IDL file
Co-Authored-By: Tim Flynn <trflynn89@pm.me>
This commit is contained in:
parent
c14d5f27f9
commit
24d5f24749
Notes:
github-actions[bot]
2025-02-07 16:05:58 +00:00
Author: https://github.com/Lubrsi
Commit: 24d5f24749
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3481
Reviewed-by: https://github.com/trflynn89 ✅
7 changed files with 57 additions and 14 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/RefCounted.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/Encoding/TextEncoderCommon.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/WebIDL/Buffers.h>
|
||||
#include <LibWeb/WebIDL/Types.h>
|
||||
|
@ -24,7 +25,9 @@ struct TextEncoderEncodeIntoResult {
|
|||
};
|
||||
|
||||
// https://encoding.spec.whatwg.org/#textencoder
|
||||
class TextEncoder final : public Bindings::PlatformObject {
|
||||
class TextEncoder final
|
||||
: public Bindings::PlatformObject
|
||||
, public TextEncoderCommonMixin {
|
||||
WEB_PLATFORM_OBJECT(TextEncoder, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(TextEncoder);
|
||||
|
||||
|
@ -36,8 +39,6 @@ public:
|
|||
GC::Ref<JS::Uint8Array> encode(String const& input) const;
|
||||
TextEncoderEncodeIntoResult encode_into(String const& source, GC::Root<WebIDL::BufferSource> const& destination) const;
|
||||
|
||||
static FlyString const& encoding();
|
||||
|
||||
protected:
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
explicit TextEncoder(JS::Realm&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue