-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
selectorsCSS Selectors supportCSS Selectors support
Description
Basic info:
- Node.js version: v14.2.0 (local), v10.21.0 (Runkit)
- jsdom version: 16.3.0
Minimal reproduction case
let { JSDOM } = require('jsdom');
let doc = new JSDOM(`
<h2>Heading</h2>
<h3>Subheading</h3>
`).window.document;
console.log([...doc.querySelectorAll('h2,h3')]); // => 2 elements
console.log([...doc.querySelectorAll(':matches(h2,h3)')]); // => 0 elements
How does similar code behave in browsers?
In Firefox 78, which supports the :is()
selector, both queries result in two elements. Safari, for :matches()
, and Chrome, for :-webkit-any()
, give the same result.
I know things are still in flux in regards to the :is()
and :where()
pseudo-classes, but since the :matches()
selector exists in JSDOM it is suprising behavior.
Metadata
Metadata
Assignees
Labels
selectorsCSS Selectors supportCSS Selectors support