mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
script: fix querySelector
returning the root (#33174)
Signed-off-by: Nolan Lawson <nolan@nolanlawson.com>
This commit is contained in:
parent
c79d9e68a3
commit
67e2bb0ee6
3 changed files with 4 additions and 9 deletions
|
@ -982,8 +982,10 @@ impl Node {
|
||||||
NeedsSelectorFlags::No,
|
NeedsSelectorFlags::No,
|
||||||
MatchingForInvalidation::No,
|
MatchingForInvalidation::No,
|
||||||
);
|
);
|
||||||
Ok(self
|
let mut descendants = self.traverse_preorder(ShadowIncluding::No);
|
||||||
.traverse_preorder(ShadowIncluding::No)
|
// Skip the root of the tree.
|
||||||
|
assert!(&*descendants.next().unwrap() == self);
|
||||||
|
Ok(descendants
|
||||||
.filter_map(DomRoot::downcast)
|
.filter_map(DomRoot::downcast)
|
||||||
.find(|element| matches_selector_list(&selectors, element, &mut ctx)))
|
.find(|element| matches_selector_list(&selectors, element, &mut ctx)))
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,8 +8,5 @@
|
||||||
[querySelector with :scope]
|
[querySelector with :scope]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[querySelector with id and sibling]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[querySelectorAll with :scope]
|
[querySelectorAll with :scope]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[ParentNode-querySelectors-exclusive.html]
|
|
||||||
[querySelector/querySelectorAll should not include their thisArg]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue