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

Incorrect results when using querySelectorAll on elements #31

Closed
fortes opened this issue Apr 25, 2013 · 0 comments
Closed

Incorrect results when using querySelectorAll on elements #31

fortes opened this issue Apr 25, 2013 · 0 comments

Comments

@fortes
Copy link
Contributor

fortes commented Apr 25, 2013

var domino = require('domino'),
    window, document, heading;

window = domino.createWindow("<h1>First</h1><h1>Second</h1>");
document = window.document;
heading = document.body.querySelector('h1');
// Expect 0, result 1
console.log(heading.querySelectorAll('h1').length);

Looks like QSA is getting run on document.body instead of heading. This is with Node 0.10.5

cscott added a commit that referenced this issue May 2, 2013
The upstream Element.nextElement(root) method was failing when root had
no children -- it was returning root's siblings, even though it was supposed
to restrict itself to root's descendants.

This caused Element.getElementsByTagName() and Element.querySelectorAll()
(and other related methods) to return incorrect results when invoked on
elements with no children.

Closes gh #32, gh #31.
@cscott cscott closed this as completed May 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants