LibWeb: Port node text content to UTF-16

This commit is contained in:
Timothy Flynn 2025-07-28 09:46:06 -04:00 committed by Jelle Raaijmakers
commit 5c561c1a53
Notes: github-actions[bot] 2025-07-28 16:32:35 +00:00
35 changed files with 147 additions and 123 deletions

View file

@ -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