OLD | NEW |
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><select id="select"><option>CA</option
><option>TX</option></select></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'); | 15 var select = document.getElementById('select'); |
16 select.selectedIndex = -1; | 16 select.selectedIndex = -1; |
17 var result = document.getElementById('result'); | 17 var result = document.getElementById('result'); |
18 if (!window.internals) | 18 if (!window.internals) |
19 testFailed('This test requires internals object'); | 19 testFailed('This test requires internals object'); |
20 else { | 20 else { |
21 input.focus(); | 21 input.focus(); |
22 input.selectionStart = input.selectionEnd = 0; | 22 input.selectionStart = input.selectionEnd = 0; |
23 | 23 |
24 internals.setSuggestedValue(input, 'suggested value'); | 24 internals.setSuggestedValue(input, 'suggested value'); |
(...skipping 14 matching lines...) Expand all Loading... |
39 addTextResult('internals.suggestedValue(textarea)'); | 39 addTextResult('internals.suggestedValue(textarea)'); |
40 addTextResult('select.value'); | 40 addTextResult('select.value'); |
41 addTextResult('internals.suggestedValue(select)'); | 41 addTextResult('internals.suggestedValue(select)'); |
42 | 42 |
43 Markup.dump(input.parentNode); | 43 Markup.dump(input.parentNode); |
44 } | 44 } |
45 | 45 |
46 </script> | 46 </script> |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |