summaryrefslogtreecommitdiffstats
path: root/layout/reftests/scrolling/fractional-scroll-area-invalidation.html
blob: 2b20f160cddc6f5cd7004e32bbb63047999f0362 (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
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en" reftest-async-scroll>
<meta charset="utf-8">
<title>Make sure the scrolled layer is not invalidated when you scroll all the way to the bottom</title>

<style>

body {
  margin: 0;
}

.scrollbox {
  margin: 50px;
  width: 200px;
  height: 200px;
  overflow: auto;
}

.scrolled-contents {
  height: 150.2px;
  padding-top: 150px;
}

.reftest-no-paint {
  margin: 0 20px;
  border: 1px solid blue;
  height: 25px;
}

</style>

<body>

<div class="scrollbox"
     reftest-displayport-x="0" reftest-displayport-y="0"
     reftest-displayport-w="200" reftest-displayport-h="200"
     reftest-async-scroll-x="0" reftest-async-scroll-y="0">
  <div class="scrolled-contents">
    <div class="reftest-no-paint">
      <!-- This element has the magic "reftest-no-paint" class which
           constitutes the actual test here. -->
    </div>
  </div>
</div>

<script>

var scrollbox = document.querySelector(".scrollbox");
scrollbox.scrollTop = 2;
scrollbox.scrollTop = 1;
scrollbox.scrollTop = 0;

function doTest() {
  scrollbox.scrollTop = 999;
  document.documentElement.removeAttribute("class");
}
document.addEventListener("MozReftestInvalidate", doTest);

</script>