[css-houdini-drafts] [css-typed-om] can <calc> normalization from parsing/cssom simplify the expression?

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

== [css-typed-om] can <calc> normalization from parsing/cssom simplify the expression? ==
If I'm getting a calc from the style property map, should it be simplified or not?
```
testDiv.style.width = 'calc(1px + 1px)';
testDiv.attributeStyleMap.get('width') // CSSMathSum or CSSUnitValue?
```

I think the [typed OM spec](https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-normalization) says it should return a `CSSMathSum`. However,  Blink currently simplifies `<calc>` expression during parse time, so I don't know if we're allowed to return the simplified expression (`CSSUnitValue`) or maybe if returning the original expression contradicts another spec (the [css values module 3 spec](https://drafts.csswg.org/css-values-3/#calc-notation) doesn't seem to say anything about this).

On the one hand, it makes intuitive sense to retain the original calc structure. On the other hand, normalization is converting `<calc>` values to `CSSStyleValues`, but doesn't necessarily mandate how to go from strings to `<calc>`s (including whether simplification at parse time is allowed).

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

Received on Thursday, 7 December 2017 05:29:22 UTC