OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description("Test for validationMessage DOM property."); | 10 description("Test for validationMessage DOM property."); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 numberInput.max = "10.02"; | 97 numberInput.max = "10.02"; |
98 numberInput.value = "10.01"; | 98 numberInput.value = "10.01"; |
99 debug("input stepMismatch: " + numberInput.validationMessage); | 99 debug("input stepMismatch: " + numberInput.validationMessage); |
100 | 100 |
101 debug("tooLong:"); | 101 debug("tooLong:"); |
102 var inputWithMax = document.createElement("input"); | 102 var inputWithMax = document.createElement("input"); |
103 inputWithMax.maxLength = 3; | 103 inputWithMax.maxLength = 3; |
104 inputWithMax.value = "abcdef"; | 104 inputWithMax.value = "abcdef"; |
105 document.body.appendChild(inputWithMax); | 105 document.body.appendChild(inputWithMax); |
106 inputWithMax.focus(); | 106 inputWithMax.focus(); |
| 107 inputWithMax.setSelectionRange(6, 6); |
107 document.execCommand("delete"); | 108 document.execCommand("delete"); |
108 debug("input tooLong: " + inputWithMax.validationMessage); | 109 debug("input tooLong: " + inputWithMax.validationMessage); |
109 // fancyX should be treated as 3 characters. | 110 // fancyX should be treated as 3 characters. |
110 // U+0305 COMBINING OVERLINE | 111 // U+0305 COMBINING OVERLINE |
111 // U+0332 COMBINING LOW LINE | 112 // U+0332 COMBINING LOW LINE |
112 var fancyX = "x\u0305\u0332"; | 113 var fancyX = "x\u0305\u0332"; |
113 inputWithMax.maxLength = 2; | 114 inputWithMax.maxLength = 2; |
114 inputWithMax.value = fancyX + "X"; | 115 inputWithMax.value = fancyX + "X"; |
115 inputWithMax.focus(); | 116 inputWithMax.focus(); |
116 inputWithMax.setSelectionRange(4, 4); | 117 inputWithMax.setSelectionRange(4, 4); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Keygen controls can't be validated | 167 // Keygen controls can't be validated |
167 var happyKeygen = document.createElement("keygen"); | 168 var happyKeygen = document.createElement("keygen"); |
168 happySelect.name = "keygen"; | 169 happySelect.name = "keygen"; |
169 form.appendChild(happyKeygen); | 170 form.appendChild(happyKeygen); |
170 shouldBe("happyKeygen.validationMessage", "''"); | 171 shouldBe("happyKeygen.validationMessage", "''"); |
171 | 172 |
172 form.remove(); | 173 form.remove(); |
173 </script> | 174 </script> |
174 </body> | 175 </body> |
175 </html> | 176 </html> |
OLD | NEW |