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
|
<html>
<head>
<style>
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
-webkit-transition: left 1s linear;
}
.animating > .box {
left: 400px;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script>
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, "box1", "left", 200, 4],
[0.5, "box2", "left", 322, 4],
[0.5, "box3", "left", 126, 4],
[0.5, "box4", "left", 273, 4],
[0.5, "box5", "left", 200, 4],
];
function setupTest()
{
document.getElementById('container').className = 'animating';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<div id="container">
<div id="box1" class="box" style="-webkit-transition-timing-function: linear;"></div>
<div id="box2" class="box" style="-webkit-transition-timing-function: ease;"></div>
<div id="box3" class="box" style="-webkit-transition-timing-function: ease-in;"></div>
<div id="box4" class="box" style="-webkit-transition-timing-function: ease-out;"></div>
<div id="box5" class="box" style="-webkit-transition-timing-function: ease-in-out;"></div>
</div>
<div id="result"></div>
</body>
</html>
|