-
Notifications
You must be signed in to change notification settings - Fork 51
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
css-not-sel-list matches on leading/trailing whitespace #168
Comments
I note that other rules account for surrounding whitespace, e.g. doiuse/data/features/css-nth-child-of.js Line 12 in 75ed0d7
|
Due to an upstream bug in doiuse (anandthakker/doiuse#168) we can't deploy this.
Due to an upstream bug in doiuse (anandthakker/doiuse#168) we can't deploy this.
Thanks for filing the issue as well as the fix. It seems you're right about the improper regex. Spec states:
https://www.w3.org/TR/selectors-4/#pseudo-classes I'll work on reviewing the PR and seeing if there are any other related issues around the codebase. |
I went through all the new features looking for similar issues. I'm not sure whether or not these ones are spec compliant: svg-css might have false positives css-rrggbbaa might not catch all 4-length colors And for these ones I'm not familiar with the spec, so they might be wrong in subtle ways: |
Mentioning of the colors reminds me of work I had done on https://github.com/clean-css/clean-css/blob/master/lib/optimizer/level-1/value-optimizers/color.js I haven't fully checked it, but I did write a thorough color parsing regex as seen here with the compiler source here. Looking back there are notes on how you don't need to close parenthesis according to CSS spec. Functions aren't the same as selectors in spec, but worth noting:
https://www.w3.org/TR/css-values-3/#functional-notations It sounds like some functions can be comma separated. We don't want to validate the CSS, just detect with the most basic parsing. That means even if somebody decides to incorrectly add commas to something like Summed up, functional notation and CSS selectors can share the same regex if we're just checking by name ( Edit: Looking for closing parenthesis and any preceding whitespace isn't required, but I'd be fine with requiring it if it simplifies the check. |
The following is a simple
not
selector, it's not a list:but as the regex considers whitespace anywhere to potentially be part of a complex selector, e.g. as in:
we get a false positive.
The text was updated successfully, but these errors were encountered: