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

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

Issue 1837463002: Improve conformance of default OPTION selection of SELECT element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming to resetToDefaultSelection Created 4 years, 9 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
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 f2d7432c9ec781561af643a5e7de6bb8768c854f..3f2b430480efe4e494a8e9bf21698852c5281168 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
@@ -40,5 +40,14 @@ test(function() {
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');
+
+test(function() {
+ var select = document.createElement('select');
+ select.innerHTML = '<option>foo</option><option>bar</option>';
+ document.body.appendChild(select);
+ select.selectedIndex = -1;
+ select.removeChild(select.lastChild);
+ assert_equals(select.selectedIndex, 0);
+}, 'Removing an OPTION from a SELECT element should reset selection.');
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698