tor-browser

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

seeking-events-4.html (1066B)


      1 <!DOCTYPE html>
      2 <title>Seeking forwards dispatches 'endEvent' if the element is not active at the seeked-to time</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <svg>
      6  <rect width="50" height="100" fill="red">
      7    <set id="anim1" attributeName="fill" to="green" begin="5s" dur="1s" repeatCount="2" fill="freeze"/>
      8  </rect>
      9  <rect width="50" height="100" x="50" fill="green">
     10    <set id="anim2" attributeName="fill" to="red" begin="9s" dur="2s"/>
     11  </rect>
     12 </svg>
     13 <script>
     14  const SMIL_EVENTS = ['beginEvent', 'repeatEvent', 'endEvent'];
     15 
     16  promise_test(function(t) {
     17    let svg = document.querySelector('svg');
     18    svg.pauseAnimations();
     19    svg.setCurrentTime(5.5);
     20    let anim1_watcher = new EventWatcher(t, document.getElementById('anim1'), SMIL_EVENTS);
     21    new EventWatcher(t, document.getElementById('anim2'), SMIL_EVENTS);
     22    return anim1_watcher.wait_for('beginEvent').then(() => {
     23      svg.setCurrentTime(11);
     24      return anim1_watcher.wait_for('endEvent');
     25    });
     26  });
     27 </script>