<!DOCTYPE html>
<html>
<head>
<script src="../resources/text-based-repaint.js"></script>
<style>
#scroller {
position: absolute;
left: 10px;
top: 60px;
width: 700px;
height: 400px;
overflow: scroll;
will-change: transform;
}
#block {
background-color: #cef;
position: absolute;
left: 300px;
top: 200px;
width: 120px;
height: 50px;
text-align: center;
}
</style>
</head>
<body onload="runRepaintAndPixelTest()">
This tests that a scroll updates an element's previous paint invalidation rect
even if the element's position relative to the parent blink::Layer is unchanged.
<div id="scroller" class="scroller">
<div style="height: 600px"></div>
<div style="position: absolute; top: 0">
<div id="block"></div>
</div>
</div>
<script>
function repaintTest()
{
document.querySelector("#scroller").scrollTop = 100;
document.querySelector("#block").style.left = '50px';
}
</script>
</body>
</html>