servo: Merge #12214 - Skip the root node in querySelectorAll (from nox:queryselector); r=Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 3c51290f9e3bb5a1b4118671f24fba219abeabc8
This commit is contained in:
Anthony Ramine 2016-07-04 05:53:14 -07:00
Родитель a3dd321d7e
Коммит fb4a37ba95
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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))
}
}
}