Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the root node in querySelectorAll #12214

Merged
merged 1 commit into from Jul 4, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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() {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.