<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
.box { | |
position: relative; | |
display: inline-block; | |
margin: 30px; | |
width: 200px; | |
height: 200px; | |
-webkit-transform: translateZ(0); | |
} | |
.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; | |
-webkit-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.dumpAsText(true); | |
function dumpLayerTree() | |
{ | |
if (window.testRunner) | |
document.getElementById('layer-tree').innerText = window.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> |