summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/will-change/containing-block-added.html
blob: dd65d4d2225027caa537614ea4be5315d08f1d67 (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
<!DOCTYPE html>
<html>
<head>
  <style>
    #container {
      will-change: top;
      position: absolute;
      left: 200px;
      top: 100px;
      width: 100px;
      height: 100px;
      background-color: blue;
    }

    .fixed {
      position: fixed;
      left: 50px;
      top: 50px;
      width: 75px;
      height: 75px;
      background-color: green
    }
  </style>
  <script src="../../fast/repaint/resources/text-based-repaint.js"></script>
  <script>
    function repaintTest()
    {
      // Adding "will-change: -webkit-transform" to the container div should
      // make this div become the containing block for its fixed position
      // descendant.
      document.getElementById("container").style.willChange = "transform";
    }
    onload = runRepaintAndPixelTest;
  </script>
</head>

<body>
  <div id="container">
    <div class="fixed"></div>
  </div>
</body>

</html>