tor-browser

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

beginevents-1.html (831B)


      1 <!DOCTYPE html>
      2 <title>beginEvent dispatching</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <svg>
      6  <rect width="100" height="100" fill="red">
      7    <animate begin="click" dur="10ms" fill="freeze"
      8             attributeName="fill" from="red" to="blue"/>
      9  </rect>
     10 </svg>
     11 <script>
     12  async_test(t => {
     13    window.onload = t.step_func(() => {
     14      let rect = document.querySelector("svg > rect");
     15      let animate = rect.firstElementChild;
     16      let beginEventCount = 0;
     17      animate.addEventListener('beginEvent', t.step_func(() => {
     18        beginEventCount++;
     19      }));
     20      animate.addEventListener('endEvent', t.step_func_done(() => {
     21        assert_equals(beginEventCount, 1);
     22      }));
     23      rect.dispatchEvent(new Event("click"));
     24    });
     25  });
     26 </script>