summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/repaint/overflow-move-after-scroll.html
blob: 3d84f42de96fc0b0c7703ad4fd5672aa561be255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!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="runRepaintTest()">

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>