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-typed-om][css-values] What context is CSSNumericValue.parse(...) considered to have for its parse? #10753

Open
weinig opened this issue Aug 18, 2024 · 2 comments
Labels

Comments

@weinig
Copy link

weinig commented Aug 18, 2024

In most (I believe all other) cases, when parsing a calc() expression there is a known "context" which is needed to determine the type of percentage values. This is needed to figure out if the type should be a dimension with a percent hint (like when parsing a width property), or raw percentage (like when parsing scale).

With CSSNumericValue.parse(...) however, there is no specified context.

How are percentages supposed to be interpreted when parsed in this way?

@weinig
Copy link
Author

weinig commented Aug 23, 2024

cc @tabatkins, @fantasai

@tabatkins
Copy link
Member

Correct, there isn't a specified context, so the paragraphs conditioned on the context don't apply.

As far as I know, the behavior should work out either way - if you have a value that works due to having a known context, then parsing it without a known context then matching it against a grammar should always work as well. Getting that right has been difficult and subtle; if you find an instance where it fails, it's a spec bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants