Web animation pausing/cancellation quirks
Opened this issue · 1 comments
From benchmarking a little with a hundred instances of the interruption demo (in a single AnimationContext), I've noticed the browser may take quite a while to actually pause or cancel an animation. This can make interruption jarring if the browser is busy as the starting point may not match the measuring point anymore.
Not explicitly cancelling animations as well as pausing animations before any other work (through document.getAnimations()
rather than per sprite) seems to mostly fix this.
Need to investigate further.
Part of the issue appears to be that pausing/playing animations is scheduled on the task queue and as such is mostly useless for our purposes as we synchronously want to measure.
Details: https://drafts.csswg.org/web-animations-1/#pausing-an-animation-section