mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +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
@@ -45,10 +45,10 @@ WebIDL::ExceptionOr<JS::GCPtr<Element>> ParentNode::query_selector(StringView se
|
||||
for (auto& selector : selectors) {
|
||||
if (SelectorEngine::matches(selector, {}, element, {}, this)) {
|
||||
result = &element;
|
||||
return IterationDecision::Break;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
return result;
|
||||
@@ -79,7 +79,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<NodeList>> ParentNode::query_selector_all(S
|
||||
elements.append(&element);
|
||||
}
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
return StaticNodeList::create(realm(), move(elements));
|
||||
|
||||
Reference in New Issue
Block a user