Open weinig opened 1 month ago
cc @tabatkins, @fantasai
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.
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 awidth
property), or raw percentage (like when parsingscale
).With
CSSNumericValue.parse(...)
however, there is no specified context.How are percentages supposed to be interpreted when parsed in this way?