blob: eeb5cef83b536dd141e263803788051a966e9f5c (
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
88
89
90
91
92
93
|
<style>
body {
overflow: hidden;
}
.composited {
transform: translateZ(0);
}
.box {
width: 100px;
height: 100px;
background-color: blue;
}
img {
background-color: black;
width: 100px;
height: 100px;
border: none !important;
}
div.inline {
width: 100px;
height: 100px;
background-color: red;
}
img.to-visible {
visibility: hidden;
}
body.changed img.to-visible {
visibility: visible;
}
img.to-hidden {
visibility: visible;
}
body.changed img.to-hidden {
visibility: hidden;
}
#layers {
opacity: 0; /* hide from pixel result */
}
.box {
width: 100px;
height: 100px;
background-color: green;
}
.indicator {
position: absolute;
left: 0;
z-index: 1;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
testRunner.waitUntilDone();
}
function doTest()
{
window.setTimeout(function() {
document.body.classList.add('changed');
if (window.testRunner) {
document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
testRunner.notifyDone();
}
}, 0);
}
window.addEventListener('load', doTest, false);
</script>
<body>
<!-- You should see no red. -->
<div class="indicator box" style="top: 0px"></div>
<div class="indicator box" style="top: 250px"></div>
<div style="position: absolute; left: 0px; top: 0px; z-index: 0; " class="composited">
<div class="inline"></div>
<img style="position: absolute; left: 50px; top: 50px; z-index: -1;">
<img style="position: absolute; left: 400px; top: 150px; z-index: 0;" class="to-visible">
</div>
<div style="position: absolute; left: 0px; top: 250px; z-index: 0; " class="composited">
<div class="inline"></div>
<img style="position: absolute; left: 50px; top: 50px; z-index: -1;">
<img style="position: absolute; left: 400px; top: 150px; z-index: 0;" class="to-hidden">
</div>
<pre id="layers">Layer tree goes here in DRT</pre>
</body>
|