mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibWeb: Port Node interface from DeprecatedString to String
Which is fortunately quite straight forward :^)
This commit is contained in:
parent
a76ef04ae6
commit
8ce9e51c97
21 changed files with 50 additions and 45 deletions
|
@ -108,7 +108,7 @@ Optional<ARIA::Role> HTMLAnchorElement::default_role() const
|
|||
String HTMLAnchorElement::text() const
|
||||
{
|
||||
// The text attribute's getter must return this element's descendant text content.
|
||||
return MUST(String::from_deprecated_string(descendant_text_content()));
|
||||
return descendant_text_content();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#dom-a-text
|
||||
|
|
|
@ -137,7 +137,7 @@ String HTMLElement::inner_text()
|
|||
// innerText for element being rendered takes visibility into account, so force a layout and then walk the layout tree.
|
||||
document().update_layout();
|
||||
if (!layout_node())
|
||||
return MUST(String::from_deprecated_string(text_content()));
|
||||
return text_content().value_or(String {});
|
||||
|
||||
Function<void(Layout::Node const&)> recurse = [&](auto& node) {
|
||||
for (auto* child = node.first_child(); child; child = child->next_sibling()) {
|
||||
|
|
|
@ -106,7 +106,7 @@ void HTMLTextAreaElement::create_shadow_tree_if_needed()
|
|||
m_text_node->set_editable_text_node_owner(Badge<HTMLTextAreaElement> {}, *this);
|
||||
// NOTE: If `children_changed()` was called before now, `m_raw_value` will hold the text content.
|
||||
// Otherwise, it will get filled in whenever that does get called.
|
||||
m_text_node->set_text_content(m_raw_value);
|
||||
m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
|
||||
|
||||
MUST(m_inner_text_element->append_child(*m_text_node));
|
||||
MUST(element->append_child(*m_inner_text_element));
|
||||
|
@ -122,7 +122,7 @@ void HTMLTextAreaElement::children_changed()
|
|||
if (!m_dirty) {
|
||||
m_raw_value = child_text_content();
|
||||
if (m_text_node)
|
||||
m_text_node->set_text_content(m_raw_value);
|
||||
m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue