Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <meta charset='utf-8'> |
| 4 | <head> |
| 5 | <script src="../dist/dialog-polyfill.js"></script> |
| 6 | <link rel="stylesheet" type="text/css" href="../dist/dialog-polyfill.css"> |
| 7 | <style> |
| 8 | dialog { |
| 9 | padding: 0px; |
| 10 | border: none; |
| 11 | margin: 0px; |
| 12 | } |
| 13 | |
| 14 | #bottom + .backdrop { |
| 15 | top: 100px; |
| 16 | left: 100px; |
| 17 | height: 300px; |
| 18 | width: 300px; |
| 19 | background-color: rgb(0, 50, 0); |
| 20 | z-index: 100; /* z-index has no effect. */ |
| 21 | } |
| 22 | |
| 23 | #bottom { |
| 24 | top: 125px; |
| 25 | left: 125px; |
| 26 | height: 250px; |
| 27 | width: 250px; |
| 28 | background-color: rgb(0, 90, 0); |
| 29 | } |
| 30 | |
| 31 | #middle + .backdrop { |
| 32 | top: 150px; |
| 33 | left: 150px; |
| 34 | height: 200px; |
| 35 | width: 200px; |
| 36 | background-color: rgb(0, 130, 0); |
| 37 | z-index: -100; /* z-index has no effect. */ |
| 38 | } |
| 39 | |
| 40 | #middle { |
| 41 | top: 175px; |
| 42 | left: 175px; |
| 43 | height: 150px; |
| 44 | width: 150px; |
| 45 | background-color: rgb(0, 170, 0); |
| 46 | } |
| 47 | |
| 48 | #top + .backdrop { |
| 49 | top: 200px; |
| 50 | left: 200px; |
| 51 | height: 100px; |
| 52 | width: 100px; |
| 53 | background-color: rgb(0, 210, 0); |
| 54 | z-index: 0; /* z-index has no effect. */ |
| 55 | } |
| 56 | |
| 57 | #top { |
| 58 | top: 225px; |
| 59 | left: 225px; |
| 60 | height: 50px; |
| 61 | width: 50px; |
| 62 | background-color: rgb(0, 255, 0); |
| 63 | z-index: -1000; /* z-index has no effect. */ |
| 64 | } |
| 65 | </style> |
| 66 | </head> |
| 67 | <body> |
| 68 | Test for modal dialog and backdrop stacking order. The test passes if there are |
| 69 | 6 boxes enclosed in each other, becoming increasingly smaller and brighter |
| 70 | green. |
| 71 | <dialog id="top"></dialog> |
| 72 | <dialog id="middle"></dialog> |
| 73 | <dialog id="bottom"></dialog> |
| 74 | <script> |
| 75 | var topDialog = document.getElementById('top'); |
| 76 | dialogPolyfill.registerDialog(topDialog); |
| 77 | var middleDialog = document.getElementById('middle'); |
| 78 | dialogPolyfill.registerDialog(middleDialog); |
| 79 | var bottomDialog = document.getElementById('bottom'); |
| 80 | dialogPolyfill.registerDialog(bottomDialog); |
| 81 | |
| 82 | topDialog.showModal(); |
| 83 | bottomDialog.showModal(); |
| 84 | topDialog.close(); // Just to shuffle the top layer order around a little. |
| 85 | middleDialog.showModal(); |
| 86 | topDialog.showModal(); |
| 87 | </script> |
| 88 | </body> |
| 89 | </html> |