summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-xhtml.xhtml
blob: 33a4635db37ff987f3e63554b9b05a3b31e34fae (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
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTMLScriptElement.text</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-text"/>
<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>