[css-houdini-drafts] [css-typed-om] Should TypedOM "simplify away" a calc() wrapper around a single numeric value when reifying, like serialization does? (#968)

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

== [css-typed-om] Should TypedOM "simplify away" a calc() wrapper around a single numeric value when reifying, like serialization does? ==
The serialization rules for calc() have specified for several years that, if you're serializing a computed or used value that contains a calc(), and that calc() has been simplified into a single numeric value like `calc(5)` or `calc(20px)`, you should clamp it the value to the allowed range for its context and then serialize it by itself, without the calc() wrapper.

Currently, TypedOM doesn't do this - per spec, if you write "width: calc(20px);" in your stylesheet, `computedStyleMap.get('width')` needs to return a `CSSMathSum(CSS.px(20))`.

Should we change this so the reification and serialization rules match? Or is it okay to treat the serialization unwrapping as a legacy quirk?

/cc @emilio for bringing this up in <https://github.com/w3c/csswg-drafts/issues/1968>, cc @xiaochengh as Blink's implementer of some of this stuff.

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

Received on Monday, 7 October 2019 21:29:38 UTC