-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
has to-upstream testThis bug has a failing to-upstream web platform test waiting to be fixedThis bug has a failing to-upstream web platform test waiting to be fixedmetr upliftA candidate for the METR Uplift experimentA candidate for the METR Uplift experimentselectorsCSS Selectors supportCSS Selectors support
Description
Basic info:
- Node.js version: 18.8.0
- jsdom version: 20.0.0
Minimal reproduction case
const { JSDOM } = require("jsdom");
const dom = new JSDOM(`
<button>hi</button>
<input type="submit" value="weee" />
`);
dom.window.document.querySelector(':is(:is(input), button)');
This throws the following exception:
/node_modules/nwsapi/src/nwsapi.js:572
throw err;
^
DOMException [SyntaxError]: ':is(:is(input), button)' is not a valid selector
at emit (/node_modules/nwsapi/src/nwsapi.js:570:17)
at compileSelector (/node_modules/nwsapi/src/nwsapi.js:1310:11)
at compile (/node_modules/nwsapi/src/nwsapi.js:758:16)
at collect (/node_modules/nwsapi/src/nwsapi.js:1563:22)
at _querySelectorAll (/node_modules/nwsapi/src/nwsapi.js:1523:36)
at Object._querySelector [as first] (/node_modules/nwsapi/src/nwsapi.js:1429:14)
at DocumentImpl.querySelector (/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js:69:44)
at Document.querySelector (/node_modules/jsdom/lib/jsdom/living/generated/Document.js:1026:58)
at Object.<anonymous> (/test.js:8:21)
at Module._compile (node:internal/modules/cjs/loader:1119:14)
Node.js v18.8.0
Process finished with exit code 1
The selector that i was using that triggered the fail was: :is(:is(button, input)[type=submit], button:not([type])):not([disabled])
How does similar code behave in browsers?
This selector works perfectly in Chrome 105.0.5195.102 and Firefox 104.0.1
ale-cci, david-tejada and shirakaba
Metadata
Metadata
Assignees
Labels
has to-upstream testThis bug has a failing to-upstream web platform test waiting to be fixedThis bug has a failing to-upstream web platform test waiting to be fixedmetr upliftA candidate for the METR Uplift experimentA candidate for the METR Uplift experimentselectorsCSS Selectors supportCSS Selectors support