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

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

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and address comments Created 5 years, 11 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
Index: Source/core/animation/css/CSSAnimations.h
diff --git a/Source/core/animation/css/CSSAnimations.h b/Source/core/animation/css/CSSAnimations.h
index c3888f9054f64d962e2989b5cefde06286562515..299fec2947d60de4305ff729f04f0daf7fcd9fc6 100644
--- a/Source/core/animation/css/CSSAnimations.h
+++ b/Source/core/animation/css/CSSAnimations.h
@@ -32,7 +32,10 @@
#define CSSAnimations_h
#include "core/animation/InertAnimation.h"
+#include "core/animation/Interpolation.h"
+#include "core/animation/css/CSSAnimationData.h"
#include "core/animation/css/CSSAnimationUpdate.h"
+#include "core/css/CSSKeyframesRule.h"
#include "core/css/StylePropertySet.h"
#include "core/dom/Document.h"
#include "wtf/HashMap.h"
@@ -44,7 +47,6 @@ class CSSTransitionData;
class Element;
class StylePropertyShorthand;
class StyleResolver;
-class StyleRuleKeyframes;
class CSSAnimations final {
WTF_MAKE_NONCOPYABLE(CSSAnimations);
@@ -67,6 +69,40 @@ public:
void trace(Visitor*);
private:
+ struct RunningAnimation {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+ public:
+ RunningAnimation()
+ : styleRuleVersion(0)
+ {
+ }
+
+ RunningAnimation(PassRefPtrWillBeRawPtr<AnimationPlayer> player, CSSAnimationUpdate::NewAnimation animation)
+ : player(player)
+ , specifiedTiming(animation.timing)
+ , styleRule(animation.styleRule)
+ , styleRuleVersion(animation.styleRuleVersion)
+ {
+ }
+
+ void update(CSSAnimationUpdate::UpdatedAnimation update)
+ {
+ styleRule = update.styleRule;
+ styleRuleVersion = update.styleRuleVersion;
+ specifiedTiming = update.specifiedTiming;
+ }
+
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(player);
+ }
+
+ RefPtrWillBeMember<AnimationPlayer> player;
+ Timing specifiedTiming;
+ RefPtrWillBeMember<StyleRuleKeyframes> styleRule;
+ unsigned styleRuleVersion;
+ };
+
struct RunningTransition {
ALLOW_ONLY_INLINE_ALLOCATION();
public:
@@ -82,7 +118,7 @@ private:
RawPtrWillBeMember<const AnimatableValue> to;
};
- using AnimationMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<AnimationPlayer>>;
+ using AnimationMap = WillBeHeapHashMap<AtomicString, RunningAnimation>;
AnimationMap m_animations;
using TransitionMap = WillBeHeapHashMap<CSSPropertyID, RunningTransition>;

Powered by Google App Engine
This is Rietveld 408576698