[csswg-drafts] [css-values] Distributing multiplication over sums clarification (#9434)

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

== [css-values] Distributing multiplication over sums clarification ==
The [spec](https://drafts.csswg.org/css-values-4/#calc-simplification) says that
> [Internal representations](https://drafts.css-houdini.org/css-typed-om-1/#css-internal-representation) of [math functions](https://drafts.csswg.org/css-values-4/#math-function) are eagerly simplified to the extent possible, using standard algebraic simplifications (distributing multiplication over sums, combining similar units, etc.).

So, the case like `calc(2 * (10px - 1rem))` becomes `calc(20px - 2rem)`.

It's not clear to me if we should do the same for when we have functions inside the brackets, like:
`calc(2 * (min(10px, 10%) + max(1rem, 1%))` should become `calc(2 * min(10px, 10%) + 2 * max(1rem, 1%))`?

Currently, no browser does `calc(2 * min(10px, 10%) + 2 * max(1rem, 1%))` and just leaves the expression as it is.

So, my question is, should we distribute multiplication over sums in case when the parts are math functions?

@tabatkins @fantasai 

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 4 October 2023 09:27:56 UTC