mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Use TraversalDecision for multi level Node traversal methods
This adds the `SkipChildrenAndContinue` option, where traversal continues but child nodes are not included.
This commit is contained in:
committed by
Andrew Kaster
parent
c57d395a48
commit
398bf10b92
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/398bf10b92 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 ✅
@@ -46,9 +46,9 @@ JS::GCPtr<HTMLElement> HTMLLabelElement::control() const
|
||||
for_each_in_inclusive_subtree_of_type<HTMLElement>([&](auto& element) {
|
||||
if (element.id() == *for_() && element.is_labelable()) {
|
||||
control = &const_cast<HTMLElement&>(element);
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
return control;
|
||||
}
|
||||
@@ -58,9 +58,9 @@ JS::GCPtr<HTMLElement> HTMLLabelElement::control() const
|
||||
for_each_in_subtree_of_type<HTMLElement>([&](auto& element) {
|
||||
if (element.is_labelable()) {
|
||||
control = &const_cast<HTMLElement&>(element);
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
return control;
|
||||
|
||||
Reference in New Issue
Block a user