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

Polymer alters the results of scoped queries in querySelectorAll #508

Closed
hubgit opened this issue May 19, 2014 · 1 comment
Closed

Polymer alters the results of scoped queries in querySelectorAll #508

hubgit opened this issue May 19, 2014 · 1 comment

Comments

@hubgit
Copy link

hubgit commented May 19, 2014

If the following is run in Chrome's JavaScript console on https://google.com/ (i.e. a page without Polymer present), it returns 18 matches from both selectors:

console.log(document.querySelectorAll('div').length + ' unscoped nodes');
console.log(document.querySelectorAll(':scope div').length + ' scoped nodes');

If the same code is run in the JavaScript console on http://www.polymer-project.org/ (i.e. a page where Polymer is included), it returns 0 results for the second, scoped selector.

Adding :scope to selectors is important when selecting descendants of a specific DOM element, so it's problematic that this breaks when Polymer is present.

@hubgit
Copy link
Author

hubgit commented May 19, 2014

Filed in polymer/ShadowDOM instead.

@hubgit hubgit closed this as completed May 19, 2014
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

1 participant