mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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:
parent
887537b061
commit
2fa84f1683
Notes:
github-actions[bot]
2025-10-27 16:16:17 +00:00
Author: https://github.com/tete17
Commit: 2fa84f1683
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6057
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Lubrsi ✅
7 changed files with 19 additions and 19 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue