blob: fbef215afd5b0afcaf087bb6168ec9d8683faba9 (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/run-after-display.js"></script>
<style>
.compositedBehind {
width: 500px;
height: 500px;
-webkit-transform: translatez(0);
background-color: cyan;
}
.containerOverlapsComposited {
position: absolute;
z-index: 2; /* Creates a stacking context so that the fixed-pos layer is contained instead of a sibling */
top: 20px;
left: 20px;
width: 100px;
height: 30000px;
background-color: green;
}
.fixed {
position: fixed;
top: 45px;
left: 45px;
background-color: lime;
width: 50px;
height: 50px;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals) {
/* Note carefully, compositing for fixed position is _disabled_ here */
internals.settings.setAcceleratedCompositingForFixedPositionEnabled(false);
}
function test()
{
runAfterDisplay(function() {
if (window.internals)
window.internals.startTrackingRepaints(document);
window.scrollTo(0, 100);
runAfterDisplay(function() {
if (window.internals)
document.getElementById('layers').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
if (window.testRunner)
testRunner.notifyDone();
});
});
}
</script>
</head>
<body onload="test()">
<!--
Among other duplicate bugs: https://code.google.com/p/chromium/issues/detail?id=128375
A non-composited fixed-position element can get grouped into a composited container.
In this case, repaint invalidations were incorrectly going to the RenderView instead
of the composited container. The incorrect result was that the fixed-position element
never repainted, and it appeared to scroll along with the composited container.
-->
<div class="compositedBehind"> </div>
<div class="containerOverlapsComposited">
<div class="fixed"></div>
</div>
<pre id="layers"></pre>
</body>
</html>
|