forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopacity-transition-zindex.html
77 lines (69 loc) · 1.58 KB
/
opacity-transition-zindex.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
<!DOCTYPE html>
<html>
<head>
<style>
* {
margin: 0;
}
#container {
position: relative;
height: 300px;
width: 300px;
margin: 10px;
background-color: green;
opacity: 0.5;
transition-property: opacity;
transition-timing-function: linear;
transition-duration: 5s;
}
#box {
position: absolute;
left: 10px;
top: 10px;
height: 200px;
width: 200px;
background-color: blue;
}
#indicator {
position: absolute;
top: 150px;
left: 150px;
height: 100px;
width: 100px;
background-color: orange;
z-index: -1;
}
</style>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
function waitForCompositor() {
var box = document.getElementById('box');
return box.animate({transform: ['scale(1)', 'scale(1)']}, 1).ready;
}
function runTest()
{
var container = document.getElementById('container');
container.style.opacity = 1;
// dump the tree in the middle of the transition
if (window.internals) {
window.internals.forceCompositingUpdate(document);
window.internals.pauseAnimations(2.5);
}
if (window.testRunner) {
waitForCompositor().then(() => {
testRunner.notifyDone();
});
}
}
// FIXME: this should use runTransitionTest().
window.addEventListener('load', runTest, false);
</script>
</head>
<body>
<div id="container">
<div id="box"></div>
<div id="indicator"></div>
</div>
</body>
</html>