blob: cfdaded135b8ef80daa95ad68b87ad8ff9b3e4a4 [file] [log] [blame]
<!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('There was a bug that users could input text longer than maxlength via IME. This test confirms it was fixed.');
var input = document.createElement('input');
input.maxLength = 2;
document.body.appendChild(input);
input.focus();
textInputController.setMarkedText('abcd', 0, 4);
textInputController.insertText('abcd'); // Debug WebKit crashed by this without the change of bug#25253.
// Check the current value without input.value.
// In Release WebKit, input.value was 'ab' though the user-visible value was 'abcd'.
document.execCommand('SelectAll');
shouldBe('document.getSelection().toString()', '"ab"');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>