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