Bug 156731 - Toggling animation-play-state can re-start a finished animation
Summary: Toggling animation-play-state can re-start a finished animation
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
Depends on:
Reported: 2016-04-18 22:22 PDT by Simon Fraser (smfr)
Modified: 2016-04-25 16:59 PDT (History)
5 users (show)

See Also:

Testcase (769 bytes, text/html)
2016-04-18 22:22 PDT, Simon Fraser (smfr)
no flags Details
Patch (24.08 KB, patch)
2016-04-24 23:01 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (24.14 KB, patch)
2016-04-25 13:36 PDT, Simon Fraser (smfr)
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-04-18 22:22:50 PDT
Created attachment 276694 [details]

In the attached test case, hover the box and wait for the animation to finish. Then un-hover and re-hover. Note how the animation restarts.

In other browsers, the animation does not restart, which is correct because the animation-name property still applies to the element. Our mistake is to completely remove finished animations in CompositeAnimation::updateKeyframeAnimations(). We need to keep some state around to know that we shouldn't re-run this animation when play-state changes.
Comment 1 Simon Fraser (smfr) 2016-04-24 23:01:55 PDT
Created attachment 277219 [details]
Comment 2 Simon Fraser (smfr) 2016-04-25 13:36:31 PDT
Created attachment 277273 [details]
Comment 3 Dean Jackson 2016-04-25 13:47:14 PDT
Comment on attachment 277273 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=277273&action=review

> Source/WebCore/ChangeLog:14
> +        Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
> +        map. This allows for the removal of the 

You forgot to end this sentence
Comment 4 Simon Fraser (smfr) 2016-04-25 13:56:59 PDT
Comment 5 Ryan Haddad 2016-04-25 16:59:46 PDT
This change appears to have caused fast/layers/no-clipping-overflow-hidden-added-after-transform.html to fail on mac-wk1 debug