mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02: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
Notes:
sideshowbarker
2024-07-17 02:35:27 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/c57d395a48 Pull-request: https://github.com/SerenityOS/serenity/pull/24207 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/shannonbooth ✅
@@ -174,12 +174,15 @@ Vector<JS::Handle<HTMLOptionElement>> HTMLSelectElement::list_of_options() const
|
||||
|
||||
for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement& option_element) {
|
||||
list.append(JS::make_handle(option_element));
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
for_each_child_of_type<HTMLOptGroupElement>([&](HTMLOptGroupElement const& optgroup_element) {
|
||||
optgroup_element.for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement& option_element) {
|
||||
list.append(JS::make_handle(option_element));
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user