stylelint-browser-compat 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +91 -0
- package/lib/at-rules/at_rules_name_set.js +16 -0
- package/lib/at-rules/collect_features.js +145 -0
- package/lib/at-rules/counter-style/collect_features.js +41 -0
- package/lib/at-rules/counter-style/descriptor_name_set.js +16 -0
- package/lib/at-rules/document/collect_features.js +46 -0
- package/lib/at-rules/document/regexp/collect_features.js +30 -0
- package/lib/at-rules/font-face/__font_type/collect_features.js +79 -0
- package/lib/at-rules/font-face/collect_features.js +67 -0
- package/lib/at-rules/font-face/descriptor_name_set.js +16 -0
- package/lib/at-rules/font-feature-values/at_rules_name_set.js +16 -0
- package/lib/at-rules/font-feature-values/collect_features.js +30 -0
- package/lib/at-rules/keyframes/collect_features.js +29 -0
- package/lib/at-rules/media/collect_features.js +118 -0
- package/lib/at-rules/media/media_feature_name_map.js +8 -0
- package/lib/at-rules/page/collect_features.js +82 -0
- package/lib/at-rules/page/descriptor_name_set.js +16 -0
- package/lib/at-rules/page/size/collect_features.js +55 -0
- package/lib/at-rules/property/collect_features.js +60 -0
- package/lib/at-rules/property/descriptor_name_set.js +16 -0
- package/lib/at-rules/scroll-timeline/collect_features.js +60 -0
- package/lib/at-rules/scroll-timeline/descriptor_name_set.js +16 -0
- package/lib/collect_features.js +69 -0
- package/lib/index.js +5 -0
- package/lib/is_supported.js +75 -0
- package/lib/options.js +20 -0
- package/lib/parse_browserslist_version.js +132 -0
- package/lib/properties/-moz-orient/collect_features.js +61 -0
- package/lib/properties/-moz-user-input/collect_features.js +71 -0
- package/lib/properties/animation-direction/collect_features.js +53 -0
- package/lib/properties/animation-timing-function/collect_features.js +51 -0
- package/lib/properties/appearance/collect_features.js +76 -0
- package/lib/properties/background/background-clip/collect_features.js +59 -0
- package/lib/properties/background/background-origin/collect_features.js +59 -0
- package/lib/properties/background/background-size/collect_features.js +106 -0
- package/lib/properties/background/collect_features.js +104 -0
- package/lib/properties/background/multiple_backgrounds/collect_features.js +39 -0
- package/lib/properties/background-attachment/collect_features.js +70 -0
- package/lib/properties/background-clip/collect_features.js +55 -0
- package/lib/properties/background-image/collect_features.js +133 -0
- package/lib/properties/background-image/svg_images/collect_features.js +58 -0
- package/lib/properties/background-origin/collect_features.js +42 -0
- package/lib/properties/background-position/collect_features.js +117 -0
- package/lib/properties/background-position-x/collect_features.js +36 -0
- package/lib/properties/background-position-y/collect_features.js +36 -0
- package/lib/properties/background-repeat/collect_features.js +102 -0
- package/lib/properties/background-repeat/round_space/collect_features.js +54 -0
- package/lib/properties/background-size/collect_features.js +38 -0
- package/lib/properties/block-size/collect_features.js +77 -0
- package/lib/properties/border-bottom-left-radius/border-bottom-right-radius/collect_features.js +57 -0
- package/lib/properties/border-bottom-left-radius/collect_features.js +57 -0
- package/lib/properties/border-bottom-right-radius/collect_features.js +57 -0
- package/lib/properties/border-radius/collect_features.js +61 -0
- package/lib/properties/border-top-left-radius/collect_features.js +57 -0
- package/lib/properties/border-top-right-radius/collect_features.js +57 -0
- package/lib/properties/box-shadow/collect_features.js +92 -0
- package/lib/properties/box-sizing/collect_features.js +39 -0
- package/lib/properties/caption-side/collect_features.js +38 -0
- package/lib/properties/clear/collect_features.js +38 -0
- package/lib/properties/clip-path/collect_features.js +65 -0
- package/lib/properties/collect_features.js +452 -0
- package/lib/properties/color-scheme/collect_features.js +52 -0
- package/lib/properties/property_name_set.js +16 -0
- package/lib/properties/transition/collect_features.js +33 -0
- package/lib/properties/transition-property/collect_features.js +38 -0
- package/lib/rule.js +125 -0
- package/lib/selectors/__attributes/collect_features.js +44 -0
- package/lib/selectors/__classes/collect_features.js +23 -0
- package/lib/selectors/__combinators/collect_features.js +91 -0
- package/lib/selectors/__ids/collect_features.js +23 -0
- package/lib/selectors/__pseudos/collect_features.js +228 -0
- package/lib/selectors/__pseudos/pseudo_selector_name_set.js +18 -0
- package/lib/selectors/__tags/collect_features.js +48 -0
- package/lib/selectors/__universal/collect_features.js +37 -0
- package/lib/selectors/active/non_a_elements/collect_features.js +38 -0
- package/lib/selectors/after/animation_and_transition_support/collect_features.js +43 -0
- package/lib/selectors/backdrop/dialog/collect_features.js +38 -0
- package/lib/selectors/before/animation_and_transition_support/collect_features.js +43 -0
- package/lib/selectors/collect_features.js +120 -0
- package/lib/selectors/cue/selector_argument/collect_features.js +26 -0
- package/lib/selectors/hostfunction/collect_features.js +26 -0
- package/lib/selectors/hover/collect_features.js +61 -0
- package/lib/selectors/invalid/collect_features.js +39 -0
- package/lib/selectors/marker/animation_and_transition_support/collect_features.js +43 -0
- package/lib/selectors/not/selector_list/collect_features.js +31 -0
- package/lib/selectors/nth-child/of_syntax/collect_features.js +32 -0
- package/lib/selectors/nth-last-child/of_syntax/collect_features.js +32 -0
- package/lib/selectors/valid/collect_features.js +39 -0
- package/lib/types/__function/collect_features.js +187 -0
- package/lib/types/attr/collect_features.js +69 -0
- package/lib/types/attr/type_unit_name_map.js +8 -0
- package/lib/types/calc/collect_features.js +70 -0
- package/lib/types/collect_features.js +139 -0
- package/lib/types/color/__alpha_parameter/collect_features.js +37 -0
- package/lib/types/color/__float_values/collect_features.js +44 -0
- package/lib/types/color/__space_separated_parameters/collect_features.js +37 -0
- package/lib/types/color/rgb_hexadecimal_notation/collect_features.js +42 -0
- package/lib/types/easing-function/steps/jump/collect_features.js +37 -0
- package/lib/types/function_name_map.js +8 -0
- package/lib/types/image/gradient/__linear-gradient/collect_features.js +77 -0
- package/lib/types/image/gradient/__linear-gradient/doubleposition/collect_features.js +43 -0
- package/lib/types/image/gradient/__linear-gradient/interpolation_hints/collect_features.js +42 -0
- package/lib/types/image/gradient/__linear-gradient/to/collect_features.js +39 -0
- package/lib/types/image/gradient/__linear-gradient/unitless_0_angle/collect_features.js +40 -0
- package/lib/types/image/gradient/__radial-gradient/at/collect_features.js +44 -0
- package/lib/types/image/gradient/__radial-gradient/collect_features.js +68 -0
- package/lib/types/image/gradient/__radial-gradient/doubleposition/collect_features.js +47 -0
- package/lib/types/image/gradient/__radial-gradient/interpolation_hints/collect_features.js +42 -0
- package/lib/types/image/gradient/conic-gradient/collect_features.js +48 -0
- package/lib/types/image/gradient/conic-gradient/doubleposition/collect_features.js +43 -0
- package/lib/types/number/scientific_notation/collect_features.js +31 -0
- package/lib/types/unit_name_map.js +8 -0
- package/lib/types/value_name_map.js +8 -0
- package/lib/types.js +5 -0
- package/package.json +75 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':after' && node.value !== '::after') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
parent.each(node => {
|
|
18
|
+
if (node.type !== 'decl') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (node.prop.startsWith('transition')) {
|
|
23
|
+
features.push({
|
|
24
|
+
endIndex: node.prop.length,
|
|
25
|
+
id: `selectors.after.animation_and_transition_support`,
|
|
26
|
+
index: 0,
|
|
27
|
+
name: `CSS transition for "::after" pseudo-element`,
|
|
28
|
+
node
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (node.prop.startsWith('animation')) {
|
|
33
|
+
features.push({
|
|
34
|
+
endIndex: node.prop.length,
|
|
35
|
+
id: `selectors.after.animation_and_transition_support`,
|
|
36
|
+
index: 0,
|
|
37
|
+
name: `CSS animation for "::after" pseudo-element`,
|
|
38
|
+
node
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return features;
|
|
43
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== '::backdrop') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
let current = node;
|
|
18
|
+
|
|
19
|
+
while (current = current.prev()) {
|
|
20
|
+
if (['id', 'class', 'attribute', 'tag', 'pseudo'].includes(current.type) !== true) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (current.type === 'tag' && current.value === 'dialog') {
|
|
25
|
+
const index = node.sourceIndex;
|
|
26
|
+
const endIndex = index + node.value.length;
|
|
27
|
+
features.push({
|
|
28
|
+
endIndex,
|
|
29
|
+
id: `selectors.backdrop.dialog`,
|
|
30
|
+
index,
|
|
31
|
+
name: `"::backdrop" pseudo-element for the dialog tag`,
|
|
32
|
+
node: parent
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return features;
|
|
38
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':before' && node.value !== '::before') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
parent.each(node => {
|
|
18
|
+
if (node.type !== 'decl') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (node.prop.startsWith('transition')) {
|
|
23
|
+
features.push({
|
|
24
|
+
endIndex: node.prop.length,
|
|
25
|
+
id: `selectors.before.animation_and_transition_support`,
|
|
26
|
+
index: 0,
|
|
27
|
+
name: `CSS transition for "::before" pseudo-element`,
|
|
28
|
+
node
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (node.prop.startsWith('animation')) {
|
|
33
|
+
features.push({
|
|
34
|
+
endIndex: node.prop.length,
|
|
35
|
+
id: `selectors.before.animation_and_transition_support`,
|
|
36
|
+
index: 0,
|
|
37
|
+
name: `CSS animation for "::before" pseudo-element`,
|
|
38
|
+
node
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return features;
|
|
43
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
async function collectFeatures({
|
|
17
|
+
ignoreFeatures,
|
|
18
|
+
node
|
|
19
|
+
}) {
|
|
20
|
+
const promises = []; // Selector list
|
|
21
|
+
|
|
22
|
+
promises.push(Promise.resolve(Array.from(node.selector.matchAll(/,/g)).map(matches => ({
|
|
23
|
+
endIndex: (matches.index ?? 0) + 1,
|
|
24
|
+
id: `selectors.list`,
|
|
25
|
+
index: matches.index ?? 0,
|
|
26
|
+
name: `Selector list`,
|
|
27
|
+
node
|
|
28
|
+
}))));
|
|
29
|
+
const selectorRoot = await (0, _postcssSelectorParser.default)().ast(node.selector);
|
|
30
|
+
selectorRoot.walk(selectorNode => {
|
|
31
|
+
switch (selectorNode.type) {
|
|
32
|
+
case 'combinator':
|
|
33
|
+
{
|
|
34
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__combinators/collect_features"))).then(({
|
|
35
|
+
collectFeatures
|
|
36
|
+
}) => collectFeatures({
|
|
37
|
+
node: selectorNode,
|
|
38
|
+
parent: node
|
|
39
|
+
})));
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
case 'tag':
|
|
44
|
+
{
|
|
45
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__tags/collect_features"))).then(({
|
|
46
|
+
collectFeatures
|
|
47
|
+
}) => collectFeatures({
|
|
48
|
+
node: selectorNode,
|
|
49
|
+
parent: node
|
|
50
|
+
})));
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
case 'id':
|
|
55
|
+
{
|
|
56
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__ids/collect_features"))).then(({
|
|
57
|
+
collectFeatures
|
|
58
|
+
}) => collectFeatures({
|
|
59
|
+
node: selectorNode,
|
|
60
|
+
parent: node
|
|
61
|
+
})));
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
case 'class':
|
|
66
|
+
{
|
|
67
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__classes/collect_features"))).then(({
|
|
68
|
+
collectFeatures
|
|
69
|
+
}) => collectFeatures({
|
|
70
|
+
node: selectorNode,
|
|
71
|
+
parent: node
|
|
72
|
+
})));
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
case 'attribute':
|
|
77
|
+
{
|
|
78
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__attributes/collect_features"))).then(({
|
|
79
|
+
collectFeatures
|
|
80
|
+
}) => collectFeatures({
|
|
81
|
+
node: selectorNode,
|
|
82
|
+
parent: node
|
|
83
|
+
})));
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
case 'pseudo':
|
|
88
|
+
{
|
|
89
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__pseudos/collect_features"))).then(({
|
|
90
|
+
collectFeatures
|
|
91
|
+
}) => collectFeatures({
|
|
92
|
+
node: selectorNode,
|
|
93
|
+
parent: node
|
|
94
|
+
})));
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
case 'universal':
|
|
99
|
+
{
|
|
100
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("./__universal/collect_features"))).then(({
|
|
101
|
+
collectFeatures
|
|
102
|
+
}) => collectFeatures({
|
|
103
|
+
node: selectorNode,
|
|
104
|
+
parent: node
|
|
105
|
+
})));
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
promises.push(Promise.resolve().then(() => _interopRequireWildcard(require("../collect_features"))).then(({
|
|
111
|
+
collectFeatures
|
|
112
|
+
}) => {
|
|
113
|
+
return collectFeatures({
|
|
114
|
+
container: node,
|
|
115
|
+
ignoreFeatures
|
|
116
|
+
});
|
|
117
|
+
}));
|
|
118
|
+
const features = (await Promise.all(promises)).flat();
|
|
119
|
+
return features;
|
|
120
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== '::cue' || node.nodes.length === 0) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const index = node.sourceIndex;
|
|
17
|
+
const endIndex = index + node.toString().length;
|
|
18
|
+
const features = [{
|
|
19
|
+
endIndex,
|
|
20
|
+
id: `selectors.cue.selector_argument`,
|
|
21
|
+
index,
|
|
22
|
+
name: `"::cue" pseudo-element with selector argument`,
|
|
23
|
+
node: parent
|
|
24
|
+
}];
|
|
25
|
+
return features;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':host' || node.nodes.length === 0) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const index = node.sourceIndex;
|
|
17
|
+
const endIndex = index + node.toString().length;
|
|
18
|
+
const features = [{
|
|
19
|
+
endIndex,
|
|
20
|
+
id: `selectors.hostfunction`,
|
|
21
|
+
index,
|
|
22
|
+
name: `":host()" pseudo-class`,
|
|
23
|
+
node: parent
|
|
24
|
+
}];
|
|
25
|
+
return features;
|
|
26
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
var _postcssSelectorParser = require("postcss-selector-parser");
|
|
9
|
+
|
|
10
|
+
async function collectFeatures({
|
|
11
|
+
node,
|
|
12
|
+
parent
|
|
13
|
+
}) {
|
|
14
|
+
if (node.value !== ':hover') {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const features = [];
|
|
19
|
+
let current = node;
|
|
20
|
+
|
|
21
|
+
while (current = current.prev()) {
|
|
22
|
+
if (['id', 'class', 'attribute', 'tag', 'pseudo'].includes(current.type) !== true) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const index = node.sourceIndex;
|
|
27
|
+
const endIndex = index + node.value.length;
|
|
28
|
+
|
|
29
|
+
if (current.type === 'tag') {
|
|
30
|
+
if (current.value === 'a') {
|
|
31
|
+
features.push({
|
|
32
|
+
endIndex,
|
|
33
|
+
id: `selectors.hover.a_elements`,
|
|
34
|
+
index,
|
|
35
|
+
name: `":hover" pseudo-class with the anchor tag`,
|
|
36
|
+
node: parent
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
features.push({
|
|
40
|
+
endIndex,
|
|
41
|
+
id: `selectors.hover.all_elements`,
|
|
42
|
+
index,
|
|
43
|
+
name: `":hover" pseudo-class with any tag`,
|
|
44
|
+
node: parent
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (current.type === 'pseudo' && (0, _postcssSelectorParser.isPseudoElement)(current)) {
|
|
50
|
+
features.push({
|
|
51
|
+
endIndex,
|
|
52
|
+
id: `selectors.hover.pseudo_elements`,
|
|
53
|
+
index,
|
|
54
|
+
name: `":hover" pseudo-class with pseudo-element`,
|
|
55
|
+
node: parent
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return features;
|
|
61
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':invalid') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
let current = node;
|
|
18
|
+
|
|
19
|
+
while (current = current.prev()) {
|
|
20
|
+
if (['id', 'class', 'attribute', 'tag', 'pseudo'].includes(current.type) !== true) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const index = node.sourceIndex;
|
|
25
|
+
const endIndex = index + node.value.length;
|
|
26
|
+
|
|
27
|
+
if (current.type === 'tag' && current.value === 'form') {
|
|
28
|
+
features.push({
|
|
29
|
+
endIndex,
|
|
30
|
+
id: `selectors.invalid.form`,
|
|
31
|
+
index,
|
|
32
|
+
name: `":invalid" pseudo-class with the form tag`,
|
|
33
|
+
node: parent
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return features;
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== '::marker') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
parent.each(node => {
|
|
18
|
+
if (node.type !== 'decl') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (node.prop.startsWith('transition')) {
|
|
23
|
+
features.push({
|
|
24
|
+
endIndex: node.prop.length,
|
|
25
|
+
id: `selectors.marker.animation_and_transition_support`,
|
|
26
|
+
index: 0,
|
|
27
|
+
name: `CSS transition for "::marker" pseudo-element`,
|
|
28
|
+
node
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (node.prop.startsWith('animation')) {
|
|
33
|
+
features.push({
|
|
34
|
+
endIndex: node.prop.length,
|
|
35
|
+
id: `selectors.marker.animation_and_transition_support`,
|
|
36
|
+
index: 0,
|
|
37
|
+
name: `CSS animation for "::marker" pseudo-element`,
|
|
38
|
+
node
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return features;
|
|
43
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':not') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
|
|
18
|
+
if (node.nodes.length >= 2) {
|
|
19
|
+
const index = node.sourceIndex;
|
|
20
|
+
const endIndex = index + node.toString().length;
|
|
21
|
+
features.push({
|
|
22
|
+
endIndex,
|
|
23
|
+
id: `selectors.not.selector_list`,
|
|
24
|
+
index,
|
|
25
|
+
name: `":not" pseudo-class with several selectors`,
|
|
26
|
+
node: parent
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return features;
|
|
31
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':nth-child') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
const notation = node.map(String).join(',');
|
|
18
|
+
|
|
19
|
+
if (notation.includes(' of ')) {
|
|
20
|
+
const index = node.sourceIndex;
|
|
21
|
+
const endIndex = index + node.toString().length;
|
|
22
|
+
features.push({
|
|
23
|
+
endIndex,
|
|
24
|
+
id: `selectors.nth-child.of_syntax`,
|
|
25
|
+
index,
|
|
26
|
+
name: `"of" syntax of :nth-child pseudo-class`,
|
|
27
|
+
node: parent
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return features;
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':nth-last-child') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
const notation = node.map(String).join(',');
|
|
18
|
+
|
|
19
|
+
if (notation.includes(' of ')) {
|
|
20
|
+
const index = node.sourceIndex;
|
|
21
|
+
const endIndex = index + node.toString().length;
|
|
22
|
+
features.push({
|
|
23
|
+
endIndex,
|
|
24
|
+
id: `selectors.nth-last-child.of_syntax`,
|
|
25
|
+
index,
|
|
26
|
+
name: `"of" syntax of :nth-last-child pseudo-class`,
|
|
27
|
+
node: parent
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return features;
|
|
32
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectFeatures = collectFeatures;
|
|
7
|
+
|
|
8
|
+
async function collectFeatures({
|
|
9
|
+
node,
|
|
10
|
+
parent
|
|
11
|
+
}) {
|
|
12
|
+
if (node.value !== ':valid') {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const features = [];
|
|
17
|
+
let current = node;
|
|
18
|
+
|
|
19
|
+
while (current = current.prev()) {
|
|
20
|
+
if (['id', 'class', 'attribute', 'tag', 'pseudo'].includes(current.type) !== true) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const index = node.sourceIndex;
|
|
25
|
+
const endIndex = index + node.value.length;
|
|
26
|
+
|
|
27
|
+
if (current.type === 'tag' && current.value === 'form') {
|
|
28
|
+
features.push({
|
|
29
|
+
endIndex,
|
|
30
|
+
id: `selectors.valid.form`,
|
|
31
|
+
index,
|
|
32
|
+
name: `":valid" pseudo-class with the form tag`,
|
|
33
|
+
node: parent
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return features;
|
|
39
|
+
}
|