test_bug557087-6.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=557087
  5. -->
  6. <head>
  7. <title>Test for Bug 557087</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557087">Mozilla Bug 557087</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. <fieldset disabled>
  16. <input>
  17. </fieldset>
  18. </div>
  19. <pre id="test">
  20. <script type="application/javascript">
  21. /** Test for Bug 557087 **/
  22. // Testing random stuff following review comments.
  23. var fieldset = document.getElementsByTagName("fieldset")[0];
  24. is(fieldset.elements.length, 1,
  25. "there should be one element inside the fieldset");
  26. is(fieldset.elements[0], document.getElementsByTagName("input")[0],
  27. "input should be the element inside the fieldset");
  28. document.body.removeChild(document.getElementById('content'));
  29. is(fieldset.querySelector("input:disabled"), fieldset.elements[0],
  30. "the input should still be disabled");
  31. fieldset.disabled = false;
  32. is(fieldset.querySelector("input:enabled"), fieldset.elements[0],
  33. "the input should be enabled");
  34. </script>
  35. </pre>
  36. </body>
  37. </html>