tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

serializing-cdata-in-html-document.html (593B)


      1 <!DOCTYPE html>
      2 <title>Serializing CDATA in an HTML document</title>
      3 <link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script>
      7 test(t => {
      8  const doc = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><![CDATA[<img>]]></svg>', 'application/xml');
      9  const el = document.adoptNode(doc.documentElement);
     10  assert_equals(el.outerHTML, '<svg xmlns="http://www.w3.org/2000/svg">&lt;img&gt;</svg>');
     11 });
     12 </script>