blob: b7c8bcd6deb9da62e9574e60aa3b2b280d1ef145 [file] [log] [blame]
<html>
<head>
<script>
function runTest() {
if (window.layoutTestController)
layoutTestController.dumpAsText()
var div = document.createElement("div");
div.innerText = "\nText\nwith\nnewlines\n\n";
alert(div.innerHTML)
if (div.innerHTML != '<br>Text<br>with<br>newlines<br><br>')
return;
div.innerText = "\rText\rwith\rnewlines\r\r";
if (div.innerHTML != '<br>Text<br>with<br>newlines<br><br>')
return;
div.innerText = "\r\nText\r\nwith\r\nnewlines\r\n\r\n";
if (div.innerHTML != '<br>Text<br>with<br>newlines<br><br>')
return;
document.getElementById('result').innerHTML='SUCCESS'
}
</script>
</head>
<body onload="runTest()">
This tests that setInnerText converts newlines to &lt;br&gt; elements correctly. If the test is successful, the text "SUCCESS" should be shown below.
<div id="result">FAILURE</div>
</body>
</html>