aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector/support.js
blob: ea9f240503b8fb85bd9a10a95ba884e4088e7b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import support from "../var/support.js";

try {
	/* eslint-disable no-undef */

	// Support: Chrome 105+, Firefox <106, Safari 15.4+
	// Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`.
	//
	// `:is()` uses a forgiving selector list as an argument and is widely
	// implemented, so it's a good one to test against.
	support.cssSupportsSelector = CSS.supports( "selector(*)" ) &&

		// `*` is needed as Safari & newer Chrome implemented something in between
		// for `:has()` - it throws in `qSA` if it only contains an unsupported
		// argument but multiple ones, one of which is supported, are fine.
		// We want to play safe in case `:is()` gets the same treatment.
		!CSS.supports( "selector(:is(*,:jqfake))" );

	/* eslint-enable */
} catch ( e ) {
	support.cssSupportsSelector = false;
}

export default support;