querySelectorAll throws a syntax error when using the :scope selector
See original GitHub issueThe following test-case works in browsers which support the :scope
selector, but fails in jsdom:
http://jsbin.com/vozebogoja/edit?html,js,output
The error message:
SyntaxError
at HTMLUListElementImpl.<anonymous> (/test/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js:83:11)
at HTMLUListElementImpl.querySelectorAll (/test/node_modules/jsdom/lib/jsdom/utils.js:133:45)
at HTMLUListElement.querySelectorAll (/test/node_modules/jsdom/lib/jsdom/living/generated/ParentNode.js:39:62)
at Object.<anonymous> (/test/t.js:15:4)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Uncaught SyntaxError: Failed to execute 'querySelector' on ...
In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 ...
Read more >querySelectorAll throws SyntaxError for attribute selector with ...
Summary: querySelectorAll throws SyntaxError for valid attribute selector → querySelectorAll throws SyntaxError for attribute selector with missing ']' ...
Read more >Avoid Errors With document.querySelector ... - | Ryan Dejaegher
When querySelector doesn't find a matching selector, the value of the variable will be null . For example: var missingElement = document.
Read more >Element.querySelectorAll() - Web APIs
This string must be a valid CSS selector string; if it's not, a SyntaxError exception is thrown. See Locating DOM elements using selectors...
Read more >609415 - Error messages from parentNode.querySelector() do ...
https://dom.spec.whatwg.org/#scope-match-a-selectors-string ... It is throwing SyntaxError error only as per below code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am currently working on additional Selector Level 4 compatibility. :scope is one of the targeted features I will add asap.
We have support for the
:scope
selector now. https://github.com/jsdom/jsdom/issues/2359 covers adding more tests for it.