summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/squashing/invisible-layers-should-not-affect-geometry.html
blob: 7b7b745bed481405f57d907609a35bb3814f61c8 (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
<!DOCTYPE html>
<html>
<head>
  <style>
    .box {
      position: absolute;
      top: 10px;
      left: 10px;
      height: 100px;
      width: 100px;
      background-color: green;
    }
    .invisible {
      height: 400px;
      width: 400px;
      position: absolute;
      visibility: hidden;
      background-color: red;
    }
    .composited {
      transform: translateZ(0);
    }
  </style>
  <script>
    if (window.testRunner)
      testRunner.dumpAsText();
    function runTest() {
      if (window.internals) {
        var pre = document.createElement('pre');
        pre.innerHTML = window.internals.layerTreeAsText(document);
        document.body.appendChild(pre);
      }
    }
    window.onload = runTest;
  </script>
</head>
<body>
  <!-- 
  The invisible layer should have no effect on the geometry of the
  composited layers. If you see a rect with dimensions 400x400, that means
  that the invisible layer has been included and things are broken.
  -->
  <div class="composited box"></div>
  <div class="box"></div>
  <div class="invisible">
    <div class="box"></div>
  </div>
</body>
</html>