summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-clipping.html
blob: 4792d0fcf33d1f9b3a147f9f8462d38b5f0bb067 (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>

    #clipped {
        position: absolute;
        left: 0px;
        right: 0px;
        width: 100px;
        height: 100px;
        overflow: hidden;
    }

    #child {
        width: 500px;
        height: 100px;
        background-color: green;
        transform:translateZ(0);
    }

    #overlap {
        position: absolute;
        left: 400px;
        top: 0px;
        width: 100px;
        height: 100px;
        background-color: blue;
    }

    #row1 {
        position: absolute;
        left: 50px;
        top: 50px;
    }

    #row2 {
        position: absolute;
        left: 50px;
        top: 200px;
    }
</style>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText();
        window.addEventListener('load', function() {
            document.getElementById("layertree").innerText = window.internals.layerTreeAsText(document);
        }, false);
    }
</script>
</head>
<body>
    <div id="row1">
        <div id="clipped">
            <div id="child"></div>
        </div>

        <!-- this element should not get its own layer -->
        <div id="overlap"></div>
    </div>

    <div id="row2">
        <div id="clipped"></div>
        <div id="child"></div>

        <!-- this element should get its own layer -->
        <div id="overlap"></div>
    </div>

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