[csswg-drafts] [css-values] Actually describe how computed math functions are simplified from specified ones

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] Actually describe how computed math functions are simplified from specified ones ==
In [V&U](https://drafts.csswg.org/css-values/#calc-computed-value), the computed value of a math function is described as just absolutizing the units.  But then when you [*serialize* the function](https://drafts.csswg.org/css-values/#serialize-a-calc-value), you do a more elaborate simplification process, so that, for example, `calc(5 * (1px + 2em))` serializes to `calc(5px + 10em)`.

Whether we simplify eagerly or just at serialization time isn't observable in old CSS (since there's no behavior difference between the two forms, and you have to serialize it to examine it directly), but it *is* observable in TypedOM, which produces equivalent `CSSMathValue` trees from a `calc()`.  As currently specified, the serialization of the above value as a Typed OM value would differ from its serialization via CSSOM, which seems bad.

Should we specify that simplification happens eagerly, so that all ways of observing the value agree on its form?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2245 using your GitHub account

Received on Wednesday, 31 January 2018 02:34:15 UTC