Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<?xml version="1.0" encoding="utf-8"?>
<head>
<title>HTMLScriptElement.text</title>
<script src="/resources/testharness.js"/>
<script src="/resources/testharnessreport.js"/>
</head>
<body>
<div id="log"></div>
<script>
<x>7;</x>
<![CDATA[
var x = "y";
]]>
</script>
<script>
var script;
setup(function() {
script = document.body.getElementsByTagName("script")[0];
})
test(function() {
assert_equals(script.text, '\n\n\n var x = "y";\n\n')
assert_equals(script.textContent, '\n7;\n\n var x = "y";\n\n')
}, "Getter with CDATA section")
</script>
</body>
</html>