summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-negative-z-index-multiple.html
blob: 4d14f019a75810f80fd7f0c1b1263463d5914ae6 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<style>

  .composited {
    transform:translatez(0);
  }

  .box {
    width: 100px;
    height: 100px;
  }

  .green {
    background-color: green;
  }

  .lime {
    background-color: lime;
  }

  .blue {
    background-color: blue;
  }

  .behind {
    z-index: -3;
    position: absolute;
    top: 50px;
    left: 50px;
  }

  .inmiddle {
    z-index: -2;
    position: absolute;
    top: 80px;
    left: 80px;
  }

  .ontop {
    z-index: -1;
    position: absolute;
    top: 110px;
    left: 110px;
  }

  #layertree {
    position: absolute;
    left: 10000px;
    top: 0px;
  }

  body {
    overflow: hidden;
  }

</style>
<script>
    if (window.testRunner) {
        testRunner.dumpAsTextWithPixelResults();
        testRunner.waitUntilDone();
    }

    window.addEventListener('load', function() {
        if (window.testRunner) {
            document.getElementById("layertree").innerText = window.internals.layerTreeAsText(document);
            testRunner.notifyDone();
        }
    }, false);
</script>

</head>

<body>
  <!-- This green div should be completely underneath the lime div -->
  <div class="composited green box behind"> </div>

  <!-- This lime colored div should correctly detect overlap and become composited. -->
  <div class="lime box inmiddle"> </div>

  <!-- The blue colord div should also correctly detect overlap on top of the second layer. -->
  <div class="blue box ontop"> </div>

  <pre id="layertree"></pre>
</body>

</html>