forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault-timing-function.html
74 lines (59 loc) · 1.41 KB
/
default-timing-function.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
<!DOCTYPE html>
<html>
<head>
<style>
.container {
position: relative;
}
.box {
position: relative;
height: 100px;
width: 100px;
left: 0px;
background-color: green;
-webkit-transition-duration: 1s;
}
#box {
-webkit-transition-property: left;
}
#box.final {
left: 400px;
}
#box2 {
-webkit-transition-property: -webkit-transform;
}
#box2.final {
transform: translateX(400px);
}
#indicator {
position: absolute;
left: 322px;
height: 200px;
background-color: red;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script>
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, 'box', 'left', 322, 5],
[0.5, 'box2', '-webkit-transform.4', 322, 5],
];
function setupTest()
{
document.getElementById('box').className = 'box final';
document.getElementById('box2').className = 'box final';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<!-- The pixel result should show a green bar, with no red visible. -->
<div class="container">
<div id="indicator" class="box"></div>
<div id="box" class="box"></div>
<div id="box2" class="box"></div>
</div>
<div id="result"></div>
</body>
</html>