summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/visibility/layer-visible-content.html
blob: 71d2f6540b1a7fa6266b63bf2ed2cf52842c03e7 (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
60
61
62
63
64
65
66
67
68
69
70
71
<html>
<head>
  <style type="text/css">
    body {
        margin: 0;
        overflow: hidden;
    }
    
    .container {
        visibility: hidden;
        position: absolute;
        width: 200px;
        height: 200px;
        overflow: hidden;
        z-index: 0;
    }
    
    .box {
        height: 100px;
        width: 100px;
    }
    
    .indicator {
        position: absolute;
        top: 0;
        left: 0;
        background-color:red;
    }
    
    .visible-box {
        background-color:green;
    }
    .composited {
        transform:translateZ(0);
        height: 10px;
        width: 10px;
    }
    pre {
        opacity: 0; /* hide in pixel result */
        height: 16px; /* avoid platform-dependent height difference of hidden text layer-tree */
    }
  </style>
  <script>
    if (window.testRunner)
        testRunner.dumpAsTextWithPixelResults();
    
    function dumpLayers()
    {
        if (window.testRunner)
            document.getElementById('layer-tree').innerText = window.internals.layerTreeAsText(document);
    }
    window.addEventListener('load', dumpLayers, false);
  </script>
</head>

<body>
  <!-- You should see a green box in the top left, and no red. -->
  <div class="indicator box"></div>

  <div class="container">
    <div style="position: relative;">
      <div style="visibility:visible;">
        <div class="visible-box box">
          <div class="composited box"></div>
        </div>
      </div>
    </div>
  </div>
<pre id="layer-tree">Layer tree goes here in DRT</pre>
</body>
</html>