Skip to content

Commit

Permalink
Fix false positives/negatives in selector-pseudo-class-no-unknown (#5956
Browse files Browse the repository at this point in the history
)

* add missing pseudo classes:
 - `user-valid`
 - `-moz-placeholder`
 - `-moz-ui-invalid`
 - `-moz-ui-valid`
 - `-ms-input-placeholder`

add missing pseudo elements:
 - `-moz-focus-outer`
 - `-moz-placeholder`
 - `-webkit-input-placeholder`

fixes #5173

https://developer.mozilla.org/en-US/docs/web/css/:user-valid
https://bugzilla.mozilla.org/show_bug.cgi?id=457801
https://bugzilla.mozilla.org/show_bug.cgi?id=737786

* remove :user-error

https://www.w3.org/TR/selectors-4/#changes-2013
  • Loading branch information
Mouvedia committed Mar 9, 2022
1 parent 9ac80b9 commit 60dd0c3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lib/reference/keywordSets.js
Expand Up @@ -179,6 +179,8 @@ keywordSets.shadowTreePseudoElements = new Set(['part']);

keywordSets.vendorSpecificPseudoElements = new Set([
'-moz-focus-inner',
'-moz-focus-outer',
'-moz-placeholder',
'-moz-progress-bar',
'-moz-range-progress',
'-moz-range-thumb',
Expand All @@ -197,6 +199,7 @@ keywordSets.vendorSpecificPseudoElements = new Set([
'-ms-tooltip',
'-ms-track',
'-ms-value',
'-webkit-input-placeholder',
'-webkit-progress-bar',
'-webkit-progress-value',
'-webkit-slider-runnable-track',
Expand Down Expand Up @@ -231,11 +234,6 @@ keywordSets.otherPseudoClasses = new Set([
'autofill',
'blank',
'checked',
/*
https://www.w3.org/Style/CSS/Test/CSS3/Selectors/20011105/html/tests/css3-modsel-85.html
https://www.w3.org/Style/CSS/Test/CSS3/Selectors/20011105/html/tests/css3-modsel-84.html
*/
'contains',
'current',
'default',
'defined',
Expand All @@ -256,7 +254,6 @@ keywordSets.otherPseudoClasses = new Set([
'hover',
'indeterminate',
'in-range',
'invalid',
'last-child',
'last-of-type',
'link',
Expand All @@ -275,12 +272,22 @@ keywordSets.otherPseudoClasses = new Set([
'scope',
'state',
'target',
'user-error',
'user-invalid',
'user-valid',
'invalid',
'valid',
'visited',
]);

keywordSets.vendorSpecificPseudoClasses = new Set([
'-moz-placeholder',
'-moz-ui-invalid',
'-moz-ui-valid',
'-ms-input-placeholder',
]);

// TODO migrate to vendorSpecificPseudoElements
// see #2264
keywordSets.webkitProprietaryPseudoElements = new Set([
'scrollbar',
'scrollbar-button',
Expand All @@ -291,6 +298,8 @@ keywordSets.webkitProprietaryPseudoElements = new Set([
'resize',
]);

// TODO migrate to vendorSpecificPseudoClasses
// see #2264
keywordSets.webkitProprietaryPseudoClasses = new Set([
'horizontal',
'vertical',
Expand All @@ -311,6 +320,7 @@ keywordSets.pseudoClasses = uniteSets(
keywordSets.logicalCombinationsPseudoClasses,
keywordSets.aNPlusBOfSNotationPseudoClasses,
keywordSets.otherPseudoClasses,
keywordSets.vendorSpecificPseudoClasses,
);

keywordSets.shorthandTimeProperties = new Set(['transition', 'animation']);
Expand Down

0 comments on commit 60dd0c3

Please sign in to comment.