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

calc(%) vs %
------------

Yeah, should be the same as much as possible, because `calc(%)` will serialize to `%`, as @Loirooriol says.

calc(% + 0px) vs calc(%)
------------------------

Sure. There's no case in which these two should be different. Lengths never have magical behavior, so adding it to a % shouldn't add any complications, and in the rare cases where length+% is different than just resolving the % and adding the two together (bg-position), a 0px length is still a no-op.

More specifically, the average of `calc(% + 1px)` and `calc(% - 1px)` will, in every case I can see, be the same as as `calc(%)`.

calc(length + 0%) vs calc(length)
---------------------------------

No, these are different. %s can bring magic, as they sometimes resolve to intrinsic values or behave as auto. Same argument as above, but with opposite result: the average of `calc(length + 1%)` and `calc(length - 1%)` is *not*, in some cases, the same as `calc(length)` .

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

Received on Friday, 4 January 2019 22:40:57 UTC