web-animations / web-animations-js-legacy

The original emulator of the Web Animations specification. Please use web-animations-js instead:
https://github.com/web-animations/web-animations-js
Apache License 2.0
706 stars 84 forks source link

Add ability to freeze timeline clock for testing #634

Open ewilligers opened 10 years ago

ewilligers commented 10 years ago

Players may have non-zero start time, and/or playback rates other than one. As noted in https://github.com/web-animations/web-animations-js/issues/628, calling document.timeline._pauseAnimationsForTesting with the current timeline time will change such players' currentTime, and will change the animated elements' computed style.

We implement a new testing method _freezeClockForTesting that avoids changing any of the players, it simply freezes the timeline's currentTime to the supplied time.