summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-child-layer.html
blob: 097c49ca317efc5036754e776dc7d61f258edb9f (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
<html>
<head>
<style>
    #container {
        position: absolute;
        top: 0px;
        left: 400px;
        transform: translateZ(0);
    }

    #red {
        position: absolute;
        top: 0px;
        left: -400px;
        height: 256px;
        width: 256px;
        background-color: red;
    }

    #green {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 300px;
        height: 300px;
        background-color: green;
    }

    #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>

<body>
    <!-- container has empty bounds, but is composited -->
    <div id="container">
        <!-- this red square should not appear over the green square -->
        <div id="red"></div>
    </div>

    <!-- This green square should composite because it overlaps the red one -->
    <div id="green"></div>

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