New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix false positives/negatives in selector-pseudo-class/element-no-unknown #5959
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,29 +157,43 @@ keywordSets.levelOneAndTwoPseudoElements = new Set([ | |
'first-letter', | ||
]); | ||
|
||
// These are the ones that require double-colon notation | ||
keywordSets.levelThreeAndUpPseudoElements = new Set([ | ||
'before', | ||
'after', | ||
'first-line', | ||
'first-letter', | ||
'selection', | ||
'spelling-error', | ||
'grammar-error', | ||
// These are the ones that require double-colon notation | ||
'backdrop', | ||
'content', | ||
'cue', | ||
'file-selector-button', | ||
'grammar-error', | ||
'marker', | ||
'placeholder', | ||
'selection', | ||
'shadow', | ||
'slotted', | ||
'content', | ||
'file-selector-button', | ||
'spelling-error', | ||
'target-text', | ||
]); | ||
|
||
keywordSets.shadowTreePseudoElements = new Set(['part']); | ||
|
||
keywordSets.webkitScrollbarPseudoElements = new Set([ | ||
'-webkit-resizer', | ||
'-webkit-scrollbar', | ||
'-webkit-scrollbar-button', | ||
'-webkit-scrollbar-corner', | ||
'-webkit-scrollbar-thumb', | ||
'-webkit-scrollbar-track', | ||
'-webkit-scrollbar-track-piece', | ||
]); | ||
|
||
keywordSets.vendorSpecificPseudoElements = new Set([ | ||
'-moz-focus-inner', | ||
'-moz-focus-outer', | ||
'-moz-list-bullet', | ||
'-moz-meter-bar', | ||
'-moz-placeholder', | ||
'-moz-progress-bar', | ||
'-moz-range-progress', | ||
|
@@ -199,11 +213,50 @@ keywordSets.vendorSpecificPseudoElements = new Set([ | |
'-ms-tooltip', | ||
'-ms-track', | ||
'-ms-value', | ||
'-webkit-color-swatch', | ||
'-webkit-color-swatch-wrapper', | ||
'-webkit-calendar-picker-indicator', | ||
'-webkit-clear-button', | ||
'-webkit-date-and-time-value', | ||
'-webkit-datetime-edit', | ||
'-webkit-datetime-edit-ampm-field', | ||
'-webkit-datetime-edit-day-field', | ||
'-webkit-datetime-edit-fields-wrapper', | ||
'-webkit-datetime-edit-hour-field', | ||
'-webkit-datetime-edit-millisecond-field', | ||
'-webkit-datetime-edit-minute-field', | ||
'-webkit-datetime-edit-month-field', | ||
'-webkit-datetime-edit-second-field', | ||
'-webkit-datetime-edit-text', | ||
'-webkit-datetime-edit-week-field', | ||
'-webkit-datetime-edit-year-field', | ||
'-webkit-details-marker', | ||
'-webkit-distributed', | ||
'-webkit-file-upload-button', | ||
'-webkit-input-placeholder', | ||
'-webkit-keygen-select', | ||
'-webkit-meter-bar', | ||
'-webkit-meter-even-less-good-value', | ||
'-webkit-meter-inner-element', | ||
'-webkit-meter-optimum-value', | ||
'-webkit-meter-suboptimum-value', | ||
'-webkit-progress-bar', | ||
'-webkit-progress-inner-element', | ||
'-webkit-progress-value', | ||
'-webkit-search-cancel-button', | ||
'-webkit-search-decoration', | ||
'-webkit-search-results-button', | ||
'-webkit-search-results-decoration', | ||
'-webkit-slider-runnable-track', | ||
'-webkit-slider-thumb', | ||
'-webkit-textfield-decoration-container', | ||
'-webkit-validation-bubble', | ||
'-webkit-validation-bubble-arrow', | ||
'-webkit-validation-bubble-arrow-clipper', | ||
'-webkit-validation-bubble-heading', | ||
'-webkit-validation-bubble-message', | ||
'-webkit-validation-bubble-text-block', | ||
...keywordSets.webkitScrollbarPseudoElements, | ||
]); | ||
|
||
keywordSets.pseudoElements = uniteSets( | ||
|
@@ -238,22 +291,22 @@ keywordSets.otherPseudoClasses = new Set([ | |
'default', | ||
'defined', | ||
'disabled', | ||
'drop', | ||
'empty', | ||
'enabled', | ||
'first-child', | ||
'first-of-type', | ||
'focus', | ||
'focus-ring', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from an old draft |
||
'focus-within', | ||
'focus-visible', | ||
'fullscreen', | ||
'fullscreen-ancestor', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. supported by Opera 12 |
||
'future', | ||
'host', | ||
'host-context', | ||
'hover', | ||
'indeterminate', | ||
'in-range', | ||
'invalid', | ||
'last-child', | ||
'last-of-type', | ||
'link', | ||
|
@@ -264,6 +317,7 @@ keywordSets.otherPseudoClasses = new Set([ | |
'past', | ||
'placeholder-shown', | ||
'playing', | ||
'picture-in-picture', | ||
'paused', | ||
'read-only', | ||
'read-write', | ||
|
@@ -272,35 +326,48 @@ keywordSets.otherPseudoClasses = new Set([ | |
'scope', | ||
'state', | ||
'target', | ||
'unresolved', | ||
'user-invalid', | ||
'user-valid', | ||
'invalid', | ||
'valid', | ||
'visited', | ||
'window-inactive', // for ::selection (chrome) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also in webkitScrollbarPseudoClasses |
||
]); | ||
|
||
keywordSets.vendorSpecificPseudoClasses = new Set([ | ||
'-khtml-drag', | ||
'-moz-any', | ||
'-moz-any-link', | ||
'-moz-broken', | ||
'-moz-drag-over', | ||
'-moz-first-node', | ||
'-moz-focusring', | ||
'-moz-full-screen', | ||
'-moz-full-screen-ancestor', | ||
'-moz-last-node', | ||
'-moz-loading', | ||
'-moz-meter-optimum', | ||
'-moz-meter-sub-optimum', | ||
'-moz-meter-sub-sub-optimum', | ||
'-moz-placeholder', | ||
'-moz-submit-invalid', | ||
'-moz-suppressed', | ||
'-moz-ui-invalid', | ||
'-moz-ui-valid', | ||
'-moz-user-disabled', | ||
'-moz-window-inactive', | ||
'-ms-fullscreen', | ||
'-ms-input-placeholder', | ||
'-webkit-drag', | ||
'-webkit-any', | ||
'-webkit-any-link', | ||
'-webkit-autofill', | ||
'-webkit-full-screen', | ||
'-webkit-full-screen-ancestor', | ||
]); | ||
|
||
// TODO migrate to vendorSpecificPseudoElements | ||
// see #2264 | ||
keywordSets.webkitProprietaryPseudoElements = new Set([ | ||
'scrollbar', | ||
'scrollbar-button', | ||
'scrollbar-track', | ||
'scrollbar-track-piece', | ||
'scrollbar-thumb', | ||
'scrollbar-corner', | ||
'resize', | ||
]); | ||
|
||
// TODO migrate to vendorSpecificPseudoClasses | ||
// see #2264 | ||
keywordSets.webkitProprietaryPseudoClasses = new Set([ | ||
// https://webkit.org/blog/363/styling-scrollbars/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this source was the cause of the typo |
||
keywordSets.webkitScrollbarPseudoClasses = new Set([ | ||
'horizontal', | ||
'vertical', | ||
'decrement', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,9 @@ testRule({ | |
{ | ||
code: '::-webkit-scrollbar-thumb:window-inactive { }', | ||
}, | ||
{ | ||
code: '::selection:window-inactive { }', | ||
}, | ||
{ | ||
code: '@page :first { }', | ||
}, | ||
|
@@ -164,12 +167,6 @@ testRule({ | |
line: 2, | ||
column: 9, | ||
}, | ||
{ | ||
code: '::-webkit-unknown:window-inactive { }', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it detected unknown pseudo elements, it would now correctly reject |
||
message: messages.rejected(':window-inactive'), | ||
line: 1, | ||
column: 18, | ||
}, | ||
{ | ||
code: '::-webkit-scrollbar-button:horizontal:unknown {}', | ||
message: messages.rejected(':unknown'), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w3c/csswg-drafts#2257 (comment)