mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00: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
@@ -561,7 +561,7 @@ Vector<JS::NonnullGCPtr<DOM::Element>> HTMLFormElement::get_submittable_elements
|
||||
submittable_elements.append(form_associated_element->form_associated_element_to_html_element());
|
||||
}
|
||||
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
return submittable_elements;
|
||||
@@ -1086,14 +1086,14 @@ FormAssociatedElement* HTMLFormElement::default_button()
|
||||
root().for_each_in_subtree([&](auto& node) {
|
||||
auto* form_associated_element = dynamic_cast<FormAssociatedElement*>(&node);
|
||||
if (!form_associated_element)
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
if (form_associated_element->form() == this && form_associated_element->is_submit_button()) {
|
||||
default_button = form_associated_element;
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
return default_button;
|
||||
|
||||
Reference in New Issue
Block a user