blob: 5c52bcd8774999a005e6c603ab9d8ec4ff4e55bb [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
<html>
<head>
<title>Check that scrolling nodes get reparented when an ancestor is removed</title>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function doTest() {
requestAnimationFrame(() => {
document.getElementById('target').classList.add('changed');
if (window.internals)
document.getElementById('scrollingTree').innerText = window.internals.scrollingStateTreeAsText() + "\n";
if (window.testRunner)
testRunner.notifyDone();
});
}
window.addEventListener('load', doTest, false);
</script>
<style>
.scroller {
background-color: silver;
border: 1px solid black;
padding: 10px;
width: 400px;
height: 300px;
overflow: scroll;
}
#target.changed {
overflow: visible;
}
.scrolling-content {
height: 1000px;
}
</style>
</head>
<body>
<div class="scroller">
<div class="scrolling-content">
Scrolling content
<div class="intermediate scroller" id="target">
<div class="scrolling-content">
Middle scrolling content
<div class="inner scroller">
<div class="scrolling-content">
Inner scrolling content
</div>
</div>
</div>
</div>
</div>
</div>
<pre id="scrollingTree"></pre>
</body>
</html>