Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-appearance-maxlength.html
blobf061cf6683add848f1927f83d5b780e25334fadc
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
8 <input type="text" id="sp" style="-khtml-appearance:textfield" maxlength=5 value="123456"></input>
10 <script>
11 description('This test changes the value of the text field by simulating typing, and then gets the value.');
13 var input = document.getElementById('sp');
15 if (input.value != "12345") {
16 testPassed('Maxlength shouldn\'t work for default value.');
17 } else {
18 testFailed('Maxlength unexpectedly works for default value.');
21 input.value = "123";
22 input.setSelectionRange(0, 3);
23 input.focus();
24 document.execCommand("InsertText", false, 'abcd');
25 document.execCommand("InsertText", false, 'efghi');
27 if (input.value == "abcde") {
28 testPassed('Maxlength works for inserted text.');
29 } else {
30 testFailed('Maxlength does not work for inserted text.');
32 </script>
33 </body>
34 </html>