-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-transforms-2] Permit piecewise rotation interpolation when 0deg angle is present #3236 #3250
Conversation
Looks like I need a W3C account. Request sent. |
Have some WIP tests though Firefox and Chrome disagree on how to perform matrix interpolation in the negative case heh. |
Thanks Alan! I was actually hoping you could explain this part too: double dot = a.axis.Dot(b.axis);
if (dot < 0)
return false;
double a_squared = a.axis.LengthSquared();
double b_squared = b.axis.LengthSquared();
double error = std::abs(1 - (dot * dot) / (a_squared * b_squared));
if (error > kAngleEpsilon)
return false;
result_axis = a.axis;
result_angle_a = a.angle;
result_angle_b = b.angle;
return true; |
That could be because of the issues I am trying to debug in #3230. |
I didn't actually write this algorithm, I just moved it around. |
Oh ok, Gecko just compares the vector components after normalizing them. I have no idea if that's equivalent or not. |
Ooh Rust. |
After adding the "match zero angles" behavior to Gecko I get the following errors from those wpt:
|
Looking at the first test failure, we have:
Which I would expect to be equivalent to:
And at 25% progress I would expect the result to be:
i.e.
which is what Gecko (with the patch for matching zero angles applied) gives. Chrome 71 gives me:
which differs from Gecko and the result expected in the test. |
For the second test failure, we should be using matrix interpolation and I suspect we're hitting #3230. By my calculation the result should be:
But Gecko is giving us:
And Chrome and the test expect:
|
For the third test failure we have:
which we expect to become:
and at 25% that should give us:
i.e.
which is what Gecko (with the zero angle matching patch applied) gives. The test, however, expects:
While Chrome gives:
|
In summary, of the three test failures I think we have:
|
For the "Match on rotation vector" test, the angle should be 112.5deg, not 135deg. I suppose For the "Match on rotation due to 0deg angle" test, the angle should be 67.5deg not 55deg. I have no idea where the 55deg comes from. @alancutter Do you mind if I commit those tests with the above fixes and drop the "Mismatch on rotation vector" test for now? |
Specifically, this is the patch I am currently looking to commit: |
No problem! I'm a bit limited in the time I can spend on this so that's certainly appreciated. |
Thank you! |
The tests for this have now landed in wpt: web-platform-tests/wpt@7d0ccc0 @tabatkins Do you mind reviewing/merging this? This should fix #3236 which I believe you were onboard with. |
[css-transforms-2] Permit piecewise rotation interpolation when 0deg angle is present #3236
This change makes rotations like
rotateX(45deg)
androtateY(0deg)
compatible for simple interpolation without triggering matrix interpolation. Any 0deg rotation can interpolate cleanly with any other rotation.