tor-browser

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

clip-path-animation-retarget.html (1424B)


      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-retarget-ref.html">
      5 <meta name=fuzzy content="maxDifference=0-10;totalPixels=0-30">
      6 <style>
      7 .container {
      8  width: 100px;
      9  height: 100px;
     10  clip-path: inset(20% 20%);
     11 }
     12 
     13 #animinitial {
     14  background-color: green;
     15 }
     16 
     17 #animfinal {
     18  background-color: green;
     19 }
     20 
     21 @keyframes clippath {
     22  0%   { clip-path: circle(50% at 50% 50%); }
     23  100% { clip-path: circle(20% at 20% 20%); }
     24 }
     25 </style>
     26 <script src="/common/reftest-wait.js"></script>
     27 <script src="../../../../web-animations/resources/timing-utils.js"></script>
     28 <body>
     29 <div id="animinitial" class="container"></div>
     30 <div id="animfinal" class="container"></div>
     31 
     32 <script>
     33  let target1 = document.getElementById("animinitial");
     34  let target2 = document.getElementById("animfinal");
     35 
     36  const animation = target1.animate(
     37    [
     38      { clipPath: 'circle(30% at 30% 30%)' },
     39      { clipPath: 'circle(50% at 50% 50%)' }
     40    ],
     41    {
     42      duration: 10000,
     43      easing: 'steps(2, jump-end)',
     44    }
     45  );
     46 
     47  animation.ready.then(() => {
     48    animation.effect.target = target2;
     49 
     50    // Test passes if the 'animfinal' element shows the initial keyframe,
     51    // and the 'animinitial' shows the initial CSS style defined in '.container'
     52    requestAnimationFrame(takeScreenshot);
     53  });
     54 </script>
     55 </body>
     56 </html>