top-layer-containing-block.html (1723B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="match" href="top-layer-containing-block-ref.html"> 5 <link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer"> 6 <style> 7 ::backdrop { 8 display: none; 9 } 10 </style> 11 </head> 12 <body> 13 <p> 14 This tests that a modal dialog's containing block is in the initial containing block and that it is unaffected by 15 ancestor elements with overflow or opacity. 16 <div style="position: absolute; top: 400px; opacity: 0.3"> 17 <dialog id="opaqueDialog" style="position: absolute; top: 250px; left: 0px; background-color: magenta; outline: none"> 18 This dialog should be unaffected by its ancestor with opacity. 19 </dialog> 20 </div> 21 <div style="position: absolute; overflow: hidden; width: 500px; height: 150px; top: 400px; left: 300px"> 22 <dialog id="unclippedDialog" style="position: absolute; top: 200px; left: 0px; height: 100px; background-color: cyan"> 23 This dialog should be unaffected by its ancestor with overflow. It should not be clipped. 24 </dialog> 25 </div> 26 <div style="position: absolute; top: 1000px; left: 1000px; width: 20px;"> 27 <dialog id="bottomDialog" style="position: absolute; top: 100px; height: 250px; width: 90%; background-color: yellow"> 28 This dialog should be onscreen with a width of 90% of the page. It is the child of an narrow element 29 positioned off screen, but the containing block of a top layer element is the initial containing block, so its 30 position and percent lengths are relative to that. 31 </dialog> 32 </div> 33 <script> 34 document.getElementById('bottomDialog').showModal(); 35 document.getElementById('unclippedDialog').showModal(); 36 document.getElementById('opaqueDialog').showModal(); 37 </script> 38 </body> 39 </html>