Re: [csswg-drafts] [css-values-4] How should atan2 behave with different length units? (#7482)

The result from the `atan2` *operations* in these tests are correct because their terms always have the same unit. The `atan2(1cm, 1mm)` CSS value should resolve to `~84deg`, not `135deg`. Theoretically, these test cases can be simplified to `calc(135deg)`, (because both terms have the same unit) but there are some other cases of math expressions that can be simplified at parse time but are not. I cannot tell you why this case, `atan2()` with same units, is not simplified.

If a math function cannot be simplified to a numeric value at parse time, it is serialized as is. Then at computed value time, `1vw` is canonicalized to whatever `px` value it corresponds, and is resolved to a numeric value.

I agree that some clarification on the processing (parsing, simplification, type checking) of a math function would have helped me a lot. :)

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


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

Received on Sunday, 10 July 2022 06:43:09 UTC