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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/suggested-value.html

Issue 2121083005: SELECT: Store the suggested value by an HTMLOptionElement pointer instead of an index number. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/suggested-value.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/suggested-value.html b/third_party/WebKit/LayoutTests/fast/forms/suggested-value.html
index e95babcac6f9ee9822eece4cfa4856aab574811c..c02b37af0fd5fce1c8013198a361365e8397784a 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/suggested-value.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/suggested-value.html
@@ -4,7 +4,7 @@
<p id="description">This test setting suggested values on an input element
and a textarea element. The dump below should have the "suggested value"
instead of "initial value".</p>
-<pre><input id="test" type="text" value="initial value"><input id="month" type="month"><textarea id="textarea"></textarea><select id="select"><option>CA</option><option>TX</option></select></pre>
+<pre><input id="test" type="text" value="initial value"><input id="month" type="month"><textarea id="textarea"></textarea><select id="select"><option>initial value</option><option>suggested value</option></select></pre>
<script src="../../resources/dump-as-markup.js"></script>
<script>
@@ -13,7 +13,7 @@ var month = document.getElementById('month');
var textarea = document.getElementById('textarea');
textarea.value = 'initial value';
var select = document.getElementById('select');
-select.selectedIndex = -1;
+select.selectedIndex = 0;
var result = document.getElementById('result');
if (!window.internals)
testFailed('This test requires internals object');
@@ -24,7 +24,9 @@ else {
internals.setSuggestedValue(input, 'suggested value');
internals.setSuggestedValue(month, '2014-01');
internals.setSuggestedValue(textarea, 'suggested value');
- internals.setSuggestedValue(select, 'TX');
+ internals.setSuggestedValue(select, 'suggested value');
+ // Insert another OPTION before the suggested value.
+ select.insertBefore(new Option('inserted value'), select.lastChild);
Markup.description(document.getElementById('description').textContent)
@@ -40,6 +42,9 @@ else {
addTextResult('select.value');
addTextResult('internals.suggestedValue(select)');
+ select.removeChild(select.lastChild);
+ addTextResult('internals.suggestedValue(select)');
+
Markup.dump(input.parentNode);
}

Powered by Google App Engine
This is Rietveld 408576698