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

Side by Side Diff: LayoutTests/fast/forms/suggested-value.html

Issue 138433002: Add Autofill preview support for <select> input fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initialize m_suggestedIndex in constructor Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/suggested-value-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <p id="description">This test setting suggested values on an input element 4 <p id="description">This test setting suggested values on an input element
5 and a textarea element. The dump below should have the "suggested value" 5 and a textarea element. The dump below should have the "suggested value"
6 instead of "initial value".</p> 6 instead of "initial value".</p>
7 <pre><input id="test" type="text" value="initial value"><input id="month" type=" month"><textarea id="textarea"></textarea></pre> 7 <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>
8 <script src="../../resources/dump-as-markup.js"></script> 8 <script src="../../resources/dump-as-markup.js"></script>
9 <script> 9 <script>
10 10
11 var input = document.getElementById('test'); 11 var input = document.getElementById('test');
12 var month = document.getElementById('month'); 12 var month = document.getElementById('month');
13 var textarea = document.getElementById('textarea'); 13 var textarea = document.getElementById('textarea');
14 textarea.value = "initial value"; 14 textarea.value = "initial value";
15 var select = document.getElementById('select');
16 select.selectedIndex = -1;
15 var result = document.getElementById('result'); 17 var result = document.getElementById('result');
16 if (!window.internals) 18 if (!window.internals)
17 testFailed('This test requires internals object'); 19 testFailed('This test requires internals object');
18 else { 20 else {
19 input.focus(); 21 input.focus();
20 input.selectionStart = input.selectionEnd = 0; 22 input.selectionStart = input.selectionEnd = 0;
21 23
22 internals.setSuggestedValue(input, 'suggested value'); 24 internals.setSuggestedValue(input, 'suggested value');
23 internals.setSuggestedValue(month, '2014-01'); 25 internals.setSuggestedValue(month, '2014-01');
24 internals.setSuggestedValue(textarea, 'suggested value'); 26 internals.setSuggestedValue(textarea, 'suggested value');
27 internals.setSuggestedValue(select, 'TX');
25 28
26 Markup.description(document.getElementById('description').textContent) 29 Markup.description(document.getElementById('description').textContent)
27 30
28 function addTextResult(value) { input.parentNode.appendChild(document.create TextNode(value + ': ' + eval(value))); } 31 function addTextResult(value) { input.parentNode.appendChild(document.create TextNode(value + ': ' + eval(value))); }
29 addTextResult('input.value'); 32 addTextResult('input.value');
30 addTextResult('internals.suggestedValue(input)'); 33 addTextResult('internals.suggestedValue(input)');
31 addTextResult('input.selectionStart'); 34 addTextResult('input.selectionStart');
32 addTextResult('input.selectionEnd'); 35 addTextResult('input.selectionEnd');
33 addTextResult('month.value'); 36 addTextResult('month.value');
34 addTextResult('internals.suggestedValue(month)'); 37 addTextResult('internals.suggestedValue(month)');
35 addTextResult('textarea.value'); 38 addTextResult('textarea.value');
36 addTextResult('internals.suggestedValue(textarea)'); 39 addTextResult('internals.suggestedValue(textarea)');
37 40 addTextResult('select.value');
41 addTextResult('internals.suggestedValue(select)');
42
38 Markup.dump(input.parentNode); 43 Markup.dump(input.parentNode);
39 } 44 }
40 45
41 </script> 46 </script>
42 </body> 47 </body>
43 </html> 48 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/suggested-value-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698