mirror of
https://github.com/servo/servo.git
synced 2025-07-16 20:03:39 +01:00
Auto merge of #12214 - nox:queryselector, r=Ms2ger
Skip the root node in querySelectorAll <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12214) <!-- Reviewable:end -->
This commit is contained in:
commit
3c51290f9e
4 changed files with 5 additions and 14 deletions
|
@ -740,7 +740,10 @@ impl Node {
|
|||
Err(()) => Err(Error::Syntax),
|
||||
// Step 3.
|
||||
Ok(selectors) => {
|
||||
Ok(QuerySelectorIterator::new(self.traverse_preorder(), selectors))
|
||||
let mut descendants = self.traverse_preorder();
|
||||
// Skip the root of the tree.
|
||||
assert!(&*descendants.next().unwrap() == self);
|
||||
Ok(QuerySelectorIterator::new(descendants, selectors))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
[ParentNode-querySelector-All-xht.xht]
|
||||
type: testharness
|
||||
[Detached Element.querySelectorAll tree order]
|
||||
expected: FAIL
|
||||
|
||||
[In-document Element.querySelectorAll tree order]
|
||||
expected: FAIL
|
||||
|
||||
[Document.querySelectorAll: Attribute whitespace-separated list selector, not matching class attribute with empty value: #attr-whitespace [class~=""\]]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
[ParentNode-querySelector-All.html]
|
||||
type: testharness
|
||||
[Detached Element.querySelectorAll tree order]
|
||||
expected: FAIL
|
||||
|
||||
[In-document Element.querySelectorAll tree order]
|
||||
expected: FAIL
|
||||
|
||||
[Document.querySelectorAll: Attribute whitespace-separated list selector, not matching class attribute with empty value: #attr-whitespace [class~=""\]]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
assert_equals(nodelist.length, 3);
|
||||
|
||||
nodelist = div.querySelectorAll("div:nth-of-type(1)");
|
||||
assert_equals(nodelist.item(0), div);
|
||||
assert_equals(nodelist.item(0), div.firstElementChild);
|
||||
}, "Element");
|
||||
|
||||
test(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue