<!DOCTYPE html> <html> <head> <style> .composited { transform:translatez(0); } .box { width: 100px; height: 100px; } .green { background-color: green; } .lime { background-color: lime; } .blue { background-color: blue; } .behind { z-index: -3; position: absolute; top: 50px; left: 50px; } .inmiddle { z-index: -2; position: absolute; top: 80px; left: 80px; } .ontop { z-index: -1; position: absolute; top: 110px; left: 110px; } #layertree { position: absolute; left: 10000px; top: 0px; } body { overflow: hidden; } </style> <script> if (window.testRunner) { testRunner.dumpAsTextWithPixelResults(); testRunner.waitUntilDone(); } window.addEventListener('load', function() { if (window.testRunner) { document.getElementById("layertree").innerText = window.internals.layerTreeAsText(document); testRunner.notifyDone(); } }, false); </script> </head> <body> <!-- This green div should be completely underneath the lime div --> <div class="composited green box behind"> </div> <!-- This lime colored div should correctly detect overlap and become composited. --> <div class="lime box inmiddle"> </div> <!-- The blue colord div should also correctly detect overlap on top of the second layer. --> <div class="blue box ontop"> </div> <pre id="layertree"></pre> </body> </html>