[csswg-drafts] [css-transforms-2] Allow interpolating from rotate[XYZ]?(0deg) to rotate[XYZ]?(__deg) by interpolating the angles

birtles has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-transforms-2] Allow interpolating from rotate[XYZ]?(0deg) to rotate[XYZ]?(__deg) by interpolating the angles ==
e.g. interpolating from `rotate(0deg)` to `rotateX(360deg)` by interpolating the angles rather than falling back to matrix interpolation.
Test case: https://thimbleprojects.org/mozillalearning/213517/

Blink has special case code for when one argument has an angle of roughly zero:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/transforms/rotation.cc?l=67&rcl=d89a726271a6b6934ec72510c2da3f4495729e5b

The other UAs don't. Strictly speaking, the spec doesn't currently allow this. It only has:

> For interpolations with the primitive rotate3d(), the direction vectors of the transform functions get normalized first. If the normalized vectors are equal, the rotation angle gets interpolated numerically. Otherwise the transform functions get converted into 4x4 matrices first and interpolated as defined in section Interpolation of Matrices afterwards.

However, it seems to match what the author would expect so I suggest we update the spec to require this.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3236 using your GitHub account

Received on Tuesday, 23 October 2018 06:52:25 UTC