animate-reset-freeze.html (1073B)
1 <!doctype html> 2 <title>SVG Animations: Rewinding fill='freeze' animations</title> 3 <link rel="help" href="https://svgwg.org/specs/animations/"> 4 <link rel="issue" href="https://bugs.webkit.org/show_bug.cgi?id=89846"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <svg> 8 <rect width="100" height="100" fill="red"/> 9 <rect id="rect" x="0" width="100" height="100" fill="green"> 10 <set attributeName="x" to="100" begin="4s" fill="freeze"/> 11 <set attributeName="x" to="200" begin="1s" dur="1s" fill="freeze"/> 12 </rect> 13 </svg> 14 <script> 15 async_test(t => { 16 let svg = document.querySelector('svg'); 17 let rect = document.getElementById('rect'); 18 svg.pauseAnimations(); 19 svg.setCurrentTime(100); 20 21 window.onload = t.step_func(() => { 22 window.requestAnimationFrame(t.step_func_done(() => { 23 assert_equals(rect.x.animVal.value, 100, "'x' is 100 at t=100"); 24 svg.setCurrentTime(0); 25 assert_equals(rect.x.animVal.value, 0, "'x' is 0 at t=0"); 26 })); 27 }); 28 }); 29 </script>