1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Transition Between Transform Operation Lists Which Don't Match
</title>
8 <style type=
"text/css" media=
"screen">
12 background-color: blue;
13 -webkit-transform: translateX(
0px) rotate(
0deg);
14 -webkit-transition-duration:
2s;
15 -webkit-transition-timing-function: linear;
16 -webkit-transition-property: -webkit-transform;
19 <script src=
"transition-test-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
20 <script type=
"text/javascript" charset=
"utf-8">
22 function DegreesToRotation(angle)
24 return roundNumber(Math.cos(angle * Math.PI /
180),
5);
27 const expectedValues = [
28 // [time, element-id, property, expected-value, tolerance]
29 [
0.5,
"box",
"-webkit-transform.0", DegreesToRotation(
45), DegreesToRotation(
10)],
30 [
1.0,
"box",
"-webkit-transform.0", DegreesToRotation(
90), DegreesToRotation(
10)],
35 var box = document.getElementById('box');
36 box.style.webkitTransform = 'rotate(
540deg)';
39 runTransitionTest(expectedValues, setupTest, true);
46 Box should spin only
180 degrees even though the operation specifies a
0 to
540 degree animation.
47 This is because the operation lists don't match, so it falls back to matrix animation, which
48 normalizes the angle to between
0 and
360 degrees.