| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 @keyframes custom-property-animation { |
| 6 from { --from: blue; --to: cyan; } |
| 7 to { --from: green; --to: lime; } |
| 8 } |
| 9 @keyframes standard-property-animation { |
| 10 from { background-color: var(--from); } |
| 11 to { background-color: var(--to); } |
| 12 } |
| 13 div { |
| 14 --from: red; |
| 15 --to: red; |
| 16 animation-name: standard-property-animation, custom-property-animation; |
| 17 animation-duration: 10s; |
| 18 animation-timing-function: linear; |
| 19 } |
| 20 #targetA { |
| 21 animation-delay: -2.5s; |
| 22 } |
| 23 #targetB { |
| 24 animation-delay: -7.5s; |
| 25 } |
| 26 </style> |
| 27 <div id="targetA"></div> |
| 28 <div id="targetB"></div> |
| 29 <script> |
| 30 test(() => { |
| 31 assert_equals(getComputedStyle(targetA).getPropertyValue('--from'), ' blue'); |
| 32 assert_equals(getComputedStyle(targetA).getPropertyValue('--to'), ' cyan'); |
| 33 assert_equals(getComputedStyle(targetB).getPropertyValue('--from'), ' green'); |
| 34 assert_equals(getComputedStyle(targetB).getPropertyValue('--to'), ' lime'); |
| 35 }, 'CSS Animations on custom properties should be applied'); |
| 36 |
| 37 test(() => { |
| 38 assert_equals(getComputedStyle(targetA).backgroundColor, 'rgb(0, 64, 255)'); |
| 39 assert_equals(getComputedStyle(targetB).backgroundColor, 'rgb(0, 223, 0)'); |
| 40 }, 'CSS Animations on custom properties should be reflected in var() references
in animation keyframes'); |
| 41 </script> |
| OLD | NEW |