blob: 3290656eca40547f0b387d1e0fc6827dd5e35c4e [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
<html>
<head>
<title>Test that the overflow controls host layer is correctly parented when it no longer needs to overlap scrolled contents</title>
<style>
.scroller {
position: relative;
width: 300px;
height: 300px;
margin: 30px;
overflow: scroll;
border: 15px solid gray;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.filler {
width: 100px;
height: 250px;
background-color: silver;
}
.box {
position: absolute;
width: 100%;
height: 100px;
background-color: white;
z-index: 2;
transform: translateZ(0);
}
.outer.box {
top: 150px;
left: 150px;
width: 240px;
background-color: rgba(134, 123, 28, 0.75)
}
body.changed .box {
transform: none;
}
</style>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
if (window.internals)
internals.setUsesOverlayScrollbars(true);
window.addEventListener('load', () => {
setTimeout(() => {
document.body.classList.add('changed');
if (window.internals)
document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}, false);
</script>
</head>
<body>
<div class="scroller">
<div class="filler"></div>
<div class="box"></div>
<div class="filler"></div>
</div>
<div class="outer box"></div>
<pre id="layers"></pre>
</body>
</html>