tor-browser

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

responsexml-non-well-formed.htm (1258B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>XMLHttpRequest: responseXML non well-formed tests</title>
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7    <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute" data-tested-assertations="following::ol[1]/li[4]" />
      8    <link rel="help" href="https://xhr.spec.whatwg.org/#document-response-entity-body" data-tested-assertations="following::ol[1]/li[6] following::ol[1]/li[10]" />
      9  </head>
     10  <body>
     11    <div id="log"></div>
     12    <script>
     13      function request(content) {
     14        test(function() {
     15          var client = new XMLHttpRequest()
     16          client.open("GET", "resources/status.py?type=text/xml&content=" + encodeURIComponent(content), false)
     17          client.send(null)
     18          assert_equals(client.responseXML, null)
     19        })
     20      }
     21      request("<x")
     22      request("<x></x")
     23      request("<x>&amp</x>")
     24      request("<x><y></x></y>") // misnested tags
     25      request("<x></x><y></y>") // two root elements is not allowed
     26      request("<x> <![CDATA[ foobar ]></x>") // CDATA should end with ]]>
     27      request("<x> <!CDATA[ foobar ]]></x>") // CDATA should start with <![
     28    </script>
     29  </body>
     30 </html>