OLD | NEW |
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 second line"><br> | 5 <input placeholder="first line second line"><br> |
6 <input placeholder=" "><br> | 6 <input placeholder=" "><br> |
7 <textarea placeholder="first line second line"></textarea><br> | 7 <textarea placeholder="first line second line"></textarea><br> |
8 <textarea placeholder=" "></textarea> | 8 <textarea placeholder=" "></textarea> |
| 9 <textarea placeholder=" "></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 
; second line", and the second input element should have nothing'); |
| 31 } |
27 </script> | 32 </script> |
28 </body> | 33 </body> |
29 </html> | 34 </html> |
OLD | NEW |