blob: 37bdc98753db04ad515a34e170289b79ae6b1d0f [file] [log] [blame]
rniwa@webkit.org4861e102014-12-10 22:10:23 +00001<!DOCTYPE html>
2<html>
3<body>
4<script src="../../resources/js-test-pre.js"></script>
5<input type="text" maxlength="3" value="abc">
6<script>
7
8description('This test attempts to paste text in the middle of a text field with maxlength.');
9
10var input = document.querySelector('input');
11input.focus();
12shouldBeEqualToString('input.value', 'abc');
13shouldBeEqualToString('input.getAttribute("maxlength")', '3');
14evalAndLog('input.selectionStart = 1');
15evalAndLog('input.selectionEnd = 2');
16shouldBeEqualToString('document.execCommand("insertText", false, "123"); input.value', 'a1c');
17
18var successfullyParsed = true;
19
20</script>
21<script src="../../resources/js-test-post.js"></script>
22</body>
23</html>