backdrop-inherits.html (582B)
1 <!DOCTYPE html> 2 <link rel="match" href="backdrop-inherits-ref.html"> 3 <link rel="help" href="https://drafts.csswg.org/css-position-4/#backdrop"> 4 <style> 5 dialog { 6 --backdrop-bg: green; 7 visibility: hidden; 8 } 9 10 dialog::backdrop { 11 position: absolute; 12 top: 100px; 13 left: 100px; 14 height: 100px; 15 width: 100px; 16 visibility: visible; 17 background-color: var(--backdrop-bg); 18 } 19 </style> 20 Test that ::backdrop inherits from its originating element. The test passes if 21 there is a green box and no red. 22 <dialog></dialog> 23 <script> 24 document.querySelector('dialog').showModal(); 25 </script>