Repository navigation
Conversation
The property values are validated against the profile regexes, and the CSS-wide keywords were only present in the regexes where they had been spelled out per property, so a value such as "unset" was reported as invalid. CSS Values 4 defines initial, inherit, unset and revert as valid in place of the value of any property, so add them where the property regexes are compiled.
Author
|
The The change is small, and here is the local verification:
The regression is reproducible on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19.
cssutils.profile.validate('color', 'unset')isFalseonmain, whileinheritis accepted:The values are validated against the profile regexes, and the CSS-wide keywords only appear in the regexes where they were spelled out per property, so a value such as
unsetwas reported as invalid.CSS Values 4 defines
initial,inherit,unsetandrevertas valid in place of the value of any property, so this change adds them where the property regexes are compiled:The per-property definitions are left untouched, and only those four keywords are added, so invalid values stay invalid.
One existing expectation changes as a consequence: an
@font-facedescriptor rejectinginherit(font-style: inherit) is now valid, since the CSS-wide keywords apply to any property. If you would rather keep the font-face profile strict, say so and I will scope the change.Verified locally:
pytest: 625 passed, 43 xfailedruff checkandruff format --check(ruff 0.17.1): cleanmypy --config-file mypy.ini cssutils: no new findings (the 40 reported errors are pre-existing onmain)🤖 This contribution was drafted with AI assistance; the analysis, the change and the tests are described above so that they can be reviewed.