blob: 7357e7e4fc2b27c83f84e23a2477f63d8ba66b38 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.box {
position: relative;
display: inline-block;
margin: 30px;
width: 200px;
height: 200px;
will-change: transform;
}
.main {
border: 40px solid black;
box-shadow: black 0 0 20px; /* Makes compositing layer larger */
background-color: red;
}
.child {
position: absolute;
width: 150px;
height: 150px;
padding: 20px;
transform: translateZ(1px);
}
.negative {
z-index: -1;
top: 0;
left: 0;
height: 10px;
width: 10px;
}
img {
background-color: green;
height: 200px;
width: 200px;
}
.embiggener {
position: absolute;
height: 10px;
width: 10px;
top: -50px;
left: -50px;
background-color: blue;
}
#layer-tree {
opacity: 0; /* hide from pixel test */
height: 10px; /* avoid scrollbars */
overflow: hidden;
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.testRunner)
testRunner.dumpAsTextWithPixelResults();
function dumpLayerTree()
{
if (window.testRunner)
document.getElementById('layer-tree').innerText = internals.layerTreeAsText(document);
}
window.addEventListener('load', dumpLayerTree, false);
</script>
</head>
<body>
<!-- Both boxes should look the same. You should see no red. -->
<div class="main box">
<img>
<div class="negative child"></div>
</div>
<div class="main box" style="overflow: hidden;">
<img>
<div class="negative child"></div>
</div>
<pre id="layer-tree"></pre>
</body>
</html>