Document-createCDATASection-xhtml.xhtml (764B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta charset="utf-8"/> 5 <title>document.createCDATASection</title> 6 <link rel="help" href="https://dom.spec.whatwg.org/#dom-document-createcdatasection"/> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="Document-createComment-createTextNode.js"></script> 10 </head> 11 12 <body> 13 <script> 14 "use strict"; 15 test_create("createCDATASection", CDATASection, 4, "#cdata-section"); 16 17 test(() => { 18 assert_throws_dom("InvalidCharacterError", () => document.createCDATASection(" ]" + "]> ")); 19 }, "Creating a CDATA section containing the string \"]" + "]>\" must throw"); 20 </script> 21 </body> 22 </html>