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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html

Issue 1604653005: Reset algorithm is incorrect for select element with first option disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html b/third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html
index fbee983229c17bb22c9385e587bff29430e05569..f2d7432c9ec781561af643a5e7de6bb8768c854f 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html
@@ -29,5 +29,16 @@ test(function() {
// option list.
assert_equals(select.selectedIndex, -1);
}, 'Removing a SELECT tree from another tree should not reset selection.');
+
+test(function() {
+ var form = document.createElement('form');
+ document.body.appendChild(form);
+ var select = document.createElement('select');
+ form.appendChild(select);
+ select.innerHTML = '<option disabled>Apple</option><option>Banana</option><option>Cherry</option>';
+ assert_equals(select.selectedIndex, 1);
+ form.reset();
+ assert_equals(select.selectedIndex, 1);
+}, 'Reset should select the first option element in the list of options that is not disabled to true');
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698