LibWeb: Properly propagate errors for Node set_text_content

This function was supposed to throw errors even before the TrustedTypes
spec thanks to the CharacterData replaceData call but had a MUST.

This changes this to ensure this function can throw an error
This commit is contained in:
Tete17 2025-08-08 02:25:57 +02:00 committed by Luke Wilde
parent 887537b061
commit 2fa84f1683
Notes: github-actions[bot] 2025-10-27 16:16:17 +00:00
7 changed files with 19 additions and 19 deletions

View file

@ -117,7 +117,7 @@ void HTMLTextAreaElement::reset_algorithm()
set_raw_value(child_text_content());
if (m_text_node) {
m_text_node->set_text_content(m_raw_value);
MUST(m_text_node->set_text_content(m_raw_value));
update_placeholder_visibility();
}
}
@ -350,7 +350,7 @@ void HTMLTextAreaElement::create_shadow_tree_if_needed()
m_text_node = realm().create<DOM::Text>(document(), Utf16String {});
// 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);
MUST(m_text_node->set_text_content(m_raw_value));
handle_maxlength_attribute();
MUST(m_inner_text_element->append_child(*m_text_node));
@ -403,7 +403,7 @@ void HTMLTextAreaElement::children_changed(ChildrenChangedMetadata const* metada
if (!m_dirty_value) {
set_raw_value(child_text_content());
if (m_text_node)
m_text_node->set_text_content(m_raw_value);
MUST(m_text_node->set_text_content(m_raw_value));
update_placeholder_visibility();
}
}