fix: CSS-wide keywords and none in @keyframes cannot remove quotes#267
Merged
devongovett merged 9 commits intoparcel-bundler:masterfrom Sep 7, 2022
Merged
fix: CSS-wide keywords and none in @keyframes cannot remove quotes#267devongovett merged 9 commits intoparcel-bundler:masterfrom
none in @keyframes cannot remove quotes#267devongovett merged 9 commits intoparcel-bundler:masterfrom
Conversation
c08068a to
4dc1f3e
Compare
e.g. ``` @Keyframes "revert" {} ```
Co-Authored-By: Jason <m.jason.liu@outlook.com>
Co-Authored-By: 一丝 <2784308+yisibl@users.noreply.github.com> Co-Authored-By: Jason <m.jason.liu@outlook.com>
4dc1f3e to
f9c49fe
Compare
devongovett
reviewed
Sep 7, 2022
Member
devongovett
left a comment
There was a problem hiding this comment.
Thanks! We'll need to update AnimationName in properties/animation.rs the same way as KeyframesName.
| if context.unused_symbols.contains(keyframes.name.0.as_ref()) { | ||
| if context | ||
| .unused_symbols | ||
| .contains(&keyframes.name.to_css_string(Default::default()).unwrap()) |
Member
There was a problem hiding this comment.
This will result in the name being quoted/escaped, but the unused_symbols list won't be. You'll need to do a match on the keyframe name to pull out the embedded string.
Contributor
Author
Can I fix it in the next PR? Here I want to focus 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.
In the
@keyframesrule, this is an invalid syntax if the<keyframes-name>is CSS-wide keywords ornonekeyword.Before this PR, we would always remove the quotes, which would result in generating an invalid CSS if the quotes happened to be CSS-wide keywords.
Before
After
Throw an error
With the new parsing method, the following cases will throw an error, which was previously considered a legal CSS rule.