tor-browser

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

test_bug102699.html (2947B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=102699
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 102699</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=102699">Mozilla Bug 102699</a>
     14 <p id="display"></p>
     15 <div id="content" style="display: none">
     16  
     17 </div>
     18 <pre id="test">
     19 <script type="application/javascript">
     20 
     21 /** Test for Bug 102699 */
     22 
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 var p = new DOMParser();
     26 
     27 var d = p.parseFromString(
     28 '<meta charset="windows-1252">' +
     29 "\u003cscript>" +
     30 'document.documentElement.setAttribute("data-fail", "FAIL");' +
     31 "\u003c/script>" +
     32 '\u003cscript src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs">\u003c/script>' +
     33 '\u003cscript src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs" defer>\u003c/script>' +
     34 '\u003cscript src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs" async>\u003c/script>' +
     35 '<link type="stylesheet" href="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs">' +
     36 '<body onload=\'document.documentElement.setAttribute("data-fail", "FAIL");\'>' +
     37 '<img src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs">' +
     38 '<iframe src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs"></iframe>' +
     39 '<video poster="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs" src="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs"></video>' +
     40 '<object data="http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_bug102699.sjs"></object>' +
     41 '<noscript><div></div></noscript>"', "text/html");
     42 
     43 is(d.createElement("div").tagName, "DIV", "The created document should have HTML nature.");
     44 
     45 is(d.getElementsByTagName("div").length, 1, "There should be one div.");
     46 
     47 is(d.contentType, "text/html", "contentType should be text/html");
     48 
     49 is(d.characterSet, "UTF-8", "Expected the <meta> to be ignored.");
     50 
     51 is(d.compatMode, "BackCompat", "Should be in the quirks mode.");
     52 
     53 var scripts = d.getElementsByTagName("script");
     54 is(scripts.length, 4, "Unexpected number of scripts.");
     55 while (scripts.length) {
     56  // These should not run when moved to another doc
     57  document.body.appendChild(scripts[0]);
     58 }
     59 var s = document.createElement("script");
     60 s.src = "file_bug102699.sjs?report=1";
     61 document.body.appendChild(s);
     62 
     63 function continueAfterReport() {
     64  ok(!d.documentElement.hasAttribute("data-fail"), "Should not have a data-fail attribute.");
     65 
     66  d = p.parseFromString("<!DOCTYPE html>", "text/html");
     67  is(d.compatMode, "CSS1Compat", "Should be in the standards mode.");
     68 
     69  SimpleTest.finish();
     70 }
     71 
     72 </script>
     73 </pre>
     74 </body>
     75 </html>