Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 1030103002: Transitions: Downgrade transition to animation after it has finished (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/AnimationPlayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimations.cpp
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index 1e94f60a44c42de2c4c5887afb0b5d5a05eb3101..64d235d1a53ea09de9950ece0ae83d7a08ab7671 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -398,13 +398,22 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
if (animation->hasActiveAnimationsOnCompositor(id) && update->newTransitions().find(id) != update->newTransitions().end() && !player->limited())
retargetedCompositorTransitions.add(id, std::pair<RefPtrWillBeMember<Animation>, double>(animation, player->startTimeInternal()));
player->cancel();
+ // after cancelation, transitions must be downgraded or they'll fail
+ // to be considered when retriggering themselves. This can happen if
+ // the transition is captured through getAnimationPlayers then played.
+ if (player->source() && player->source()->isAnimation())
+ toAnimation(player->source())->downgradeToNormalAnimation();
player->update(TimingUpdateOnDemand);
}
for (CSSPropertyID id : update->finishedTransitions()) {
// This transition can also be cancelled and finished at the same time
- if (m_transitions.contains(id))
- m_transitions.take(id);
+ if (m_transitions.contains(id)) {
+ RefPtrWillBeRawPtr<AnimationPlayer> player = m_transitions.take(id).player;
+ // Transition must be downgraded
+ if (player->source() && player->source()->isAnimation())
+ toAnimation(player->source())->downgradeToNormalAnimation();
+ }
}
for (const auto& entry : update->newTransitions()) {
« no previous file with comments | « Source/core/animation/AnimationPlayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698