Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/syntax/serializing-html-fragments/serializing-cdata-in-html-document.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Serializing CDATA in an HTML document</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
const doc = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><![CDATA[<img>]]></svg>', 'application/xml');
const el = document.adoptNode(doc.documentElement);
});
</script>