tor-browser

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

revert-val-008.html (1143B)


      1 <!DOCTYPE html>
      2 <title>CSS Cascade: 'revert' in final keyframe of web animation</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-cascade/#default">
      4 <link rel="help" href="https://crbug.com/1065387">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <h1 id=h1></h1>
      8 <h1 id=ref></h1>
      9 <script>
     10  test(function() {
     11    let expected_lower = parseInt(getComputedStyle(ref).marginTop);
     12    let expected_upper = expected_lower * 2;
     13 
     14    h1.animate([
     15      { marginTop: `${expected_lower * 4}px` },
     16      { marginTop: `${expected_lower * 3}px` },
     17      { marginTop: `${expected_lower * 2}px` },
     18      { marginTop: 'revert' },
     19    ], {
     20      duration: 4000,
     21      delay: -3500,
     22    }).pause();
     23 
     24    let actual = parseInt(getComputedStyle(h1).marginTop);
     25 
     26    // This test assumes that the UA style sheet sets a non-0px value on
     27    // <h1> elements:
     28    assert_not_equals(expected_lower, 0);
     29    assert_not_equals(expected_upper, 0);
     30    assert_between_exclusive(actual, expected_lower, expected_upper);
     31  }, 'The revert keyword works in the final frame of a web animation');
     32 </script>