[Web Animations] Animations do not naturally get a finish event
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2018 05:38:01 +0000 (05:38 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2018 05:38:01 +0000 (05:38 +0000)
commitbb727478240be537ebeef879f3e26933e48764b6
tree8a01d0823df9fe18a1d42b7e69b3db83775abc0a
parenta1da4f9bdabc9b2a52cc54c8c073b3ec1afd4e83
[Web Animations] Animations do not naturally get a finish event
https://bugs.webkit.org/show_bug.cgi?id=184639
<rdar://problem/39397649>

Reviewed by Jon Lee.

LayoutTests/imported/w3c:

Record two progressions in the Web Animations WPT tests.

* web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
they will keep being scheduled in a loop.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const):
(WebCore::WebAnimation::resolve):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/animation/WebAnimation.cpp