summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/animations/pruning-first-interval.html
blob: 5a1d1463beaec5b8c3e86406de6138960de8e5ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<title>Timed element not active after first interval active duration changes to unresolved</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg>
  <rect width="100" height="100" fill="green">
    <set attributeName="fill" to="red" fill="freeze"
         begin="click" end="click" dur="100ms" repeatCount="indefinite"/>
  </rect>
</svg>
<script>
  async_test(function(t) {
    let set = document.querySelector('set');
    window.onload = t.step_func(function() {
      t.step_timeout(function() {
        set.setAttribute('begin', '-100ms');
        set.setAttribute('begin', 'click');
        set.parentNode.appendChild(set);
        set.setAttribute('end', '-100ms');
        set.setAttribute('end', 'click');
        window.requestAnimationFrame(t.step_func_done(function() {
          let target = set.targetElement;
          assert_equals(getComputedStyle(target).fill, 'rgb(0, 128, 0)');
        }));
      }, 0);
    });
  });
</script>