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

@ -243,7 +243,7 @@ WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
// The third child element is either a link or style element with the following styles for the default summary:
auto style = TRY(DOM::create_element(document(), HTML::TagNames::style, Namespace::HTML));
style->set_text_content(R"~~~(
MUST(style->set_text_content(R"~~~(
:host summary {
display: list-item;
counter-increment: list-item 0;
@ -252,7 +252,7 @@ WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
:host([open]) summary {
list-style-type: disclosure-open;
}
)~~~"_utf16);
)~~~"_utf16));
MUST(shadow_root->append_child(style));
m_summary_slot = static_cast<HTML::HTMLSlotElement&>(*summary_slot);