forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultiple-background-size-transitions.html
67 lines (55 loc) · 1.74 KB
/
multiple-background-size-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
<!DOCTYPE>
<html>
<head>
<style>
.box {
height: 100px;
width: 100px;
margin: 10px;
border: 1px solid black;
background-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: linear;
-webkit-transition-property: -webkit-background-size, -webkit-mask-size;
}
#box {
background-image: url('../fast/backgrounds/repeat/resources/gradient.gif'), url('../fast/backgrounds/repeat/resources/gradient.gif');
background-position: 0 0, 50px 50px;
-webkit-background-size: 0% 0%, 50% 50%;
}
#box.final {
-webkit-background-size: 50% 50%, 0% 0%;
}
#box1 {
background-color: gray;
-webkit-mask-image: url('../fast/backgrounds/repeat/resources/gradient.gif'), url('../fast/backgrounds/repeat/resources/gradient.gif');
-webkit-mask-position: 0 0, 50px 50px;
-webkit-mask-size: 0% 0%, 50% 50%;
}
#box1.final {
-webkit-mask-size: 50% 50%, 0% 0%;
}
</style>
<script src="../animations/resources/animation-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, 'box', '-webkit-background-size', "25% 25%, 25% 25%", 4],
[0.5, 'box1', '-webkit-mask-size', "25% 25%, 25% 25%", 4],
];
function setupTest()
{
document.getElementById('box').className = 'box final';
document.getElementById('box1').className = 'box final';
}
runTransitionTest(expectedValues, setupTest);
</script>
</head>
<body>
<div id="box" class="box"></div>
<div id="box1" class="box"></div>
<div id="result">
</div>
</body>
</html>