mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
LibWeb: Use IterationDecision in single level Node iteration methods
`Node::for_each_child()` and `Node::for_each_child_of_type()` callbacks now return an `IterationDecision`, which allows us to break early if required.
This commit is contained in:
committed by
Andrew Kaster
parent
b5bed37074
commit
c57d395a48
@@ -4418,7 +4418,8 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node, DOM::FragmentS
|
||||
if (is<DOM::Element>(current_node)) {
|
||||
// -> If current node is an Element
|
||||
auto& element = verify_cast<DOM::Element>(current_node);
|
||||
return serialize_element(element);
|
||||
serialize_element(element);
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (is<DOM::Text>(current_node)) {
|
||||
@@ -4440,7 +4441,6 @@ String HTMLParser::serialize_html_fragment(DOM::Node const& node, DOM::FragmentS
|
||||
|
||||
// 2. Otherwise, append the value of current node's data IDL attribute, escaped as described below.
|
||||
builder.append(escape_string(text_node.data(), AttributeMode::No));
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (is<DOM::Comment>(current_node)) {
|
||||
|
||||
Reference in New Issue
Block a user