| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <body> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> |
| 6 <select> |
| 7 <option>Unselected</option> |
| 8 <option selected>Selected</option> |
| 9 </option> |
| 10 </select> |
| 11 <select> |
| 12 <option>Unselected</option> |
| 13 <option selected>Selected</option> |
| 14 </option> |
| 15 </select> |
| 16 <script> |
| 17 // This is a supplemenetal test for web-platform-tests/html/semantics/forms/the-
option-element/option-selected.html |
| 18 |
| 19 test(function() { |
| 20 var unselected = document.querySelectorAll('select')[0].options[0]; |
| 21 unselected.selected = false; |
| 22 unselected.setAttribute('selected', 'selected'); |
| 23 assert_true(unselected.selected); |
| 24 |
| 25 var selected = document.querySelectorAll('select')[1].options[1]; |
| 26 selected.selected = true; |
| 27 selected.removeAttribute('selected'); |
| 28 assert_false(selected.selected); |
| 29 }, '|selected| setter should not make an option dirty if it doesn\'t change its
selectedness and the option is owned by a select element'); |
| 30 </script> |
| 31 </body> |
| OLD | NEW |