blob: bb6132028dafe81074395b27c03e07df93c68dce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<!DOCTYPE HTML>
<html>
<body>
<p>This tests cloning an input element with an edited value.
The cloned input element should retain the edited value and you should see PASSED blow.</p>
<pre id="log"></pre>
<div><input id="test" title="1" type="text" value="FAIL"></div>
<script type="text/javascript">
if (window.testRunner)
testRunner.dumpAsText();
var test = document.getElementById('test');
test.value = 'PASS';
var x = test.offsetLeft; // Force layout
var clone = test.cloneNode(true);
test.parentNode.appendChild(clone);
test.value = '';
clone.focus();
clone.selectionStart = clone.selectionEnd = clone.value.length;
document.execCommand('InsertText', false, 'ED');
document.getElementById('log').textContent = clone.value;
</script>
</body>
</html>
|