| <!DOCTYPE html> |
| <html> |
| <body> |
| <div id=container> |
| <input placeholder="first line second line"><br> |
| <input placeholder=" "><br> |
| <textarea placeholder="first line second line"></textarea><br> |
| <textarea placeholder=" "></textarea> |
| </div> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| description('CR and LF in placeholder values should be stripped.'); |
| |
| if (window.internals) { |
| var input0 = document.getElementsByTagName('input')[0]; |
| var input1 = document.getElementsByTagName('input')[1]; |
| var textarea0 = document.getElementsByTagName('textarea')[0]; |
| var textarea1 = document.getElementsByTagName('textarea')[1]; |
| shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line second line'); |
| shouldBeEqualToString('internals.visiblePlaceholder(input1)', ''); |
| shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line second line'); |
| shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', ''); |
| |
| document.body.removeChild(document.getElementById('container')); |
| } else |
| 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 second textarea element should have nothing.'); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |