clip-path-animation-set-duration-animation-finish.html (1212B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <link rel="help" href="https://drafts.csswg.org/css-shapes-1/#basic-shape-interpolation"> 4 <link rel="match" href="clip-path-animation-set-currenttime-ref.html"> 5 <style> 6 .container { 7 width: 100px; 8 height: 100px; 9 background-color: green; 10 animation: clippath 10s -5s; 11 animation-fill-mode: none; 12 clip-path: inset(33% 33%); 13 } 14 15 @keyframes clippath { 16 0% { 17 clip-path: circle(50% at 50% 50%); 18 } 19 20 100% { 21 clip-path: circle(35% at 35% 35%); 22 } 23 } 24 </style> 25 <script src="/common/reftest-wait.js"></script> 26 <script src="/web-animations/resources/timing-utils.js"></script> 27 28 <body> 29 <div class="container"> 30 </div> 31 32 <script> 33 let animation = document.getAnimations()[0]; 34 animation.ready.then(() => { 35 // With the negative start delay of 5s, this should mean that the animation completes. 36 animation.effect.updateTiming({duration: 5000 - 1}); 37 38 // Since the animation is finished, and animation-fill-mode is none, 39 // we should get the original style set in css .container rather than 40 // any animated style. 41 requestAnimationFrame(takeScreenshot); 42 }); 43 </script> 44 </body> 45 46 </html>