mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Propagate exception if serializing inner node fails
Fixing a crash for the given test.
This commit is contained in:
parent
fd32f17c56
commit
472b56b47c
Notes:
github-actions[bot]
2024-11-01 18:03:09 +00:00
Author: https://github.com/shannonbooth
Commit: 472b56b47c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2103
Reviewed-by: https://github.com/awesomekling
3 changed files with 44 additions and 4 deletions
|
@ -1568,11 +1568,10 @@ WebIDL::ExceptionOr<String> Node::serialize_fragment(DOMParsing::RequireWellForm
|
|||
// For inner, concatenate the serialization of all children.
|
||||
if (fragment_serialization_mode == FragmentSerializationMode::Inner) {
|
||||
StringBuilder markup;
|
||||
for_each_child([&markup, require_well_formed](auto& child) {
|
||||
auto child_markup = DOMParsing::serialize_node_to_xml_string(child, require_well_formed).release_value_but_fixme_should_propagate_errors();
|
||||
for (auto* child = first_child(); child; child = child->next_sibling()) {
|
||||
auto child_markup = TRY(DOMParsing::serialize_node_to_xml_string(*child, require_well_formed));
|
||||
markup.append(child_markup.bytes_as_string_view());
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
return MUST(markup.to_string());
|
||||
}
|
||||
return DOMParsing::serialize_node_to_xml_string(*this, require_well_formed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue