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

Method runAnim

src/service/vsync-impl.js:300–311  ·  view source on GitHub ↗

* Runs the animation vsync task. This operation can only run when animations * are allowed. Otherwise, this method returns `false` and exits. * @param {!Node} contextNode * @param {!VsyncTaskSpecDef} task * @param {!VsyncStateDef=} opt_state * @return {boolean}

(contextNode, task, opt_state)

Source from the content-addressed store, hash-verified

298 * @return {boolean}
299 */
300 runAnim(contextNode, task, opt_state) {
301 // Do not request animation frames when the document is not visible.
302 if (!this.canAnimate_(contextNode)) {
303 dev().warn(
304 'VSYNC',
305 'Did not schedule a vsync request, because document was invisible'
306 );
307 return false;
308 }
309 this.run(task, opt_state);
310 return true;
311 }
312
313 /**
314 * Creates an animation vsync task. This operation can only run when

Callers 2

createAnimTaskMethod · 0.95
test-vsync.jsFile · 0.80

Calls 4

canAnimate_Method · 0.95
runMethod · 0.95
devFunction · 0.90
warnMethod · 0.80

Tested by

no test coverage detected