summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/clone-node-z-index.html
blob: 97eea2bbe0ac77c081f6246b89a45a813a7066b4 (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
<html>
<body>

<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=37900">bug 37900</a>:
cloneNode() does not preserve z-index with more than six digit</p>

<div style="position:absolute; top: 80px">
    <div id="layer" style="position:absolute; left:10px; top:10px; width:100px; height:100px; border:solid 1px red; background:#fff0f0; z-index:20002000">
    </div>
    <div style="position:absolute; left:25px; top:30px; width:100px; height:100px; border: solid 1px #006600; background:#f0fff0; z-index:1000">
    </div>
</div>
<div id="msgs">
</div>
</body>

<script language="javascript">

var lc = window.testRunner;
if (lc) {
    lc.dumpAsText();
}

var oldEl = document.getElementById('layer');
layer.style.left = '50px';

var newEl = oldEl.cloneNode(true);
var container = oldEl.parentNode;
container.removeChild(oldEl);
container.appendChild(newEl);

var msgs = [];
msgs.push(newEl.style.zIndex == 20002000 ? "PASS" : "FAIL");
document.getElementById('msgs').innerHTML = msgs.join('<br/>');

</script>
</html>