summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/repaint/overflow-scroll-after-move.html
blob: 9158f5bbd15ac1c59f2e7019009016dbc27f27a9 (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
<!DOCTYPE html>
<html>
<head>
<script src="resources/text-based-repaint.js"></script>
<style>

#scroller {
  position: absolute;
  left: 10px;
  top: 60px;
  height: 400px;
  overflow: scroll;
  width: 300px;
  will-change: transform;
}
#block {
  background-color: #cef;
  height: 50px;
  left: 50px;
  position: absolute;
  top: 200px;
  width: 200px;
}

</style>
</head>
<body onload="runRepaintTest()">

This tests that an element which is moved by the synchronous layout in
Element::setScrollTop, and again by the scroll itself, has its original
location correctly invalidated.

<div id="scroller">
  <div style="height: 900px"></div>
  <div id="block"></div>
</div>
<script>

function repaintTest()
{
    document.querySelector("#block").style.top = '310px';
    document.querySelector("#scroller").scrollTop = 150;
}

</script>
</body>
</html>