-
-
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: v20.11.1
- jsdom version: 24.0.0
jsdom v23.2.0 didn't show this issue.
Minimal reproduction case
const { JSDOM } = require("jsdom");
const dom = new JSDOM('');
dom.window.document.querySelector(`:is([a],b):not(.c)`)
// Uncaught DOMException [SyntaxError]: '[a],b):not(.c' is not a valid selector
dom.window.document.querySelector(`:is(a,[b]):not(.c)`);
// Uncaught DOMException [SyntaxError]: 'a,[b]):not(.c' is not a valid selector
// the followings work
dom.window.document.querySelector(`:is(a,b):not(.c)`);
dom.window.document.querySelector(`:is(a,b):not([c])`);
dom.window.document.querySelector(`:is(a):not([b],.c)`);
dom.window.document.querySelector(`:is(a,[b])`);
dom.window.document.querySelector(`:is(a,[b]):first-child`);
dom.window.document.querySelector(`:is([b]):not(.c)`);
How does similar code behave in browsers?
They don't throw the error.
Metadata
Metadata
Assignees
Labels
selectorsCSS Selectors supportCSS Selectors support