Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-maxlength.html

Issue 2380473002: Change the linebreak behavior of minlength and maxlength attributes of TEXTAREA. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-maxlength-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-maxlength-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698