forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflex-transitions.html
102 lines (89 loc) · 2.17 KB
/
flex-transitions.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE>
<html>
<head>
<style>
.flexbox {
display: -webkit-flex;
width: 100px;
height: 100px;
margin-bottom: 10px;
}
.flexbox :nth-child(1) {
background-color: blue;
}
.flexbox :nth-child(2) {
background-color: green;
}
.flexbox div {
-webkit-transition-property: -webkit-flex;
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: linear;
}
#flex-row div {
-webkit-flex: 100 0 0px;
}
.final #row1 {
-webkit-flex: 300 0 0px;
}
#flex-column {
-webkit-flex-direction: column;
}
#flex-column div {
-webkit-flex: 100 0 0px;
}
.final #column1 {
-webkit-flex: 0 0 200px;
}
#flex-negative div {
-webkit-flex: 100 100 50px;
}
.final #negative1 {
-webkit-flex: 100 100 100px;
}
#flex-no-flex div {
-webkit-flex: 100 0 0px;
}
.final #no-flex1 {
-webkit-flex: 0 0 0px;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.2, 'row1', '-webkit-flex', [140, 0, 0], 10],
[0.2, 'column1', '-webkit-flex', [80, 0, 40], 10],
[0.2, 'negative1', '-webkit-flex', [100, 100, 60], 10],
[0.2, 'no-flex1', '-webkit-flex', [80, 0, 0], 10],
[0.8, 'row1', '-webkit-flex', [260, 0, 0], 10],
[0.8, 'column1', '-webkit-flex', [20, 0, 160], 10],
[0.8, 'negative1', '-webkit-flex', [100, 100, 90], 10],
[0.8, 'no-flex1', '-webkit-flex', [20, 0, 0], 10],
];
function setupTest()
{
document.body.className = 'final';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<div id="flex-row" class='flexbox'>
<div id="row1"></div>
<div id="row2"></div>
</div>
<div id="flex-column" class='flexbox'>
<div id="column1"></div>
<div id="column2"></div>
</div>
<div id="flex-negative" class='flexbox'>
<div id="negative1"></div>
<div id="negative2"></div>
</div>
<div id="flex-no-flex" class='flexbox'>
<div id="no-flex1"></div>
<div id="no-flex2"></div>
</div>
<div id="result"></div>
</body>
</html>