tor-browser

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

effect-value-interval-distance.html (1098B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>The effect value of a keyframe effect: Calculating the interval
      4  distance between keyframes</title>
      5 <link rel="help" href="https://drafts.csswg.org/web-animations/#the-effect-value-of-a-keyframe-animation-effect">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="../../testcommon.js"></script>
      9 <body>
     10 <div id="log"></div>
     11 <script>
     12 'use strict';
     13 
     14 test(t => {
     15  // In Firefox there was a floating precision bug in the calculation of the
     16  // progress at the end of the 0.2<->1.0 interval. This test exercises that
     17  // calculation in case other UAs suffer from the same problem.
     18  const target = createDiv(t);
     19  const anim = target.animate(
     20    [
     21      { opacity: 0 },
     22      { offset: 0.2, opacity: 1, easing: 'step-end' },
     23      { opacity: 0 },
     24    ],
     25    {
     26      duration: 1000,
     27      fill: 'forwards',
     28    }
     29  );
     30 
     31  anim.currentTime = 1000;
     32  assert_equals(getComputedStyle(target).opacity, '0');
     33 }, 'Interval distance is calculated correctly (precision test)');
     34 
     35 </script>
     36 </body>