Currently Document::getAnimations doesn't clean style/layout before returning the animations.
This means the following fails:
console.log(document.getAnimations().length); // Say this is currently 0
element.classList.add('animateStyle');
console.log(document.getAnimations().length); // Still returns 0.
window.requestAnimationFrame(function() {
console.log(document.getAnimations().length); // Now it returns 1.
});
The spec and Firefox immediately have the new animation in document.getAnimations().
Comment 1 by bugdroid1@chromium.org
, Feb 23 2018