blob: a884dbcf463c3b85226d379234832d42199265b5 (
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
|
<!DOCTYPE html>
<html>
<head>
<style>
.fixed {
position: fixed;
z-index: 1;
}
.absolute {
position: absolute;
}
.unscrollable {
overflow-x: hidden;
overflow-y: hidden;
}
.box {
top: 100px;
left: 10px;
width: 100px;
height: 100px;
}
.red {
background-color: red;
}
.lime {
background-color: lime;
}
.composited {
-webkit-transform: translatez(0);
}
</style>
<script type="text/javascript">
if (window.internals)
window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
if (window.testRunner) {
testRunner.dumpAsText();
window.addEventListener("load", function() {
document.getElementById("layertree").innerText = window.internals.layerTreeAsText(document);
}, false);
}
</script>
</head>
<body class="unscrollable">
<div style="height: 4000px">
<p>There should be no layers, because the body is unscrollable and there is
no need to composite the fixed-position layer.</p>
<pre id="layertree"></pre>
</div>
<!-- This should not be composited -->
<div class="fixed lime box"></div>
</body>
</html>
|