* Gets the initial values of an Element's animation state. * For time-based animations, auto is equivalent to a value of 0s. * * @param {boolean} isTimeBasedAnimation
(isTimeBasedAnimation)
| 95 | * @param {boolean} isTimeBasedAnimation |
| 96 | */ |
| 97 | function getInitialNoneValues(isTimeBasedAnimation) { |
| 98 | const initialValues = { |
| 99 | 'animation-name': ['none', 'initial'], |
| 100 | 'animation-duration': ['0s', 'auto', 'initial'], |
| 101 | 'animation-timing-function': ['ease', 'initial'], |
| 102 | 'animation-delay': ['0s', 'initial'], |
| 103 | 'animation-iteration-count': ['1', 'initial'], |
| 104 | 'animation-direction': ['normal', 'initial'], |
| 105 | 'animation-fill-mode': ['none', 'initial'], |
| 106 | 'animation-play-state': ['running', 'initial', /* IE11 */ ''], |
| 107 | }; |
| 108 | if (isTimeBasedAnimation) { |
| 109 | initialValues['animation-duration'].unshift('auto'); |
| 110 | } |
| 111 | return initialValues; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Browsers are inconsistent when accessing the value for 'animation: none'. |