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
|
<!DOCTYPE html>
<html>
<head>
<style>
#box {
height: 100px;
width: 100px;
background-color: blue;
-webkit-transform: translateX(0px);
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: steps(3, end);
-webkit-transition-property: -webkit-transform;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.25, "box", "-webkit-transform.4", 0, 5],
[0.5, "box", "-webkit-transform.4", 66, 5],
[0.75, "box", "-webkit-transform.4", 133, 5],
];
function setupTest()
{
var box = document.getElementById('box');
box.style.webkitTransform = 'translateX(200px)';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<p>
The box should move horizontally 200px over 1s, in 3 equal increments.
</p>
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>
|