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

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

Issue 1402143004: Preserve running CSS Animations across changes to animation styles according to same name index (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Semilcelon Created 5 years, 2 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: third_party/WebKit/Source/core/animation/css/CSSAnimations.h
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.h b/third_party/WebKit/Source/core/animation/css/CSSAnimations.h
index b28a7e1dd959563291b1510f1036f606db2b0b12..70437b75726882fe2621b3dea554c97dbae64002 100644
--- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.h
+++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.h
@@ -73,7 +73,7 @@ public:
m_pendingUpdate.clear();
}
void maybeApplyPendingUpdate(Element*);
- bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpty() && m_pendingUpdate.isEmpty(); }
+ bool isEmpty() const { return m_runningAnimations.isEmpty() && m_transitions.isEmpty() && m_pendingUpdate.isEmpty(); }
void cancel();
DECLARE_TRACE();
@@ -83,6 +83,8 @@ private:
public:
RunningAnimation(Animation* animation, CSSAnimationUpdate::NewAnimation newAnimation)
: animation(animation)
+ , name(newAnimation.name)
+ , nameIndex(newAnimation.nameIndex)
, specifiedTiming(newAnimation.timing)
, styleRule(newAnimation.styleRule)
, styleRuleVersion(newAnimation.styleRuleVersion)
@@ -91,6 +93,7 @@ private:
void update(CSSAnimationUpdate::UpdatedAnimation update)
{
+ ASSERT(update.animation == animation);
styleRule = update.styleRule;
styleRuleVersion = update.styleRuleVersion;
specifiedTiming = update.specifiedTiming;
@@ -103,6 +106,8 @@ private:
}
Member<Animation> animation;
+ AtomicString name;
+ size_t nameIndex;
Timing specifiedTiming;
RefPtrWillBeMember<StyleRuleKeyframes> styleRule;
unsigned styleRuleVersion;
@@ -121,8 +126,7 @@ private:
const AnimatableValue* to;
};
- using AnimationMap = HeapHashMap<AtomicString, Member<RunningAnimation>>;
- AnimationMap m_animations;
+ HeapVector<Member<RunningAnimation>> m_runningAnimations;
using TransitionMap = HeapHashMap<CSSPropertyID, RunningTransition>;
TransitionMap m_transitions;

Powered by Google App Engine
This is Rietveld 408576698