forked from burg/timelapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transform-op-list-no-match.html
51 lines (45 loc) · 1.36 KB
/
transform-op-list-no-match.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<style>
#box {
height: 100px;
width: 100px;
background-color: blue;
-webkit-transform: translateX(0px) rotate(0deg);
-webkit-transition-duration: 2s;
-webkit-transition-timing-function: linear;
-webkit-transition-property: -webkit-transform;
}
</style>
<script src="resources/transition-test-helpers.js"></script>
<script type="text/javascript">
function DegreesToRotation(angle)
{
return roundNumber(Math.cos(angle * Math.PI / 180), 5);
}
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, "box", "-webkit-transform.0", DegreesToRotation(45), DegreesToRotation(10)],
[1.0, "box", "-webkit-transform.0", DegreesToRotation(90), DegreesToRotation(10)],
];
function setupTest()
{
var box = document.getElementById('box');
box.style.webkitTransform = 'rotate(540deg)';
}
runTransitionTest(expectedValues, setupTest, usePauseAPI);
</script>
</head>
<body>
<p>
Box should spin only 180 degrees even though the operation specifies a 0 to 540 degree animation.
This is because the operation lists don't match, so it falls back to matrix animation, which
normalizes the angle to between 0 and 360 degrees.
</p>
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>