modal-dialog-display-contents.html (1101B)
1 <!DOCTYPE html> 2 <html> 3 <title>Test that display: contents; on modal dialog & ::backdrop acts like display: block</title> 4 <meta charset="utf-8"> 5 <link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> 6 <link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element"> 8 <link rel="match" href="modal-dialog-display-contents-ref.html"> 9 <p>Test passes if there is a green dialog</p> 10 <p>Dialog is display:<span id="computed-value"></span></p> 11 <p>Dialog::backdrop is display:<span id="computed-value-backdrop"></span></p> 12 <dialog>Dialog Contents</dialog> 13 <style> 14 dialog { 15 display: contents; 16 background-color: green; 17 } 18 dialog::backdrop { 19 display: contents; 20 } 21 </style> 22 <script> 23 dialog = document.querySelector("dialog"); 24 dialog.showModal(); 25 document.getElementById("computed-value").textContent = getComputedStyle(dialog).display; 26 document.getElementById("computed-value-backdrop").textContent = getComputedStyle(dialog, "::backdrop").display; 27 </script> 28 </html>