blob: c00e49d2503ed767fa3605c7bd79c9affc7d76a8 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<textarea cols=50 rows=10>first
second</textarea>
<script src="../../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>