mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
22
Libraries/LibWeb/Encoding/TextEncoderCommon.cpp
Normal file
22
Libraries/LibWeb/Encoding/TextEncoderCommon.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Encoding/TextEncoderCommon.h>
|
||||
|
||||
namespace Web::Encoding {
|
||||
|
||||
TextEncoderCommonMixin::TextEncoderCommonMixin() = default;
|
||||
TextEncoderCommonMixin::~TextEncoderCommonMixin() = default;
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder-encoding
|
||||
FlyString const& TextEncoderCommonMixin::encoding() const
|
||||
{
|
||||
// The encoding getter steps are to return "utf-8".
|
||||
static FlyString const encoding = "utf-8"_fly_string;
|
||||
return encoding;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user