mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-06 16:19:40 +00:00
LibWeb: Port node text content to UTF-16
This commit is contained in:
parent
27a4c1eaf6
commit
5c561c1a53
Notes:
github-actions[bot]
2025-07-28 16:32:35 +00:00
Author: https://github.com/trflynn89
Commit: 5c561c1a53
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5627
Reviewed-by: https://github.com/gmta ✅
35 changed files with 147 additions and 123 deletions
|
@ -50,7 +50,7 @@ GC::Ref<DOM::DOMTokenList> HTMLOutputElement::html_for()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-output-defaultvalue
|
||||
String HTMLOutputElement::default_value() const
|
||||
Utf16String HTMLOutputElement::default_value() const
|
||||
{
|
||||
// 1. If this element's default value override is non-null, then return it.
|
||||
if (m_default_value_override.has_value())
|
||||
|
@ -61,7 +61,7 @@ String HTMLOutputElement::default_value() const
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-output-defaultvalue
|
||||
void HTMLOutputElement::set_default_value(String const& default_value)
|
||||
void HTMLOutputElement::set_default_value(Utf16String const& default_value)
|
||||
{
|
||||
// 1. If this's default value override is null, then string replace all with the given value within this and return.
|
||||
if (!m_default_value_override.has_value()) {
|
||||
|
@ -77,7 +77,7 @@ void HTMLOutputElement::set_default_value(String const& default_value)
|
|||
Utf16String HTMLOutputElement::value() const
|
||||
{
|
||||
// The value getter steps are to return this's descendant text content.
|
||||
return Utf16String::from_utf8(descendant_text_content());
|
||||
return descendant_text_content();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-output-value
|
||||
|
@ -87,7 +87,7 @@ void HTMLOutputElement::set_value(Utf16String const& value)
|
|||
m_default_value_override = default_value();
|
||||
|
||||
// 2. String replace all with the given value within this.
|
||||
string_replace_all(value.to_utf8_but_should_be_ported_to_utf16());
|
||||
string_replace_all(value);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#the-output-element:concept-form-reset-control
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue