blob: 86a1a458a6f97ea7a8f25dc2ec508fb5ba683804 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<textarea cols=50 rows=10>first
second</textarea>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<p id="console"></p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var textarea = document.querySelector('textarea');
function selectFirstLineIncludingLineBreak() {
textarea.focus();
textarea.setSelectionRange(0, 0);
getSelection().modify('extend', 'forward', 'line');
}
function copyPaste() {
document.execCommand('copy');
document.execCommand('paste');
}
var offsetAfterLineBreak = 6;
shouldBe("selectFirstLineIncludingLineBreak(); copyPaste(); textarea.selectionEnd", "offsetAfterLineBreak");
</script>
</body>
</html>