Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/select/option-dirtiness.html

Issue 1541753002: HTMLOptionElement.prototype.selected setter should not make an option dirty if it doesn't change it… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698