tor-browser

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

test_unbound_before_in_active_chain.html (994B)


      1 <!doctype html>
      2 <title>Test for bug 1489139: Unbound generated content in the active chain</title>
      3 <script src="/tests/SimpleTest/EventUtils.js"></script>
      4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5 <style>
      6 #target, #target::before {
      7  width: 200px;
      8  height: 200px;
      9 }
     10 
     11 #target::before {
     12  content: " ";
     13  display: block;
     14  background: green;
     15 }
     16 
     17 #target:active::before {
     18  content: "";
     19  background: red;
     20 }
     21 </style>
     22 Should see a green square after clicking.
     23 <div id="target"></div>
     24 <script>
     25 SimpleTest.waitForExplicitFinish();
     26 onload = function() {
     27  let target = document.getElementById("target");
     28  requestAnimationFrame(() => {
     29    synthesizeMouseAtPoint(100, 100, { type: "mousedown" })
     30    ok(target.matches(":active"), "Should have been clicked");
     31    requestAnimationFrame(() => {
     32      synthesizeMouseAtPoint(100, 100, { type: "mouseup" })
     33      ok(!target.matches(':active'), "Should stop matching :active afterwards");
     34      SimpleTest.finish();
     35    });
     36  });
     37 }
     38 </script>