| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 @keyframes test { |
| 6 from { --x: green; } |
| 7 to { --x: lime; } |
| 8 } |
| 9 #parentA, #parentB { |
| 10 --x: red; |
| 11 } |
| 12 #targetA, #targetB { |
| 13 background-color: var(--x); |
| 14 } |
| 15 #parentA { |
| 16 animation: test 10s -2s; |
| 17 } |
| 18 #parentB { |
| 19 animation: test 10s -8s; |
| 20 } |
| 21 </style> |
| 22 <div id="parentA"> |
| 23 <div id="targetA"></div> |
| 24 </div> |
| 25 <div id="parentB"> |
| 26 <div id="targetB"></div> |
| 27 </div> |
| 28 <script> |
| 29 test(() => { |
| 30 assert_equals(getComputedStyle(targetA).getPropertyValue('--x'), ' green'); |
| 31 assert_equals(getComputedStyle(targetB).getPropertyValue('--x'), ' lime'); |
| 32 }, 'CSS Animations on custom properties should get inherited'); |
| 33 |
| 34 test(() => { |
| 35 assert_equals(getComputedStyle(targetA).backgroundColor, 'rgb(0, 128, 0)'); |
| 36 assert_equals(getComputedStyle(targetB).backgroundColor, 'rgb(0, 255, 0)'); |
| 37 }, 'CSS Animations on custom properties that get inherited should be reflected i
n var() references'); |
| 38 </script> |
| OLD | NEW |