You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So as part of some tests I'm writing, I'm using transform: rotate(90deg); and testing the serialization. As specified, at computed/used time this becomes a matrix(); no problem.
However! In Firefox, a 90deg rotation like that produces the nice, simple serialization of matrix(0, 1, -1, 0, 0, 0). In Chrome, it instead gives matrix(6.12323e-17, 1, -1, 6.12323e-17, 0, 0), aka two of the zeros are instead incredibly small non-zero values.
These two matrixes don't produce a rendering difference, but it sure makes it difficult to test serialization. How precisely do we want to specify this kind of thing? How do browsers test their own serialization in the face of issues like this?
The text was updated successfully, but these errors were encountered:
Question: does matrix(0, 1, -1, 0, 0, 0) round-trip in Chrome? If not, seems like a clear bug. If so, not equating it with rotate(90deg) seems like a rounding issue, maybe should be filed as QoI against Chrome.
No, it doesn't round-trip; it serializes the same as above, with the epsilons in place of two of the zeros. I presume we're doing some math in radians and thus getting rounding errors.
(For now I think I'll just generate the computed serialization for a rotate(90deg) and then expect that in the test, so as long as they match the test will pass. I'm not trying to test rotate() serialization, after all, but rather ensuring that math functions work on angles, and rotate() is the only reliable thing I can do that with.)
So as part of some tests I'm writing, I'm using
transform: rotate(90deg);
and testing the serialization. As specified, at computed/used time this becomes amatrix()
; no problem.However! In Firefox, a 90deg rotation like that produces the nice, simple serialization of
matrix(0, 1, -1, 0, 0, 0)
. In Chrome, it instead givesmatrix(6.12323e-17, 1, -1, 6.12323e-17, 0, 0)
, aka two of the zeros are instead incredibly small non-zero values.These two matrixes don't produce a rendering difference, but it sure makes it difficult to test serialization. How precisely do we want to specify this kind of thing? How do browsers test their own serialization in the face of issues like this?
The text was updated successfully, but these errors were encountered: