Re: [csswg-drafts] [css-values] Differences between calc() handling for <length-percentage> values. (#3482)

**Should `calc(%)` always be treated the same as `%`**

https://drafts.csswg.org/css-values-4/#calc-serialize says

> If this simplification process results in only a single value (one `<number>`, one `<dimension>`, or one `<percentage>`), and the value being serialized is a computed value or later, serialize it just as that one value, without the `calc()` wrapper.

I think it would be bad if the serialization is the same but the behavior can be different.

**Should `calc(<length> + 0%)` be the same as `calc(0%)`?**

In general they seem clearly different, I think you meant `calc(<length>)` instead of `calc(0%)`.

And I agree the `0%` should not disappear, this seems already specified in https://drafts.csswg.org/css-values-4/#calc-computed-value

> Where percentages are not resolved at computed-value time, they are not resolved in math functions, e.g. `calc(100% - 100% + 1em)` resolves to `calc(1em + 0%)`, not to `1em`. If there are special rules for computing percentages in a value (e.g. the `height` property), they apply whenever a math function contains percentages.

**Should `calc(% + 0px)` be equivalent to `calc(%)`?**

Not that sure about this one. Theoretically I think they may be considered to be different, but in practice I would probably expect e.g. CSS Tables to say they should be equivalent in your example.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3482#issuecomment-451462821 using your GitHub account

Received on Friday, 4 January 2019 14:44:54 UTC