Re: [csswg-drafts] [css-transforms-2] Algorithm for decomposing a 3D matrix, produces different results to 2D matrix (#3230)

Digging into this a bit further, I have some ideas how to fix this but I notice that for the following animation the 2D and 3D algorithms will give very different results:

```css
@keyframes animation {
  from { transform: matrix(-1, 0, 0, 1, 0, 0); }
  to { transform: matrix(1, 0, 0, 1, 0, 0); }
}
```

Using the 2D interpolation, the image flips back and forth around the vertical axis, but using the 3D interpolation the image scales up and down too.

Demo here: https://codepen.io/birtles/pen/OrWMme

Safari does the horizontal flip since it uses a separate 2D code path. Chrome, does the 2D flip since it always follows the 3D code path. Firefox does the 2D flip but when I try to fix it to match the 2D result in other cases, it ends up matching Chrome on this.

For what it's worth, I also have a test script here I am using to test possible changes to the spec here: https://coconut-stop.glitch.me/

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3230#issuecomment-448842880 using your GitHub account

Received on Thursday, 20 December 2018 03:08:15 UTC