summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/background-paint-composited-scrolled.html
blob: b8c1c35776ae9e97ca164839719b176da2d595ca (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
<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
#box, #box-unchanged {
  margin-left: 300px;
  width: 50px;
  height: 50px;
}
#box {
  margin-top: 150px;
  background-color: yellow;
}
#box-unchanged {
  background-color: blue;
}
#container {
  width: 500px;
  height: 500px;
  backface-visibility: hidden;
  overflow: scroll;
}
</style>
Tests invalidation and painting of a box changing background while composited scrolled.
<div id="container">
<div id="box"></div>
<div id="box-unchanged"></div>
<div style="height: 4000px"></div>
</div>
<script>

if (window.testRunner) {
  testRunner.dumpAsTextWithPixelResults();
  testRunner.waitUntilDone();
}

runAfterLayoutAndPaint(function() {
  var container = document.querySelector('#container');
  var box = document.querySelector("#box");
  container.scrollTop = 400;
  box.style.backgroundColor = "green";
  runAfterLayoutAndPaint(function() {
    container.scrollTop = 0;
    if (window.testRunner)
      testRunner.notifyDone();
  });
});

</script>