summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/repaint/fixed-child-of-transformed-scrolled.html
blob: 1bd2961e6e3ecfd2004b967d593aa89122ba4aa6 (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
<!DOCTYPE html>
<script src="resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
  document.getElementById('fixed').style.backgroundColor = 'green';
}
onload = function() {
  document.getElementById('transformed').scrollTop = 50;
  runRepaintTest();
}
</script>
<style>
#transformed {
  position: absolute;
  top: 50px;
  left: 100px;
  transform: translateX(0);
  overflow: scroll;
  width: 300px;
  height: 300px;
}
#fixed {
  position: fixed;
  top: 150px;
  left: 100px;
  width: 100px;
  height: 100px;
  background-color: red;
}
#relative {
  position: relative;
  top: 50px;
  left: 50px;
}
/* to make the transformed container scrollable */
#content {
  width: 1000px;
  height: 1000px;
}
</style>
Tests invalidation of a fixed-position child of a transformed scrolled element.
Passes if there is a green box at the center of the scrollable area.
<div id="transformed">
  <div id="fixed"></div>
  <div id="content"></div>
</div>