| OLD | NEW |
| (Empty) |
| 1 <script src="../resources/testharness.js"></script> | |
| 2 <script src="../resources/testharnessreport.js"></script> | |
| 3 | |
| 4 <div id="cssTarget"></div> | |
| 5 <svg> | |
| 6 <rect id="svgTarget" color="red"></rect> | |
| 7 </svg> | |
| 8 | |
| 9 <script> | |
| 10 internals.disableCSSAdditiveAnimations(); | |
| 11 | |
| 12 test(() => { | |
| 13 assert_throws('NotSupportedError', () => { | |
| 14 cssTarget.animate({color: 'red'}); | |
| 15 }); | |
| 16 assert_throws('NotSupportedError', () => { | |
| 17 cssTarget.animate([ | |
| 18 {color: 'red'}, | |
| 19 {color: 'red', composite: 'add'}, | |
| 20 ]); | |
| 21 }); | |
| 22 }, 'Precheck that disabling CSS additive animations works.'); | |
| 23 | |
| 24 test(() => { | |
| 25 var animation = svgTarget.animate({'svg-color': 'green'}, 1); | |
| 26 animation.pause(); | |
| 27 animation.currentTime = 0.5; | |
| 28 assert_equals(getComputedStyle(svgTarget).color, 'rgb(128, 64, 0)'); | |
| 29 animation.cancel(); | |
| 30 }, 'Neutral keyframes supported for SVG presentation attributes.'); | |
| 31 | |
| 32 test(() => { | |
| 33 var keyframe = {'svg-color': 'green', composite: 'add'}; | |
| 34 var animation = svgTarget.animate([keyframe, keyframe], {fill: 'forwards'}); | |
| 35 assert_equals(getComputedStyle(svgTarget).color, 'rgb(255, 128, 0)'); | |
| 36 animation.cancel(); | |
| 37 }, 'Additive keyframes supported for SVG presentation attributes.'); | |
| 38 </script> | |
| OLD | NEW |