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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/forms/select/option-dirtiness.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/option-dirtiness.html b/third_party/WebKit/LayoutTests/fast/forms/select/option-dirtiness.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b8040228c8e51c3c0dc017a82394661ca5d1bf2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/select/option-dirtiness.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<body>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<select>
+<option>Unselected</option>
+<option selected>Selected</option>
+</option>
+</select>
+<select>
+<option>Unselected</option>
+<option selected>Selected</option>
+</option>
+</select>
+<script>
+// This is a supplemenetal test for web-platform-tests/html/semantics/forms/the-option-element/option-selected.html
+
+test(function() {
+ var unselected = document.querySelectorAll('select')[0].options[0];
+ unselected.selected = false;
+ unselected.setAttribute('selected', 'selected');
+ assert_true(unselected.selected);
+
+ var selected = document.querySelectorAll('select')[1].options[1];
+ selected.selected = true;
+ selected.removeAttribute('selected');
+ assert_false(selected.selected);
+}, '|selected| setter should not make an option dirty if it doesn\'t change its selectedness and the option is owned by a select element');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698