revert-val-009.html (1060B)
1 <!DOCTYPE html> 2 <title>CSS Cascade: 'revert' in implicit keyframes</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 h1.style = `margin-top: ${expected_lower * 1000}px; margin-top: revert;`; 14 15 h1.animate([ 16 { marginTop: `${expected_upper}px` }, 17 ], { 18 duration: 1000, 19 delay: -500, 20 }).pause(); 21 22 let actual = parseInt(getComputedStyle(h1).marginTop); 23 24 // This test assumes that the UA style sheet sets a non-0px value on 25 // <h1> elements: 26 assert_not_equals(expected_lower, 0); 27 assert_not_equals(expected_upper, 0); 28 assert_between_exclusive(actual, expected_lower, expected_upper); 29 }, 'The revert keyword works in implicit keyframes'); 30 </script>