test_bug612730.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=612730
  5. -->
  6. <head>
  7. <title>Test for Bug 612730</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=612730">Mozilla Bug 612730</a>
  14. <p id="display"></p>
  15. <div id="content">
  16. <select multiple required>
  17. <option value="">foo</option>
  18. <option value="">bar</option>
  19. </select>
  20. </div>
  21. <pre id="test">
  22. <script type="application/javascript">
  23. /** Test for Bug 612730 **/
  24. SimpleTest.waitForExplicitFinish();
  25. function runTest()
  26. {
  27. var select = document.getElementsByTagName('select')[0];
  28. select.addEventListener("focus", function() {
  29. select.removeEventListener("focus", arguments.callee, false);
  30. isnot(select.selectedIndex, -1, "Something should have been selected");
  31. ok(!select.matches(":-moz-ui-valid"),
  32. ":-moz-ui-valid should not apply");
  33. todo(!select.matches(":-moz-ui-invalid"),
  34. ":-moz-ui-invalid should not apply");
  35. SimpleTest.finish();
  36. }, false);
  37. synthesizeMouse(select, 5, 5, {});
  38. }
  39. SimpleTest.waitForFocus(runTest);
  40. </script>
  41. </pre>
  42. </body>
  43. </html>