blob: 3f3ecdaec2580dff7800dc764123d5649db6e731 (
plain)
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
|
<!DOCTYPE html>
<html>
<head>
<style>
.container {
height: 240px;
width: 120px;
overflow: hidden;
position: relative;
z-index: 0; /* create stacking context */
border: 1px solid black;
}
.box {
position: relative;
width: 100px;
height: 100px;
margin: 10px;
background-color: blue;
}
.animating {
-webkit-animation: spin 2s infinite linear;
}
@-webkit-keyframes spin {
from { transform: rotate(90deg); }
to { transform: rotate(360deg); }
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function runTest()
{
var box = document.getElementById('to-animate');
box.addEventListener('webkitAnimationStart', animationStarted, false);
box.className = 'animating box';
}
function animationStarted()
{
if (window.testRunner) {
var layerText = window.internals.layerTreeAsText(document);
// The animation can progress before the start event is handled, so remove the
// effects as they can vary.
layerText = layerText.replace(/\[.*,.*,.*,.*\]/g, '[...]');
document.getElementById('layers').innerText = layerText;
testRunner.notifyDone();
}
}
window.addEventListener('load', runTest, false);
</script>
</head>
<body>
<div class="container">
<div id="to-animate" class="box"></div>
<!-- This div will get a layer -->
<div class="box"></div>
</div>
<!-- This div should not get a layer -->
<div class="box"></div>
<pre id="layers">Layer tree goes here in DRT</pre>
</body>
</html>
|