1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibWeb: Add namespaces to Universal and TagName selectors

This commit is contained in:
Sam Atkins 2023-08-08 15:11:48 +01:00 committed by Sam Atkins
parent 6c2ed0f51b
commit 1858f06881
13 changed files with 245 additions and 49 deletions

View file

@ -39,7 +39,7 @@ WebIDL::ExceptionOr<JS::GCPtr<Element>> ParentNode::query_selector(StringView se
// FIXME: This should be shadow-including. https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree
for_each_in_subtree_of_type<Element>([&](auto& element) {
for (auto& selector : selectors) {
if (SelectorEngine::matches(selector, element, {}, this)) {
if (SelectorEngine::matches(selector, {}, element, {}, this)) {
result = &element;
return IterationDecision::Break;
}
@ -71,7 +71,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<NodeList>> ParentNode::query_selector_all(S
// FIXME: This should be shadow-including. https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree
for_each_in_subtree_of_type<Element>([&](auto& element) {
for (auto& selector : selectors) {
if (SelectorEngine::matches(selector, element, {}, this)) {
if (SelectorEngine::matches(selector, {}, element, {}, this)) {
elements.append(&element);
}
}