[css-transforms] WPT test rotate-parsing-valid.html and rotate-interpolation.html fail in Firefox, due to serialization issues
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: dholbert, Assigned: boris)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
This WPT test has 4 failures in Firefox:
https://wpt.fyi/results/css/css-transforms/parsing/rotate-parsing-valid.html?label=master&label=experimental&aligned&q=firefox%3Afail
The first failure looks like a real bug (albeit an edge case) -- we serialize rotate: 0 0 0 <angle>
as rotate: x <angle>
, which is wrong. The 0 0 0
values there represent a three-dimensional direction vector, which is used to determine the direction of the rotation. And if this direction vector is 0 0 0, then we're in a degenerate case and the rotation doesn't occur. So, this is not equivalent to an "x" rotation, despite us serializing it as such.
Reduced testcase for this specific issue -- this is expected to alert 0 0 0 400grad
, but in Firefox, it instead alerts x 400grad
:
data:text/html,<div id="me" style="rotate:0 0 0 400grad"></div><script>alert(me.style.rotate)</script>
The other 3 failures are more trivial; it looks like the test is expecting us to omit the z
and just use single-value syntax in our serialization, when it's implied. Reduced testcase for this:
data:text/html,<div id="me" style="rotate:z 400grad"></div><script>alert(me.style.rotate)</script>
I'm not sure if this is strictly required anywhere, but it's in line with the shortest serialization principle, and it seems easy enough, unless we feel strongly that the test is wrong and that it's better to preserve the z
in this case.
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 1•3 years ago
|
||
Note, the second issue (including z
in the serialization of z <angle>
) is the reason for our failures in this test, too:
https://wpt.fyi/results/css/css-transforms/animation/rotate-interpolation.html?label=master&label=experimental&aligned&q=firefox%3Afail
Both tests are in the compat2021 test set, for what it's worth, so it would be nice to get them passing if possible.
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
The serialization of rotate should be updated to match the current spec.
-
If a rotation about the z axis (that is, in 2D) is specified, the property
must serialize as just an <angle>. -
If any other rotation is specified, the property must serialize with an axis
specified. If the axis is parallel with the x or y axes, it must serialize
as the appropriate keyword.
Also, zero length vector is parallel to every other vector, but the
serialization should be "0 0 0", instead of using x or y keyword.
Comment 4•3 years ago
|
||
bugherder |
Description
•