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
|
<!DOCTYPE html>
<html>
<head>
<style>
#target {
position: relative;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
background-color: blue;
-webkit-transition-property: left;
-webkit-transition-duration: 0s;
-webkit-transition-delay: 0.5s;
}
#target.moved {
left: 200px;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script>
const expectedValues = [
// Times are relative to document load for transitions.
// [time, element-id, property, expected-value, tolerance]
[0.0, "target", "left", 100, 0],
[0.4, "target", "left", 100, 0],
[0.6, "target", "left", 200, 0],
];
function setupTest()
{
document.getElementById('target').className = 'moved';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<div id="target"></div>
<div id="result"></div>
</body>
</html>
|