diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html new file mode 100644 index 0000000000..9e0616e952 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html @@ -0,0 +1,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> |