3 <script type=
"text/javascript">
4 function print(message
)
6 var paragraph
= document
.createElement("li");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("console").appendChild(paragraph
);
12 if (window
.testRunner
) {
13 testRunner
.dumpAsText();
15 var elt
= document
.getElementById("text");
16 elt
.value
= "This\ris\ra\rtest";
17 compare(elt
.value
, "This\nis\na\ntest");
18 elt
.value
= "And\r\nhere\r\nis\r\ntest\r\ntwo";
19 compare(elt
.value
, "And\nhere\nis\ntest\ntwo");
20 elt
.value
= "And\nlastly,\ntest\nthree";
21 compare(elt
.value
, "And\nlastly,\ntest\nthree");
24 function compare(val
, exp
)
34 <body onload=
"test();">
35 <p>This test attempts to set non-standard line endings in a text area and reads them back. The line endings should all come back as linefeeds.
</p>
36 <p>If the test passes, you should see three lines saying
"Passed" below.
</p>
39 <textarea id=
"text"></textarea>
42 <p><ol id=
"console"></ol></p>