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
feat(css/parser): improve selector AST #6112
Conversation
@@ -1 +1 @@ | |||
:root{--fg-color:blue;--fg-\color-other:blue}.box{background-color:rebeccapurple;background-color:var(--fg-color);border-radius:10px;width:100px;height:100px}.box:hover{animation-name:rotate\ rotate;animation-duration:.7s}@keyframes rotate\ rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotat\e{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}*|*{color:blue}*|*{color:blue}@media screen and (min-width:0\0){body{color:red}}body{margin:-\1px} | |||
:root{--fg-color:blue;--fg-\color-other:blue}.box{background-color:rebeccapurple;background-color:var(--fg-color);border-radius:10px;width:100px;height:100px}.box:hover{animation-name:rotate\ rotate;animation-duration:.7s}@keyframes rotate\ rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes rotat\e{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}*|*{color:blue}\*|*{color:blue}@media screen and (min-width:0\0){body{color:red}}body{margin:-\1px} |
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.
Original code:
\*|*{color:blue}
According spec it is \*
namespace (so we print it as ident).
Chrome has bug here \*|*{color:blue}
parsed as *{color:blue}
, firefox doesn't affected this bug and just can't parse it.
And both wrong here, chrome should not parse this as any namespace, firefox should parse this with \*
namespace 😄 I will report this in both browsers
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.
There's a merge conflict
@kdy1 Yeah, I will fix it soon |
fc9c238
to
91ed103
Compare
@kdy1 Rebased 👍 |
Is this necessary? I think this may make working with AST harder |
@kdy1 Yep, |
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.
swc-bump:
- swc_css_ast --breaking
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.
Automated review comment generated by auto-rebase script
Description:
Resolve TODO + tests + improve AST
BREAKING CHANGE:
Yes
Related issue (if exists):
No