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

Invalid CSS parcing error in @keyframes rule #8052

Closed
vbickov opened this issue Dec 14, 2024 · 12 comments · Fixed by #8053
Closed

Invalid CSS parcing error in @keyframes rule #8052

vbickov opened this issue Dec 14, 2024 · 12 comments · Fixed by #8053
Assignees
Labels
CSS [ci] enable web job kind:bug Bug report or fix Regression This used to work!

Comments

@vbickov
Copy link

vbickov commented Dec 14, 2024

Apache NetBeans version

Apache NetBeans 24 release candidate

What happened

NetBeans 24 considers the following CSS block as erroneous. It does not like "%0" and says that "Unexpected token PERCENTAGE" is found. If I configure the validator to ignore the error, it starts blaming the closing bracket. The code is obviously fine.

@keyframes ozx-delay-anim {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

Language / Project Type / NetBeans Component

No response

How to reproduce

Just create a CSS file and put the code in there.

Did this work correctly in an earlier version?

Apache NetBeans 23

Operating System

Windows 11 Pro 24H2

JDK

Java HotSpot(TM) 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

@vbickov vbickov added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Dec 14, 2024
@vbickov
Copy link
Author

vbickov commented Dec 14, 2024

Not actually a "release candidate". It is the latest released NetBeans 24. The form just did not have this option.

@troizet troizet added the CSS [ci] enable web job label Dec 14, 2024
@matthiasblaesing matthiasblaesing self-assigned this Dec 14, 2024
@matthiasblaesing matthiasblaesing added Regression This used to work! and removed needs:triage Requires attention from one of the committers labels Dec 14, 2024
@matthiasblaesing
Copy link
Contributor

Sorry, I'll look into this.

matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Dec 14, 2024
Before 23ed111 "CSS: Improve handling
of generic-at-rules (for example used by tailwind)" the CSS parser
returned the body of generic @-rules as a plain list of tokens. That
changed and the @Keyframes rule needs to be special cased. There was
already a special case for the @-webkit-keyframes variant, which is
identical to the final variant and differs only in the introducing
rule name.


Closes: apache#8052
@matthiasblaesing
Copy link
Contributor

@vbickov from the checks page of #8053 a nightly build available checks page direct link.

It would be great if you could test it.

For NB 23, you might succeed by replacing the existing org-netbeans-modules-css-lib.jar with this one:
org-netbeans-modules-css-lib.jar.zip. Of course you should make a bakup first.

@vbickov
Copy link
Author

vbickov commented Dec 14, 2024

@matthiasblaesing The org-netbeans-modules-css-lib.jar from the nightly build solves the issue for NB 24. I do not have NB 23 anymore and never experienced this issue with NB 23. Thank you.

@vbickov vbickov closed this as completed Dec 14, 2024
@vbickov vbickov reopened this Dec 14, 2024
@vbickov
Copy link
Author

vbickov commented Dec 14, 2024

@matthiasblaesing Apparently, I was wrong. After I replaced org-netbeans-modules-css-lib.jar from the nightly build, it seemed that the issue was solved. However, after a couple of seconds, the error came back. I also tried to replace all JARs with CSS in their names. Am I missing something?

@matthiasblaesing
Copy link
Contributor

Please ensure that you delete the cache dir. Under windows the two relevant paths are (the first can be safely deleted):

  • Cache dir: c:/Users/<username>/AppData/Local/NetBeans/Cache/<NBVERSION>
  • Settings dir: c:/Users/<username>/AppData/Roaming/NetBeans/<NBVERSION>

Please don't close the issue, it will be automatically closed once the fix is merged to master.

@vbickov
Copy link
Author

vbickov commented Dec 15, 2024

@matthiasblaesing Thank you. Removing the cache dir helps.

@matthiasblaesing
Copy link
Contributor

@vbickov I pushed another update. The @keyframes rule also exists in the variants @-moz-keyframes and @-o-keyframes, these two variants are now supported also. Would you mind testing either the nightly (checks page, direct link) or the extracted org-netbeans-modules-css-lib.jar again?

org-netbeans-modules-css-lib.jar.zip

@vbickov
Copy link
Author

vbickov commented Dec 19, 2024

@matthiasblaesing thank you. I was just about to report the issue with @-moz-keyframes

The update you provided fixes issue with @-moz-keyframes

matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Dec 19, 2024
Before 23ed111 "CSS: Improve handling
of generic-at-rules (for example used by tailwind)" the CSS parser
returned the body of generic @-rules as a plain list of tokens. That
changed and the @Keyframes rule needs to be special cased. There was
already a special case for the @-webkit-keyframes variant, which is
identical to the final variant and differs only in the introducing
rule name.

The vendored variants @-moz-keyframes and @-o-keyframes are also
supported.

Closes: apache#8052
@DarryStraits
Copy link

Hello. My first time here trying to contribute... I know it's a closed issue but after applying the fix, I found a couple of errors in my project related to keyframes and viewport, both for ms versions:

@-ms-keyframes --> Used in my own CSS files (to ensure copatibility with old Miscrosoft browsers)
@-ms-viewport --> Used in Bootstrap v3.3.7 (bootstrap.min.css)

It looks like they are missing or wrong in the css module, as I am getting similar errors to the previous ones mentioned here.
Do you think this makes sense?

@matthiasblaesing
Copy link
Contributor

Is there somewhere outside your own code an occurence of @-ms-keyframes? Else I'm not willing to respin this. For current development it is useless as all major browsers support "the right" syntax.

For @-ms-viewport. Nothing changed for that. It is "supported":

grafik

The warning is correct, as device-width is not a valid value for the width property.

@DarryStraits
Copy link

Hi Matthias,

Thank you for your quick response.

Regarding @-ms-keyframes, it only happens in a CSS file I created long ago. After some research, I found that @-ms-keyframes was part of a beta for IE 10 but was discarded in the final version and shortly before IE10 release MSDN marked @-ms-keyframes as deprecated. So yes, that's not part of CSS standards anymore. But in NetBeans 23 it wasn't marked as an error, that's why I commented on this. I deleted that tag in my code to avoid that error, so there are no major issues here... ;)

About @-ms-viewport, I'm not talking about the device-width warning but the @-ms-viewport error itself:

Captura de pantalla 2024-12-31 144801

It is happening in both Bootstrap 3.3.7 and 3.4.1 (minified versions) that are included in external plugins included in my project. It seems that @-ms-viewport has been deprecated too (not used in Edge, only in IE 10), but I guess Bootstrap was just trying to keep compatibility with old browsers like IE 10. Anyhow, that error was not marked before in NetBeans 23 and now it is, at least in my NetBeans 24 after replacing org-netbeans-modules-css-lib.jar with the new version, that's why I'm also mentioning this.

Just trying to help... :)

BTW: Happy New Year to everybody!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS [ci] enable web job kind:bug Bug report or fix Regression This used to work!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants