MCPcopy Index your code
hub / github.com/ampproject/amphtml / getInitialNoneValues

Function getInitialNoneValues

testing/helpers/service.js:97–112  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

95 * @param {boolean} isTimeBasedAnimation
96 */
97function 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'.

Callers 1

isAnimationNoneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected