You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For each child of the root node, serialize the calculation tree. If a result of this serialization starts with a "(" (open parenthesis) and ends with a ")" (close parenthesis), remove those characters from the result. Concatenate all of the results using ", " (comma followed by space), then append the result to s.
There are a couple of issues with this:
The clamp() function has a <rounding-strategy> as its first child. Passing that to "serialize the calculation tree" isn't valid, but ignoring it would miss it from the serialization.
If root is a numeric value and we are serializing it before the computed-value stage, it has no children and should be passed to "serialize the calculation tree" directly.
If root is a calc-operator node, serializing its children as a comma-separated list is incorrect. It should also be passed to "serialize the calculation tree" directly.
When implementing this in Ladybird, I replaced step 4 with this behaviour, and it seems to be correct according to the WPT tests I've checked:
If the root node is a numeric value, or a calc-operator node:
Call "serialize the calculation tree" on the root node, then any wrapping (), and append that to s.
Otherwise:
If the root node is a Clamp function:
Serialize its rounding-strategy and append that to s, followed by ", ".
Perform the original step 4 on the children that are calculation nodes.
In reality you'd want to combine that with step 3, as the two steps have identical if conditions.
The text was updated successfully, but these errors were encountered:
https://drafts.csswg.org/css-values-4/#serialize-a-math-function
Step 4 says:
There are a couple of issues with this:
clamp()
function has a<rounding-strategy>
as its first child. Passing that to "serialize the calculation tree" isn't valid, but ignoring it would miss it from the serialization.root
is a numeric value and we are serializing it before the computed-value stage, it has no children and should be passed to "serialize the calculation tree" directly.root
is a calc-operator node, serializing its children as a comma-separated list is incorrect. It should also be passed to "serialize the calculation tree" directly.When implementing this in Ladybird, I replaced step 4 with this behaviour, and it seems to be correct according to the WPT tests I've checked:
s
.s
, followed by ", ".In reality you'd want to combine that with step 3, as the two steps have identical if conditions.
The text was updated successfully, but these errors were encountered: