blob: 37bdc98753db04ad515a34e170289b79ae6b1d0f [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<input type="text" maxlength="3" value="abc">
<script>
description('This test attempts to paste text in the middle of a text field with maxlength.');
var input = document.querySelector('input');
input.focus();
shouldBeEqualToString('input.value', 'abc');
shouldBeEqualToString('input.getAttribute("maxlength")', '3');
evalAndLog('input.selectionStart = 1');
evalAndLog('input.selectionEnd = 2');
shouldBeEqualToString('document.execCommand("insertText", false, "123"); input.value', 'a1c');
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>