tor-browser

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

test_bug525952.html (1346B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=525952
      5 -->
      6 <head>
      7  <title>Test for Bug 525952</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525952">Mozilla Bug 525952</a>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15  
     16 </div>
     17 <pre id="test">
     18 <script type="application/javascript">
     19 
     20 /** Test for Bug 525952 */
     21 var bodies = document.querySelectorAll("::before, div::before, body");
     22 is(bodies.length, 1, "Unexpected length");
     23 is(bodies[0], document.body, "Unexpected element");
     24 
     25 is(document.querySelector("div > ::after, body"), document.body,
     26   "Unexpected return value");
     27 
     28 var emptyList = document.querySelectorAll("::before, div::before");
     29 is(emptyList.length, 0, "Unexpected empty list length");
     30 
     31 is(document.querySelectorAll("div > ::after").length, 0,
     32   "Pseudo-element matched something?");
     33 
     34 is(document.body.matches("::first-line"), false,
     35   "body shouldn't match ::first-line");
     36 
     37 is(document.body.matches("::first-line, body"), true,
     38   "body should match 'body'");
     39 
     40 is(document.body.matches("::first-line, body, ::first-letter"), true,
     41   "body should match 'body' here too");
     42 
     43 </script>
     44 </pre>
     45 </body>
     46 </html>