Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / clone-input-with-dirty-value.html
blobbb6132028dafe81074395b27c03e07df93c68dce
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <p>This tests cloning an input element with an edited value.
5 The cloned input element should retain the edited value and you should see PASSED blow.</p>
6 <pre id="log"></pre>
7 <div><input id="test" title="1" type="text" value="FAIL"></div>
8 <script type="text/javascript">
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var test = document.getElementById('test');
14 test.value = 'PASS';
16 var x = test.offsetLeft; // Force layout
18 var clone = test.cloneNode(true);
19 test.parentNode.appendChild(clone);
20 test.value = '';
22 clone.focus();
23 clone.selectionStart = clone.selectionEnd = clone.value.length;
24 document.execCommand('InsertText', false, 'ED');
26 document.getElementById('log').textContent = clone.value;
28 </script>
29 </body>
30 </html>