blob: 7667baf217632c639daea6effb0a056fe183c87c [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<div id=container>
<input placeholder="first line &#13;&#10;second line"><br>
<input placeholder="&#13;"><br>
<textarea placeholder="first line &#10;second line"></textarea><br>
<textarea placeholder="&#10;"></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>