mouse-click-display-none-details.html 764 B

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