blob: 21b23d0e257399379726574b76e25ac431f5ef3c [file] [log] [blame] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('This test checks users can input pre-edit text longer than maxlength.');
var input = document.createElement('input');
document.body.appendChild(input);
input.maxLength = 2;
input.focus();
textInputController.setMarkedText('abcd', 0, 4);
// The selection should have 4 characters though maxLength is 2.
shouldBe('input.selectionStart', '0');
shouldBe('input.selectionEnd', '4');
shouldBeEqualToString('input.value.substring(input.selectionStart, input.selectionEnd)', 'abcd');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>