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

[CSS] A warning annotation for nested CSS functions in an attribute #5025

Closed
noelma opened this issue Nov 28, 2022 · 1 comment · Fixed by #5432
Closed

[CSS] A warning annotation for nested CSS functions in an attribute #5025

noelma opened this issue Nov 28, 2022 · 1 comment · Fixed by #5432
Assignees
Labels
kind:bug Bug report or fix

Comments

@noelma
Copy link

noelma commented Nov 28, 2022

Apache NetBeans version

Apache NetBeans 15

What happened

When the var() function is used in a calc() function for the declaration of a variable there is no problem.
But their uses in a CSS attribute, a warning annotation is displayed
Capture d’écran du 2022-11-28 21-04-50

How to reproduce

Insert the following code in a CSS file:

.foo {
  --widthA: 100px;
  --widthB: calc(var(--widthA) + 2px);
  width: var(--widthB);
}

.bar {
  --widthC: 100px;
  width: calc(var(--widthC) + 2px);
}

Did this work correctly in an earlier version?

Apache NetBeans 15

Operating System

Linux version 5.15.0-53-generic running on amd64

JDK

18.0.2-ea; OpenJDK 64-Bit Server VM 18.0.2-ea+9-Ubuntu-222.04; Private Build

Apache NetBeans packaging

Apache NetBeans Snap Package

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@noelma noelma added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Nov 28, 2022
@matthiasblaesing matthiasblaesing self-assigned this Jan 21, 2023
@matthiasblaesing matthiasblaesing removed the needs:triage Requires attention from one of the committers label Jan 26, 2023
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 4, 2023
The grammar for calc property values failed to parse embedded var and
calc calls correctly. The issue is the work-around introduces as
function-content, which basicly prevents nesting any expression that
contains braces.

This changes the grammar parsing result from a tree to a directed graph,
which can contain cycles. This needs to taken into account by useers of
the parsed grammar.

An example of such a cycle is:

calc-fn -> calc-sum -> calc-product -> calc-value -> calc-sum
              ^                                        |
              +----------------------------------------+

Closes: apache#5025
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 4, 2023
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2023
The grammar for calc property values failed to parse embedded var and
calc calls correctly. The issue is the work-around introduces as
function-content, which basicly prevents nesting any expression that
contains braces.

This changes the grammar parsing result from a tree to a directed graph,
which can contain cycles. This needs to taken into account by useers of
the parsed grammar.

An example of such a cycle is:

calc-fn -> calc-sum -> calc-product -> calc-value -> calc-sum
              ^                                        |
              +----------------------------------------+

Closes: apache#5025
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2023
@matthiasblaesing
Copy link
Contributor

@noelma please have a look at the referenced PR and test it. If you need a prebuild binary, it is available from the CI summary or from this direct link: https://github.com/apache/netbeans/suites/10786014570/artifacts/542201388

matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2023
The grammar for calc property values failed to parse embedded var and
calc calls correctly. The issue is the work-around introduces as
function-content, which basicly prevents nesting any expression that
contains braces.

This changes the grammar parsing result from a tree to a directed graph,
which can contain cycles. This needs to taken into account by useers of
the parsed grammar.

An example of such a cycle is:

calc-fn -> calc-sum -> calc-product -> calc-value -> calc-sum
              ^                                        |
              +----------------------------------------+

Closes: apache#5025
matthiasblaesing added a commit to matthiasblaesing/netbeans that referenced this issue Feb 5, 2023
vieiro pushed a commit to vieiro/netbeans-cnd that referenced this issue Mar 6, 2023
The grammar for calc property values failed to parse embedded var and
calc calls correctly. The issue is the work-around introduces as
function-content, which basicly prevents nesting any expression that
contains braces.

This changes the grammar parsing result from a tree to a directed graph,
which can contain cycles. This needs to taken into account by useers of
the parsed grammar.

An example of such a cycle is:

calc-fn -> calc-sum -> calc-product -> calc-value -> calc-sum
              ^                                        |
              +----------------------------------------+

Closes: apache#5025
vieiro pushed a commit to vieiro/netbeans-cnd that referenced this issue Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix
Projects
None yet
2 participants