backdrop-dynamic-display-none.html (715B)
1 <!DOCTYPE html> 2 <html> 3 <title>Test that adding display: none; dynamically on ::backdrop makes it disappear</title> 4 <meta charset="utf-8"> 5 <link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> 6 <link rel="match" href="backdrop-dynamic-display-none-ref.html"> 7 <link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer"> 8 <p>Test passes if there is no red.</p> 9 <dialog></dialog> 10 <style> 11 dialog { visibility: hidden; } 12 ::backdrop { background-color: red; } 13 .hidden-backdrop::backdrop { 14 display: none; 15 } 16 </style> 17 <script> 18 dialog = document.querySelector("dialog"); 19 dialog.showModal(); 20 requestAnimationFrame(() => { 21 dialog.classList.add("hidden-backdrop"); 22 }); 23 </script> 24 </html>