| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| <input type="text" id="sp" style="-khtml-appearance:textfield" maxlength=5 value="123456"></input> |
| description('This test changes the value of the text field by simulating typing, and then gets the value.'); |
| var input = document.getElementById('sp'); |
| if (input.value != "12345") { |
| testPassed('Maxlength shouldn\'t work for default value.'); |
| testFailed('Maxlength unexpectedly works for default value.'); |
| input.setSelectionRange(0, 3); |
| document.execCommand("InsertText", false, 'abcd'); |
| document.execCommand("InsertText", false, 'efghi'); |
| if (input.value == "abcde") { |
| testPassed('Maxlength works for inserted text.'); |
| testFailed('Maxlength does not work for inserted text.'); |
| <script src="../../resources/js-test-post.js"></script> |