mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +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
@@ -85,6 +85,7 @@ static void concatenate_descendants_text_content(DOM::Node const* node, StringBu
|
||||
builder.append(verify_cast<DOM::Text>(node)->data());
|
||||
node->for_each_child([&](auto const& node) {
|
||||
concatenate_descendants_text_content(&node, builder);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,6 +99,7 @@ String HTMLOptionElement::text() const
|
||||
// script or SVG script elements.
|
||||
for_each_child([&](auto const& node) {
|
||||
concatenate_descendants_text_content(&node, builder);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
// Return the result of stripping and collapsing ASCII whitespace from the above concatenation.
|
||||
|
||||
Reference in New Issue
Block a user