зеркало из https://github.com/mozilla/gecko-dev.git
14 строки
422 B
JavaScript
14 строки
422 B
JavaScript
function waitForIterationChange(animation) {
|
|
var initialIteration = animation.effect.getComputedTiming().currentIteration;
|
|
return new Promise(resolve => {
|
|
window.requestAnimationFrame(handleFrame = () => {
|
|
if (animation.effect.getComputedTiming().currentIteration !=
|
|
initialIteration) {
|
|
resolve();
|
|
} else {
|
|
window.requestAnimationFrame(handleFrame);
|
|
}
|
|
});
|
|
});
|
|
}
|