forked from burg/timelapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zero-duration-with-non-zero-delay-end.html
75 lines (64 loc) · 2 KB
/
zero-duration-with-non-zero-delay-end.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
}
#target {
position: relative;
top: 100px;
left: 100px;
width: 200px;
height: 200px;
background-color: red;
-webkit-transition-property: left;
-webkit-transition-duration: 0s;
-webkit-transition-delay: 0.5s;
}
</style>
<script>
function sample0() {
var expected = 1;
var current = internals.numberOfActiveAnimations();
if (current == expected)
document.getElementById('result0').innerHTML = "Number of active animations before transition is (" + current + ") as expected";
else
document.getElementById('result0').innerHTML = "Number of active animations before transition is (" + current + ") but was expecting (" + expected + ")";
}
function sample1() {
var expected = 0;
var current = internals.numberOfActiveAnimations();
if (current == expected)
document.getElementById('result1').innerHTML = "Number of active animations after transition is (" + current + ") as expected";
else
document.getElementById('result1').innerHTML = "Number of active animations after transition is (" + current + ") but was expecting (" + expected + ")";
testRunner.notifyDone();
}
function runTest() {
window.setTimeout(sample0, 250);
// Note that since 0-delay transitions do not disptach transitionEnd events
// we have to use a timeout here.
window.setTimeout(sample1, 750);
}
function startTest() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
var target = document.getElementById('target');
target.style.left = '200px';
runTest();
}
}
</script>
</head>
<body onload="startTest()">
<h1>Test for DRT numberOfActiveAnimations() API</h1>
<div id="target">
</div>
<div id="result0">
</div>
<div id="result1">
</div>
</body>
</html>