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 | </head> |
| 8 | <body> |
| 9 | |
| 10 | <p> |
| 11 | The dialog below is incorrectly positioned within a stacking context. |
| 12 | It should generate a console warning message, and place the <code>_dialog_overlay</code> in a different place in order to try to work around the problem without moving the dialog itself. |
| 13 | </p> |
| 14 | |
| 15 | <div style="position: absolute; top: 100px; left: 10vw; width: 80vw; height: 400px; background: blue; opacity: 0.7;"> |
| 16 | |
| 17 | <dialog> |
| 18 | <form method="dialog"> |
| 19 | <input type="submit" /> |
| 20 | </form> |
| 21 | <p> |
| 22 | Help, I'm inside an extra stacking context D: |
| 23 | </p> |
| 24 | </dialog> |
| 25 | |
| 26 | </div> |
| 27 | |
| 28 | <button id="show">Show Dialog</button> |
| 29 | |
| 30 | <script> |
| 31 | var dialog = document.querySelector('dialog'); |
| 32 | dialogPolyfill.registerDialog(dialog); |
| 33 | dialog.showModal(); |
| 34 | |
| 35 | show.addEventListener('click', function() { |
| 36 | dialog.showModal(); |
| 37 | }); |
| 38 | |
| 39 | </script> |
| 40 | </body> |
| 41 | </html> |