OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <p id="description">This test setting a value clears suggested value.</p> | 4 <p id="description">This test setting a value clears suggested value.</p> |
5 <pre><input id="test" type="text" value="initial value"><br> | 5 <pre><input id="test" type="text" value="initial value"><br> |
6 <textarea id="textarea"></textarea><br> | 6 <textarea id="textarea"></textarea><br> |
7 <select id="select"><option>CA</option><option>TX</option></select></pre> | 7 <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 textarea = document.getElementById('textarea'); | 12 var textarea = document.getElementById('textarea'); |
13 textarea.value = "initial value"; | 13 textarea.value = 'initial value'; |
14 var select = document.getElementById('select'); | 14 var select = document.getElementById('select'); |
15 select.selectedIndex = -1; | 15 select.selectedIndex = -1; |
16 var result = document.getElementById('result'); | 16 var result = document.getElementById('result'); |
17 if (!window.internals) | 17 if (!window.internals) |
18 testFailed('This test requires internals object'); | 18 testFailed('This test requires internals object'); |
19 else { | 19 else { |
20 input.focus(); | 20 input.focus(); |
21 input.selectionStart = input.selectionEnd = 0; | 21 input.selectionStart = input.selectionEnd = 0; |
22 | 22 |
23 internals.setSuggestedValue(input, 'suggested value'); | 23 internals.setSuggestedValue(input, 'suggested value'); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 var selectedValues = getSelectedValues(select); | 67 var selectedValues = getSelectedValues(select); |
68 addText(innerTextValue == 'new value' && | 68 addText(innerTextValue == 'new value' && |
69 innerTextAreaValue == 'new value' && | 69 innerTextAreaValue == 'new value' && |
70 selectedValues == 'CA' ? 'PASS' : 'FAIL'); | 70 selectedValues == 'CA' ? 'PASS' : 'FAIL'); |
71 Markup.dump(input.parentNode, 'After setting value'); | 71 Markup.dump(input.parentNode, 'After setting value'); |
72 } | 72 } |
73 | 73 |
74 </script> | 74 </script> |
75 </body> | 75 </body> |
76 </html> | 76 </html> |
OLD | NEW |