css atan2() should support like 'atan2(10px, 10vh)'
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: seokho, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Steps to reproduce:
According to the code review on chromium[1], the WPT test case is wrong:
test_invalid_angle('atan2(90px, 90vw)');
test_invalid_angle('atan2(90px, 90em)');
I think the test is wrong. The spec just says y and x must be of the same type without saying anything about units [2]. Also I don't get what it means by "different dimensions" here.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/4004379/comment/e6e45b6a_df4df8b7/
[2] https://drafts.csswg.org/css-values-4/#funcdef-atan2
Actual results:
Passed the invalid cases.
Expected results:
Gecko may need to change the implementation.
Updated•2 years ago
|
Comment 1•2 years ago
|
||
As per the definition of type - yeah, both are length
types, and so it seems that the calculation should be valid.
Comment 2•2 years ago
|
||
Yeah, so I took a closer look and I think it would be useful to restrict this to same units.
Otherwise we start hitting weird dependencies between properties that aren't supposed to have dependencies, like any non-length property starting to depend on font-sizes via em
units... https://bugs.chromium.org/p/chromium/issues/detail?id=1392594 is basically the same issue.
Updated•2 years ago
|
Description
•