haikuwebkit/LayoutTests/fast/dom/stripNullFromTextNodes.html

22 lines
579 B
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="num">hello</div>
<pre id="preTag">The null characters should be stripped out of the string above and it should have a length of 5. And the DOM thinks the length is...</pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var div = document.getElementById("num");
var text = div.firstChild;
var string = text.length;
if (text.length == 5)
string += "!";
else
string += " :-(";
var pre = document.getElementById("preTag");
pre.appendChild(document.createTextNode(string));
</script>