forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmixed-type.html
More file actions
40 lines (35 loc) · 905 Bytes
/
mixed-type.html
File metadata and controls
40 lines (35 loc) · 905 Bytes
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
<!DOCTYPE html>
<style>
#box {
width: 10%;
height: 100px;
background-color: green;
-webkit-transition: all 1s linear;
}
#box.final {
width: 400px;
height: 90%;
}
</style>
Tests transitions to and from a mix of absolute and percent values
</p>
<div style="width: 500px; height: 500px;">
<div id="box"></div>
</div>
<div id="result">
<script src="resources/transition-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
// The transition takes 1 second, so we compute tolerance to allow
// 10% or 100ms variance, (endValue - startValue) / 10.
[0.5, 'box', 'width', 225, 35],
[0.5, 'box', 'height', 275, 35],
];
function setupTest()
{
var box = document.getElementById('box');
box.className = 'final';
}
runTransitionTest(expectedValues, setupTest, usePauseAPI);
</script>