summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/transforms/transform-positioned-container.html
blob: f0aa6b8f208e979bdd8e5ca2acdfbb4ea00db0a5 (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
<!DOCTYPE html>
<style>
#old-container {
    position: relative;
}

#positioned-child {
    position: absolute;
}

#descendant-needing-layout {
    display: none;
    width: 100px;
    height: 100px;
    background-color: green;
}
</style>
This test verifies adding transform to a block correctly update container status.
<div id="old-container">
    <div id="new-container">
        <div id="positioned-child">
            <div id="descendant-needing-layout">
            </div>
        </div>
    </div>
</div>
<script>
function runTest() {
    document.body.offsetTop;

    var newContainer = document.getElementById("new-container");
    var descendantNeedingLayout = document.getElementById("descendant-needing-layout");

    newContainer.style.transform = "translateX(0)";
    descendantNeedingLayout.style.display = "block";
}

runTest();
</script>