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:
Tim Ledbetter 2024-05-04 14:47:04 +01:00 committed by Andrew Kaster
parent c57d395a48
commit 398bf10b92
Notes: sideshowbarker 2024-07-17 08:59:18 +09:00
33 changed files with 229 additions and 215 deletions

View file

@ -1398,7 +1398,7 @@ void HTMLInputElement::set_checked_within_group()
document().for_each_in_inclusive_subtree_of_type<HTML::HTMLInputElement>([&](auto& element) {
if (element.checked() && &element != this && is_in_same_radio_button_group(*this, element))
element.set_checked(false, ChangeSource::User);
return IterationDecision::Continue;
return TraversalDecision::Continue;
});
}
@ -1425,9 +1425,9 @@ void HTMLInputElement::legacy_pre_activation_behavior()
document().for_each_in_inclusive_subtree_of_type<HTML::HTMLInputElement>([&](auto& element) {
if (element.checked() && is_in_same_radio_button_group(*this, element)) {
m_legacy_pre_activation_behavior_checked_element_in_group = &element;
return IterationDecision::Break;
return TraversalDecision::Break;
}
return IterationDecision::Continue;
return TraversalDecision::Continue;
});
set_checked_within_group();