forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclip-path-animation.html
66 lines (54 loc) · 1.85 KB
/
clip-path-animation.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
<!DOCTYPE html>
<html>
<head>
<style>
.box {
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
display: inline-block;
}
#circle-box {
-webkit-animation: circle-anim 2s linear
}
#ellipse-box {
-webkit-animation: ellipse-anim 2s linear
}
#polygon-box {
-webkit-animation: polygon-anim 2s linear
}
@-webkit-keyframes circle-anim {
from { -webkit-clip-path: circle(50% at 50% 50%); }
to { -webkit-clip-path: circle(20% at 20% 20%); }
}
@-webkit-keyframes ellipse-anim {
from { -webkit-clip-path: ellipse(50% 40% at 50% 50%); }
to { -webkit-clip-path: ellipse(20% 20% at 20% 20%); }
}
@-webkit-keyframes polygon-anim {
from { -webkit-clip-path: polygon(nonzero, 0% 0%, 100% 0%, 100% 100%, 0% 100%); }
to { -webkit-clip-path: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%); }
}
</style>
<script src="../../animations/resources/animation-test-helpers.js"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
// FIXME: BasicShapeInset::blend is not implemented, when it is add an inset test.
// [1, "inset-box", "webkitClipPath", "inset(10% 10% 10% 10% round 0px 0px 0px 0px / 0px 0px 0px 0px)", 0.05],
[1, "circle-box", "webkitClipPath", "circle(35% at 35% 35%)", 0.05],
[1, "ellipse-box", "webkitClipPath", "ellipse(35% 30% at 35% 35%)", 0.05],
[1, "polygon-box", "webkitClipPath", "polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%)", 0.05],
];
runAnimationTest(expectedValues);
</script>
</head>
<body>
<div class="box" id="circle-box"></div>
<div class="box" id="ellipse-box"></div>
<div class="box" id="polygon-box"></div>
<div id="result">
</div>
</body>
</html>