| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <style> | |
| 5 @keyframes noSyntheticKeyframes { | |
| 6 from { color: black; } | |
| 7 to { color: green; } | |
| 8 } | |
| 9 @keyframes customPropertySyntheticKeyframes { | |
| 10 to { --x: pants; } | |
| 11 } | |
| 12 @keyframes nonCompositedSyntheticKeyframes { | |
| 13 to { color: green; } | |
| 14 } | |
| 15 @keyframes compositedSyntheticKeyframes { | |
| 16 from { | |
| 17 opacity: 0; | |
| 18 } | |
| 19 to { | |
| 20 transform: rotate(45deg); | |
| 21 opacity: 1; | |
| 22 } | |
| 23 } | |
| 24 #target { | |
| 25 animation-duration: 1s; | |
| 26 } | |
| 27 </style> | |
| 28 <div id="target"></div> | |
| 29 <script> | |
| 30 // From UseCounter.h. | |
| 31 var SyntheticKeyframesInCompositedCSSAnimation = 664; | |
| 32 | |
| 33 function forceStyleRecalc() { | |
| 34 getComputedStyle(target).left; | |
| 35 } | |
| 36 | |
| 37 test(() => { | |
| 38 forceStyleRecalc(); | |
| 39 assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCS
SAnimation), 'No animations started'); | |
| 40 | |
| 41 target.style.animationName = 'noSyntheticKeyframes'; | |
| 42 forceStyleRecalc(); | |
| 43 assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCS
SAnimation), 'noSyntheticKeyframes'); | |
| 44 | |
| 45 target.style.animationName = 'customPropertySyntheticKeyframes'; | |
| 46 forceStyleRecalc(); | |
| 47 assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCS
SAnimation), 'customPropertySyntheticKeyframes'); | |
| 48 | |
| 49 target.style.animationName = 'nonCompositedSyntheticKeyframes'; | |
| 50 forceStyleRecalc(); | |
| 51 assert_false(internals.isUseCounted(document, SyntheticKeyframesInCompositedCS
SAnimation), 'nonCompositedSyntheticKeyframes'); | |
| 52 | |
| 53 target.style.animationName = 'compositedSyntheticKeyframes'; | |
| 54 forceStyleRecalc(); | |
| 55 assert_true(internals.isUseCounted(document, SyntheticKeyframesInCompositedCSS
Animation), 'compositedSyntheticKeyframes'); | |
| 56 }, 'The SyntheticKeyframesInCompositedCSSAnimation use counter should only be tr
iggered by animations with composited properties with neutral keyframes'); | |
| 57 </script> | |
| OLD | NEW |