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

Side by Side Diff: LayoutTests/fast/forms/placeholder-stripped.html

Issue 253853002: PlaceHolder in TextArea should allow carriage return and line feed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added rendering test and also added test for carriage return Created 6 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <div id=container> 4 <div id=container>
5 <input placeholder="first line &#13;&#10;second line"><br> 5 <input placeholder="first line &#13;&#10;second line"><br>
6 <input placeholder="&#13;"><br> 6 <input placeholder="&#13;"><br>
7 <textarea placeholder="first line &#10;second line"></textarea><br> 7 <textarea placeholder="first line &#13;&#10;second line"></textarea><br>
8 <textarea placeholder="&#10;"></textarea> 8 <textarea placeholder="&#10;"></textarea>
9 <textarea placeholder="&#13;"></textarea>
9 </div> 10 </div>
10 <script src="../../resources/js-test.js"></script> 11 <script src="../../resources/js-test.js"></script>
11 <script> 12 <script>
12 description('CR and LF in placeholder values should be stripped.'); 13 description('CR and LF in placeholder values should be stripped for input type. For textarea should not be stripped.');
13 14
14 if (window.internals) { 15 if (window.internals) {
15 var input0 = document.getElementsByTagName('input')[0]; 16 var input0 = document.getElementsByTagName('input')[0];
16 var input1 = document.getElementsByTagName('input')[1]; 17 var input1 = document.getElementsByTagName('input')[1];
17 var textarea0 = document.getElementsByTagName('textarea')[0]; 18 var textarea0 = document.getElementsByTagName('textarea')[0];
18 var textarea1 = document.getElementsByTagName('textarea')[1]; 19 var textarea1 = document.getElementsByTagName('textarea')[1];
20 var textarea2 = document.getElementsByTagName('textarea')[2];
19 shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line se cond line'); 21 shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line se cond line');
20 shouldBeEqualToString('internals.visiblePlaceholder(input1)', ''); 22 shouldBeEqualToString('internals.visiblePlaceholder(input1)', '');
21 shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line second line'); 23 shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line \r\nsecond line');
22 shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', ''); 24 shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', '');
25 shouldBeEqualToString('internals.visiblePlaceholder(textarea2)', '');
23 26
24 document.body.removeChild(document.getElementById('container')); 27 document.body.removeChild(document.getElementById('container'));
25 } else 28 } else {
26 debug('The first input element and the first textarea element should have a placeholder "first line second line", and the second input element and the secon d textarea element should have nothing.'); 29 debug('The first input element should have a placeholder "first line second line", and the second input element should have nothing.');
30 debug('The first textarea element should have a placeholder "first line &#13 ;&#10;second line", and the second input element should have nothing');
31 }
27 </script> 32 </script>
28 </body> 33 </body>
29 </html> 34 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/placeholder-appearance-textarea.html ('k') | LayoutTests/fast/forms/placeholder-stripped-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698