Skip to content
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

Merged
merged 1 commit into from Mar 15, 2022

Conversation

Mouvedia
Copy link
Contributor

@Mouvedia Mouvedia commented Mar 11, 2022

followup of #5956
see #5956 (comment)

Which issue, if any, is this issue related to?

#2264

Is there anything in the PR that needs further explanation?

Ill add comments on the relevant lines.
Remember to check the commit's message.

@@ -244,16 +295,17 @@ keywordSets.otherPseudoClasses = new Set([
'first-child',
'first-of-type',
'focus',
'focus-ring',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO migrate to vendorSpecificPseudoClasses
// see #2264
keywordSets.webkitProprietaryPseudoClasses = new Set([
// https://webkit.org/blog/363/styling-scrollbars/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this source was the cause of the typo

'valid',
'visited',
'window-inactive', // for ::selection (chrome)
Copy link
Contributor Author

@Mouvedia Mouvedia Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also in webkitScrollbarPseudoClasses
strictly speaking, the one at l381 is not necessary anymore
but it's better that way (less brittle to refactoring)

'focus-within',
'focus-visible',
'fullscreen',
'fullscreen-ancestor',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supported by Opera 12

@@ -238,22 +289,22 @@ keywordSets.otherPseudoClasses = new Set([
'default',
'defined',
'disabled',
'drop',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mouvedia
Copy link
Contributor Author

There are many more that are missing but Ill stop here; the PR has to be reviewable.
e.g. ::-webkit-media-* are missing

@Mouvedia Mouvedia force-pushed the mouvedia-pseudo branch 3 times, most recently from 7d74bc5 to c7a2309 Compare March 11, 2022 18:19
@Mouvedia Mouvedia marked this pull request as ready for review March 11, 2022 18:29
@Mouvedia Mouvedia changed the title [WIP] Fix false positives/negatives in selector-pseudo-class-no-unknown Fix false positives/negatives in selector-pseudo-class-no-unknown Mar 11, 2022
@Mouvedia Mouvedia changed the title Fix false positives/negatives in selector-pseudo-class-no-unknown [WIP] Fix false positives/negatives in selector-pseudo-class-no-unknown Mar 11, 2022
@Mouvedia Mouvedia changed the title [WIP] Fix false positives/negatives in selector-pseudo-class-no-unknown Fix false positives/negatives in selector-pseudo-class-no-unknown Mar 11, 2022
@Mouvedia Mouvedia force-pushed the mouvedia-pseudo branch 3 times, most recently from 5dc6331 to e5805bd Compare March 12, 2022 00:06
@@ -164,12 +167,6 @@ testRule({
line: 2,
column: 9,
},
{
code: '::-webkit-unknown:window-inactive { }',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it detected unknown pseudo elements, it would now correctly reject ::-webkit-unknown.
That's not what we are testing though.

@Mouvedia Mouvedia changed the title Fix false positives/negatives in selector-pseudo-class-no-unknown Fix false positives/negatives in selector-pseudo-class/selector-no-unknown Mar 12, 2022
@Mouvedia Mouvedia changed the title Fix false positives/negatives in selector-pseudo-class/selector-no-unknown Fix false positives/negatives in selector-pseudo-class/element-no-unknown Mar 12, 2022
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all these!

Can you run npm run format to fix the linting, please?

@Mouvedia Mouvedia requested a review from jeddy3 March 15, 2022 00:19
@ybiquitous

This comment was marked as resolved.

…nown

add ::cue, ::target-text, :unresolved, :picture-in-picture, :window-inactive, :fullscreen-ancestor, etc.
remove :focus-ring, :drop
typo ::-webkit-resizer

https://hg.mozilla.org/mozilla-central/file/tip/layout/style/test/test_non_content_accessible_pseudos.html#l8
https://hg.mozilla.org/mozilla-central/file/tip/layout/style/test/test_selectors.html#l1102
https://trac.webkit.org/changeset/252330/webkit/

keywords: datetime, meter, search, validation, any, drag
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mouvedia Thank you! 👍🏼

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@jeddy3 jeddy3 merged commit 841b153 into stylelint:main Mar 15, 2022
@jeddy3
Copy link
Member

jeddy3 commented Mar 15, 2022

  • Fixed: selector-pseudo-*-no-unknown false positives and negatives (#5959).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants