mouse-click-display-none-details.html (764B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 - http://creativecommons.org/publicdomain/zero/1.0/ --> 4 5 <html class="reftest-wait"> 6 <script> 7 function runTest() { 8 // Both Chrome and Safari do not toggle the 'open' attribute for a <details> 9 // with 'display: none'. 10 var summary = document.getElementById("summary"); 11 summary.dispatchEvent(new MouseEvent("click")); 12 13 var details = document.getElementById("details"); 14 details.style.display = "block"; 15 16 document.documentElement.removeAttribute("class"); 17 } 18 </script> 19 <body onload="runTest();"> 20 <details id="details" style="display: none;"> 21 <summary id="summary">Summary</summary> 22 <p>This is the details.</p> 23 </details> 24 </body> 25 </html>