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

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 + 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
« no previous file with comments | « Source/core/animation/css/CSSAnimationUpdate.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bcec0b73c8e3c552d99ce243fe34b849bcd0a2db 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,35 @@ public:
void trace(Visitor*);
private:
+ class RunningAnimation final : public RefCountedWillBeGarbageCollected<RunningAnimation> {
+ public:
+ 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);
+ visitor->trace(styleRule);
+ }
+
+ RefPtrWillBeMember<AnimationPlayer> player;
+ Timing specifiedTiming;
+ RefPtrWillBeMember<StyleRuleKeyframes> styleRule;
+ unsigned styleRuleVersion;
+ };
+
struct RunningTransition {
ALLOW_ONLY_INLINE_ALLOCATION();
public:
@@ -82,7 +113,7 @@ private:
RawPtrWillBeMember<const AnimatableValue> to;
};
- using AnimationMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<AnimationPlayer>>;
+ using AnimationMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<RunningAnimation>>;
AnimationMap m_animations;
using TransitionMap = WillBeHeapHashMap<CSSPropertyID, RunningTransition>;
« no previous file with comments | « Source/core/animation/css/CSSAnimationUpdate.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698