LibWeb/HTML: Implement text attribute in HTMLTitleElement

This commit is contained in:
Kemal Zebari 2023-12-01 18:59:08 -08:00 committed by Andreas Kling
parent d6df13af6a
commit 24b9d05ea8
Notes: sideshowbarker 2024-07-16 20:39:14 +09:00
5 changed files with 48 additions and 19 deletions

View file

@ -34,4 +34,18 @@ void HTMLTitleElement::children_changed()
}
}
// https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
DeprecatedString HTMLTitleElement::text()
{
// The text attribute's getter must return this title element's child text content.
return child_text_content();
}
// https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
void HTMLTitleElement::set_text(String const& value)
{
// The text attribute's setter must string replace all with the given value within this title element.
string_replace_all(value.to_deprecated_string());
}
}