<!DOCTYPE html>
<html>
<head>
<style>
.fixed {
position: fixed;
z-index: 1;
}
.absolute {
position: absolute;
}
.unscrollable {
overflow-x: hidden;
overflow-y: hidden;
}
.box {
top: 100px;
left: 10px;
width: 100px;
height: 100px;
}
.red {
background-color: red;
}
.lime {
background-color: lime;
}
.composited {
will-change: transform;
}
</style>
<script type="text/javascript">
if (window.internals) {
internals.settings.setPreferCompositingToLCDTextEnabled(true);
}
if (window.testRunner) {
testRunner.dumpAsText();
window.addEventListener("load", function() {
document.getElementById("layertree").innerText = internals.layerTreeAsText(document);
}, false);
}
</script>
</head>
<body class="unscrollable">
<div style="height: 4000px">
<pre id="layertree"></pre>
</div>
<!-- This should not be promoted to a composited layer, because the body is
unscrollable and there is no need to composite the fixed-position layer.
-->
<div class="fixed lime box"></div>
</body>
</html>