REGRESSION(r164329): Input fields are not honoring the maxlength attribute
[WebKit-https.git] / LayoutTests / fast / forms / input-maxlength-paste-in-middle.html
1 <!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
8 description('This test attempts to paste text in the middle of a text field with maxlength.');
9
10 var input = document.querySelector('input');
11 input.focus();
12 shouldBeEqualToString('input.value', 'abc');
13 shouldBeEqualToString('input.getAttribute("maxlength")', '3');
14 evalAndLog('input.selectionStart = 1');
15 evalAndLog('input.selectionEnd = 2');
16 shouldBeEqualToString('document.execCommand("insertText", false, "123"); input.value', 'a1c');
17
18 var successfullyParsed = true;
19
20 </script>
21 <script src="../../resources/js-test-post.js"></script>
22 </body>
23 </html>