blob: 9e0616e952033642489edaf1de7bc7f4b09433bf (
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
|
<!DOCTYPE html>
<html>
<head>
<link rel="match" href="top-layer-nesting-ref.html">
<link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer">
<style>
dialog {
height: 150px;
width: 150px;
outline: none;
}
::backdrop {
display: none;
}
#bottomDialog {
background-color: yellow;
top: 100px;
z-index: 1000;
}
#middleDialog {
background-color: blue;
top: 150px;
left: 50px;
z-index: -500;
}
#topDialog {
background-color: green;
top: 200px;
left: 100px;
z-index: -1000;
}
.red {
background-color: red;
top: 250px;
left: 0px;
}
</style>
</head>
<body>
This tests that top layer elements are stacked correctly even if nested in the DOM tree.
The test passes if you see no red rectangles and see 3 rectangles stacked in the following order (from bottom to top): yellow, blue, green.
<dialog id="topDialog">
<dialog id="middleDialog">
<dialog id="bottomDialog">
<dialog id="hiddenDialog" class="red">
<dialog id="hiddenDialogChild" class="red"></dialog>
</dialog>
</dialog>
</dialog>
</dialog>
<script>
document.getElementById('hiddenDialogChild').showModal();
document.getElementById('hiddenDialog').showModal();
document.getElementById('bottomDialog').showModal();
document.getElementById('middleDialog').showModal();
document.getElementById('topDialog').showModal();
document.getElementById('hiddenDialog').close();
</script>
</body>
</html>
|