haikuwebkit/LayoutTests/animations/change-completed-animation-...

28 lines
552 B
HTML
Raw Permalink Normal View History

Toggling animation-play-state can re-start a finished animation https://bugs.webkit.org/show_bug.cgi?id=156731 Reviewed by Dean Jackson. Source/WebCore: After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared all state that the animation had run on the element, so changing the value of some animation property triggered the animation to run again. This is wrong, since animation-name still applied to the element. Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations map. This allows for the removal of the index property on KeyframeAnimation. Tests: animations/change-completed-animation-transform.html animations/change-completed-animation.html * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::timeToNextService): * page/animation/AnimationBase.h: (WebCore::AnimationBase::isAnimatingProperty): * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap, and swap with m_keyframeAnimations at the end. (WebCore::CompositeAnimation::updateKeyframeAnimations): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::KeyframeAnimation): (WebCore::KeyframeAnimation::getAnimatedStyle): * page/animation/KeyframeAnimation.h: LayoutTests: * animations/animation-direction-reverse-expected.txt: * animations/animation-direction-reverse.html: This is a progression. The test was detecting a restarted animation. * animations/change-completed-animation-expected.txt: Added. * animations/change-completed-animation-transform-expected.html: Added. * animations/change-completed-animation-transform.html: Added. Ref test that ensures that the final state for normal and accelerated animations is correct. * animations/change-completed-animation.html: Added. Tests that changing a property doesn't trigger another animation, by detecting a second animationstart event. Canonical link: https://commits.webkit.org/175103@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-25 20:56:47 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.container {
height: 100px;
width: 500px;
margin: 4px;
border: 1px solid black;
}
.box {
position: relative;
width: 100px;
height: 100px;
background-color: green;
}
</style>
</head>
<body>
<div class="container">
<div id="box" class="mover box"></div>
</div>
<div class="container">
<div id="box" class="slider box"></div>
</div>
</body>
</html>