-
Notifications
You must be signed in to change notification settings - Fork 661
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-values] nested calc()
is not defined by its grammar
#6506
Comments
The
Ah, yeah, that text predates
I'm just using it as it standard English meaning, implying you take the maximal amount. In
In normal CSS it does not matter because it can't really be observed, but in Typed OM it's important because they'll produce different object graphs.
No, it's just to properly handle the immediately preceding step. Starting with Contrast with
Yes, that's correct. The following steps handle the calc-operator nodes, so it seemed clearer and less prone to later editing mistakes to explicitly exclude them from this step, rather than use an inclusive term that happens to not include them.
Are you referring to If you're referring to anything else, can you provide an example? Non-numeric values in any other case should cause a parsing failure and thus never reach this algo.
Ugh, yeah it is; someone made a mistake and sent technical feedback to the private list in reply to a telcon agenda announcement. Don't worry, it's not relevant anymore and I should just remove it. (The behavior under discussion was resolved years ago and is widely implemented.)
No, they all mean the same thing. I'm just being a little loose with terminology there. |
Thanks a lot. I think everything is clear to me now. I leave it to you to close this issue and/or change its title so that it targets the parts that must considerate the non-numeric argument of |
The number case is expressed well:
This shows that it’s talking about values rather than tokens, obviously leaving it open for non-literals. But, to potentially expand the scope of this issue a bit with a closely-related issue, some others don’t make this clear; strings, for example:
This would seem to declare This suggests to me that something needs to be changed in spec or implementation on It’d be good for these sorts of types to spell it out like number does. e.g.
Or if it does exclude non-literal strings:
|
Recently at the end of my days, the difference between what a type of value (literally) is vs. what a type of value represents, often becomes blurry to me. 🤪
I currently believe that a My struggle was more related to missing the quoted definition below, which means to me that a CSS type representing a numeric (CSS component) value, ie. a
I'm not very used to reading technical specs and english is not my native language, so please take it as my very humble opinion: isn't
|
That's not intended, it's just not using the parallel better text from the number section.
Nope, it's just a value that represents a |
All right, addressed the two lingering issues brought up here:
|
Hello,
The grammar of
<calc-value>
(Mathematical expressions - Syntax, CSS Values) does not seem to allowcalc()
to be used recursively and in other math functions. This is only possible with simple blocks.Would the following change be appropriate?
EDIT 1: or maybe the following change, to also allow other math functions?
EDIT 2: and now I realize that the following part answer this (part of my) issue.
EDIT 3: duplicate of #1781.
To be honest, I'm creating this issue as a pretext to ask for clarifications about other math functions related parts of the specification that I'm not sure to understand correctly. I hope I will not waste anyone's time by asking stupid questions, and that they will help to improve some parts instead.
In the introduction of The internal representation (of math functions), it is written:
The
round()
function accepts a component value that is not a calculation as its arguments:<round()> = round( <rounding-strategy>?, <calc-sum>, <calc-sum> )
. Am I right to think that the above definition was written after addinground()
to the specification?round()
does not seem to be handled also in the procedure to serialize a math function, which starts with "If the root of the calculation treefn
represents is a numeric value [...]".For step 3 of the procedure to parse a calculation, it is written:
What is a "run" in "every consecutive run of values"? Is it different from "every consecutive values"? Should
1 * 2 * 3 * 4
be reduced to a Product[[1, 2], [3, 4]]
,[[[[1, 2], 3], 4]
, or[1, 2, 3, 4]
? Does it really matter? I believe that the procedure to simplify a calculation tree will be able to process and return the same result for these 3 different structures anyway, but I'm just not sure why this "consecutive run" term is used.For step 4 of this same procedure, it is written:
Given the grammar of
<calc-sum>
, theoretically a sum can only receive<calc-product>
. Is it correct that this means that a Product data structure is different from a component value matching the grammar of<calc-product>
? If so, that's quite confusing to me. Is it about to avoid writing the grammar of<calc-sum>
with<calc-value> | <calc-product> [ ['*' | '/'] <calc-product> ]
?In step 4 of the procedure to simplify a calculation tree, it is written:
Is it correct that
root
can only be a math function? If so, what is the reason for not using themath function
term instead of an operator node that’s not one of the calc-operator nodes?Also, it seems that none of the remaining steps of this procedure handle a math function containing non numeric values. Does a step 10. Return
root
is missing?I see this note above the procedure to serialize a mathematical function:
But access to the link target is restricted to W3C members. Is it possible to give me clues for the following terms that appear in the different steps of this procedure:
fn
representsfn
representsroot
node isDo they mean different things?
The text was updated successfully, but these errors were encountered: