Closed Bug 1820414 Opened 2 years ago Closed 2 years ago

Preserve units in angle calculations

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox112 --- affected

People

(Reporter: canadahonk, Unassigned)

References

Details

Currently, we do not preserve the unit (deg/rad/etc) when doing any angle calculations, it is just set as degrees.

WPT test: https://wpt.fyi/results/css/css-values/calc-infinity-nan-serialize-angle.html
Example from test (uses NaN but: rotate(calc(1rad * NaN)) -> rotate(calc(NaN * 1rad)) (1rad preserved, not 1deg)

(There are no dedicated WPT tests for this, maybe some should be added?)

See Also: → 1820407

Filed an issue to WPT upstream to discuss: https://github.com/web-platform-tests/wpt/issues/38821

Summary: Angle scalar multiplication should inherit unit → Preserve units in angle calculations

Changed to be more general as we do not preserve units anywhere in angle calculations afaik.

Severity: -- → S3
See Also: → 1820662

We should always serialize and compute angle calcs as canonical unit (deg) anyway, so this behavior is unneeded.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.