<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
#box {
position: absolute;
left: 300px;
top: 150px;
width: 50px;
height: 50px;
background-color: yellow;
}
</style>
<div id="box"></div>
<div style="height: 900px"></div>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
runAfterLayoutAndPaint(function() {
var box = document.querySelector("#box");
scrollTo(0, 100);
box.style.backgroundColor = "green";
runAfterLayoutAndPaint(function() {
scrollTo(0, 0);
if (window.testRunner)
testRunner.notifyDone();
});
});
</script>