blob: 65ed8659c12c4c6e9902548a71e50a9311038416 (
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
35
36
37
38
39
40
41
42
43
44
|
<html>
<head>
<script type="text/javascript">
function print(message)
{
var paragraph = document.createElement("li");
paragraph.appendChild(document.createTextNode(message));
document.getElementById("console").appendChild(paragraph);
}
function test()
{
if (window.testRunner) {
testRunner.dumpAsText();
}
var elt = document.getElementById("text");
elt.defaultValue = "\ntesting";
compare(elt.defaultValue, "\ntesting");
elt.defaultValue = "\n\ntesting";
compare(elt.defaultValue, "\n\ntesting");
elt.defaultValue = "\n\n\ntesting";
compare(elt.defaultValue, "\n\n\ntesting");
elt.defaultValue = "";
}
function compare(val, exp)
{
if (val == exp) {
print("Passed");
} else {
print("Failed");
}
}
</script>
</head>
<body onload="test();">
<p>This test attempts to set a leading newline in a text area's default value.</p>
<p>If the test passes, you should see a 3 lines saying "Passed" below.</p>
<hr>
<form>
<textarea id="text"></textarea>
</form>
<hr>
<p><ol id="console"></ol></p>
</body>
</html>
|