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

@ -296,7 +296,7 @@ static WebIDL::ExceptionOr<GC::Ref<DOM::Document>> load_media_document(HTML::Nav
};
auto style_element = TRY(DOM::create_element(document, HTML::TagNames::style, Namespace::HTML));
style_element->set_text_content(R"~~~(
MUST(style_element->set_text_content(R"~~~(
:root {
background-color: #222;
}
@ -310,7 +310,7 @@ static WebIDL::ExceptionOr<GC::Ref<DOM::Document>> load_media_document(HTML::Nav
img {
background-color: #fff;
}
)~~~"_utf16);
)~~~"_utf16));
TRY(document->head()->append_child(style_element));
auto url_string = document->url_string();