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 <style> | |
tkent
2016/03/04 06:39:14
Remove this STYLE element.
ramya.v
2016/03/04 10:22:40
Done.
| |
7 option:default { background: lime; } | |
8 option { background: red; } | |
9 </style> | |
10 </head> | |
11 <body> | |
12 <form method="get"> | |
13 <select> | |
14 <option name="n">1</option> | |
15 <option name="y" selected>2</option> | |
16 <option id="o1" name="y">3</option> | |
17 </select> | |
18 </form> | |
19 <script> | |
20 test(function() { | |
21 document.getElementById("o1").selected = true; | |
22 u = document.getElementsByName("n"); | |
23 for (i = 0; i < u.length; i++) | |
24 assert_false(u[i].matches(':default')); | |
tkent
2016/03/04 06:39:14
wrong indentation.
ramya.v
2016/03/04 10:22:40
Done.
| |
25 v = document.getElementsByName("y"); | |
26 for (i = 0; i < v.length; i++) | |
27 assert_true(v[i].matches(':default')); | |
tkent
2016/03/04 06:39:14
wrong indentation
ramya.v
2016/03/04 10:22:40
Done.
| |
28 }, "This test performs a check for option elements having selected attribute to be considered for :default CSS selector."); | |
29 </script> | |
30 </body> | |
31 </html> | |
OLD | NEW |