blob: bc45b25dfd8ea0a98f0c49de6cd524a9549d7f7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<!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>
<textarea placeholder=" "></textarea>
</div>
<script src="../../resources/js-test.js"></script>
<script>
description('CR and LF in placeholder values should be stripped for input type. For textarea should not 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];
var textarea2 = document.getElementsByTagName('textarea')[2];
shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line second line');
shouldBeEqualToString('internals.visiblePlaceholder(input1)', '');
shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line \r\nsecond line');
shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', '');
shouldBeEqualToString('internals.visiblePlaceholder(textarea2)', '');
document.body.removeChild(document.getElementById('container'));
} else {
debug('The first input element should have a placeholder "first line second line", and the second input element should have nothing.');
debug('The first textarea element should have a placeholder "first line second line", and the second input element should have nothing');
}
</script>
</body>
</html>
|