summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-under-transform.html
blob: 3e789f35421c1a9f5a68151f49a43e3eccf2bc59 (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
<!DOCTYPE html>
<html>
<head>
<style>
    body {
        height: 5000px;
        overflow-x: hidden;
    }

    #transform {
        z-index: 0;
        /* transform establishes a fixed pos container, so translate to make up for scroll offset so indicator is still underneath overlap */
        transform:translate3d(0px, 1000px, 0px);
    }

    #indicator {
        width: 256px;
        height: 256px;
        background-color: red;
        position: fixed;
        left: 100px;
        top: 100px;
    }

    #overlap {
        width: 500px;
        height: 500px;
        background-color: green;
        position: fixed;
        left: 0px;
        top: 0px;
    }
</style>
<script>
    function doTest() {
        window.scrollTo(0, 1000);
        if (window.testRunner) {
            document.getElementById('layertree').innerText = window.internals.layerTreeAsText(document);
            testRunner.dumpAsTextWithPixelResults();
        }
    }
    window.addEventListener("load", doTest, false);
</script>
</head>
<body>
    <!-- the red indicator should be covered by the green overlap element -->
    <div id="transform">
        <div id="indicator"></div>
    </div>
    <div id="overlap"></div>

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