REGRESSION(r94274): FormManagerTest.PreviewForm and FillFormNonEmptyField fail on...
[WebKit-https.git] / LayoutTests / fast / forms / suggested-value.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">This test setting a suggested value on an input element.
5 The dump below should have the "suggested value" instead of "initial value".</p>
6 <pre><input id="test" type="text" value="initial value"></pre>
7 <script src="../../resources/dump-as-markup.js"></script>
8 <script>
9
10 var input = document.getElementById('test');
11 var result = document.getElementById('result');
12 if (!window.internals)
13     testFailed('This test requires internals object');
14 else {
15     input.focus();
16     input.selectionStart = input.selectionEnd = 0;
17
18     internals.setSuggestedValue(input, 'suggested value');
19
20     Markup.description(document.getElementById('description').textContent)
21
22     function addTextResult(value) { input.parentNode.appendChild(document.createTextNode(value + ': ' + eval(value))); }
23     addTextResult('input.value');
24     addTextResult('internals.suggestedValue(input)');
25     addTextResult('input.selectionStart');
26     addTextResult('input.selectionEnd');
27
28     Markup.dump(input.parentNode);
29 }
30
31 </script>
32 </body>
33 </html>