| 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('Tests for HTMLTextAreaElement.maxLength behaviors.'); | 10 description('Tests for HTMLTextAreaElement.maxLength behaviors.'); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 textArea.innerHTML = 'a\n\n'; | 115 textArea.innerHTML = 'a\n\n'; |
| 116 document.execCommand('insertLineBreak'); | 116 document.execCommand('insertLineBreak'); |
| 117 shouldBe('textArea.value', '"a\\n\\n"'); | 117 shouldBe('textArea.value', '"a\\n\\n"'); |
| 118 | 118 |
| 119 // Confirms correct count for open consecutive linebreaks inputs. | 119 // Confirms correct count for open consecutive linebreaks inputs. |
| 120 createFocusedTextAreaWithMaxLength(6); | 120 createFocusedTextAreaWithMaxLength(6); |
| 121 document.execCommand('insertLineBreak'); | 121 document.execCommand('insertLineBreak'); |
| 122 document.execCommand('insertLineBreak'); | 122 document.execCommand('insertLineBreak'); |
| 123 document.execCommand('insertLineBreak'); | 123 document.execCommand('insertLineBreak'); |
| 124 document.execCommand('insertLineBreak'); | 124 document.execCommand('insertLineBreak'); |
| 125 shouldBe('textArea.value', '"\\n\\n\\n"'); | 125 document.execCommand('insertLineBreak'); |
| 126 document.execCommand('insertLineBreak'); |
| 127 document.execCommand('insertLineBreak'); |
| 128 shouldBeEqualToString('textArea.value', '\n\n\n\n\n\n'); |
| 126 | 129 |
| 127 // According to the HTML5 specification, maxLength is code-point length. | 130 // According to the HTML5 specification, maxLength is code-point length. |
| 128 // Blink follows it though WebKit handles it as grapheme length. | 131 // Blink follows it though WebKit handles it as grapheme length. |
| 129 | 132 |
| 130 // fancyX should be treated as 1 grapheme. | 133 // fancyX should be treated as 1 grapheme. |
| 131 var fancyX = "x\u0305\u0332";// + String.fromCharCode(0x305) + String.fromCharCo
de(0x332); | 134 var fancyX = "x\u0305\u0332";// + String.fromCharCode(0x305) + String.fromCharCo
de(0x332); |
| 132 // u10000 is one character consisted of a surrogate pair. | 135 // u10000 is one character consisted of a surrogate pair. |
| 133 var u10000 = "\ud800\udc00"; | 136 var u10000 = "\ud800\udc00"; |
| 134 | 137 |
| 135 debug('Inserts 2 normal characters + a combining letter with 3 code points into
a maxlength=3 element.') | 138 debug('Inserts 2 normal characters + a combining letter with 3 code points into
a maxlength=3 element.') |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 shouldBe('textArea.value', '"ABC"'); | 172 shouldBe('textArea.value', '"ABC"'); |
| 170 | 173 |
| 171 // In the case maxlength='invalid' | 174 // In the case maxlength='invalid' |
| 172 createFocusedTextAreaWithMaxLength('invalid'); | 175 createFocusedTextAreaWithMaxLength('invalid'); |
| 173 textArea.value = ''; | 176 textArea.value = ''; |
| 174 document.execCommand('insertText', false, 'ABC'); | 177 document.execCommand('insertText', false, 'ABC'); |
| 175 shouldBe('textArea.value', '"ABC"'); | 178 shouldBe('textArea.value', '"ABC"'); |
| 176 </script> | 179 </script> |
| 177 </body> | 180 </body> |
| 178 </html> | 181 </html> |
| OLD | NEW |