blob: 96cb5b4882521cfebeab3502bcab0f9cb9329b7d [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<style>
.bar {
width: 200px;
height: 50px;
margin-left: 50px;
background-color: gray;
transform: translateZ(0);
}
#overflow {
position: absolute;
top: 70px;
left: 100px;
z-index: 100;
height: 200px;
width: 200px;
border: 1px solid black;
overflow: scroll;
}
#overflow > div {
position: relative;
height: 50px;
width: 100%;
border: 2px solid black;
margin: 2px;
}
</style>
<script>
function doTest()
{
var overflow = document.getElementById('overflow');
overflow.scrollTop = 50;
runAfterLayoutAndPaint(function() {
overflow.scrollTop = 75;
}, true);
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div class="bar"></div>
<div id="overflow">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>