@@ -10,7 +10,47 @@ import { type DeclarationPlain, type PseudoClassSelectorPlain } from '@adguard/e
1010import { REMOVE_PROPERTY , REMOVE_VALUE } from '../common/constants' ;
1111import { defineRule , LinterRuleType } from '../linter/rule' ;
1212
13- import { SUPPORTED_EXT_CSS_PSEUDO_CLASSES } from './no-unsupported-css-pseudo-class' ;
13+ /**
14+ * Supported Extended CSS pseudo-classes.
15+ *
16+ * These pseudo-classes are not supported by browsers natively, so we need Extended CSS library to support them.
17+ *
18+ * Please keep this list sorted alphabetically.
19+ */
20+ export const SUPPORTED_EXT_CSS_PSEUDO_CLASSES = new Set ( [
21+ /**
22+ * Pseudo-classes :is(), and :not() may use native implementation.
23+ *
24+ * @see {@link https://github.com/AdguardTeam/ExtendedCss#extended-css-is }
25+ * @see {@link https://github.com/AdguardTeam/ExtendedCss#extended-css-not }
26+ */
27+ /**
28+ * :has() should also be conditionally considered as extended and should not be in this list,
29+ * for details check: https://github.com/AdguardTeam/ExtendedCss#extended-css-has,
30+ * but there is a bug with content blocker in safari:
31+ * for details check: https://bugs.webkit.org/show_bug.cgi?id=248868.
32+ *
33+ * TODO: remove 'has' later.
34+ */
35+ '-abp-contains' , // alias for 'contains'
36+ '-abp-has' , // alias for 'has'
37+ 'contains' ,
38+ 'has' , // some browsers support 'has' natively
39+ 'has-text' , // alias for 'contains'
40+ 'if' ,
41+ 'if-not' ,
42+ 'matches-attr' ,
43+ 'matches-css' ,
44+ 'matches-css-after' , // deprecated, replaced by 'matches-css'
45+ 'matches-css-before' , // deprecated, replaced by 'matches-css'
46+ 'matches-property' ,
47+ 'nth-ancestor' ,
48+ 'remove' ,
49+ 'upward' ,
50+ 'xpath' ,
51+ 'style' ,
52+ 'matches-media' ,
53+ ] ) ;
1454
1555export default defineRule ( {
1656 meta : {
0 commit comments