OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <form method="get"> |
| 9 <select> |
| 10 <option name="n">1</option> |
| 11 <option name="y" selected>2</option> |
| 12 <option id="o1" name="y">3</option> |
| 13 <option id="o2" name="n">4</option> |
| 14 </select> |
| 15 </form> |
| 16 <script> |
| 17 test(function() { |
| 18 document.getElementById("o1").defaultSelected = true; |
| 19 document.getElementById("o2").selected = true; |
| 20 u = document.getElementsByName("n"); |
| 21 for (i = 0; i < u.length; i++) |
| 22 assert_false(u[i].matches(":default")); |
| 23 v = document.getElementsByName("y"); |
| 24 for (i = 0; i < v.length; i++) |
| 25 assert_true(v[i].matches(":default")); |
| 26 }, "This test performs a check for option elements having selected attribute to
be considered for :default CSS selector."); |
| 27 </script> |
| 28 </body> |
| 29 </html> |
OLD | NEW |