1 import { isIE } from "../var/isIE.js";
2 import { whitespace } from "../var/whitespace.js";
3 import { support } from "./support.js";
6 // Regex strategy adopted from Diego Perini.
7 export var rbuggyQSA = [];
12 // Support: IE 9 - 11+
13 // IE's :disabled selector does not pick up the children of disabled fieldsets
18 // IE 11 doesn't find elements on a `[name='']` query in some cases.
19 // Adding a temporary attribute to the document before the selection works
21 "\\[" + whitespace + "*name" + whitespace + "*=" +
22 whitespace + "*(?:''|\"\")"
26 if ( !support.cssHas ) {
28 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
29 // Our regular `try-catch` mechanism fails to detect natively-unsupported
30 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
31 // in browsers that parse the `:has()` argument as a forgiving selector list.
32 // https://drafts.csswg.org/selectors/#relational now requires the argument
33 // to be parsed unforgivingly, but browsers have not yet fully adjusted.
34 rbuggyQSA.push( ":has" );
37 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );