mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Skip the root node in querySelectorAll
This accounts for https://github.com/whatwg/dom/issues/263.
This commit is contained in:
parent
110fd68610
commit
345eee92e8
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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue