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

Unified Diff: third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.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/CSSAnimationUpdate.h
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h b/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h
index a45b0a9c78800e65818923a8538fadfea02c5a92..5131ac4f74b01c7878261cc1b3b4f64de06b1765 100644
--- a/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h
+++ b/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h
@@ -36,8 +36,9 @@ public:
{
}
- NewAnimation(AtomicString name, InertEffect* effect, Timing timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
+ NewAnimation(AtomicString name, size_t nameIndex, InertEffect* effect, Timing timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
: name(name)
+ , nameIndex(nameIndex)
, effect(effect)
, timing(timing)
, styleRule(styleRule)
@@ -52,6 +53,7 @@ public:
}
AtomicString name;
+ size_t nameIndex;
Member<InertEffect> effect;
Timing timing;
RefPtrWillBeMember<StyleRuleKeyframes> styleRule;
@@ -66,8 +68,8 @@ public:
{
}
- UpdatedAnimation(AtomicString name, Animation* animation, InertEffect* effect, Timing specifiedTiming, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
- : name(name)
+ UpdatedAnimation(size_t index, Animation* animation, InertEffect* effect, Timing specifiedTiming, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
+ : index(index)
, animation(animation)
, effect(effect)
, specifiedTiming(specifiedTiming)
@@ -83,7 +85,7 @@ public:
visitor->trace(styleRule);
}
- AtomicString name;
+ size_t index;
Member<Animation> animation;
Member<InertEffect> effect;
Timing specifiedTiming;
@@ -110,8 +112,8 @@ public:
m_newTransitions = update.newTransitions();
m_activeInterpolationsForAnimations = update.activeInterpolationsForAnimations();
m_activeInterpolationsForTransitions = update.activeInterpolationsForTransitions();
- m_cancelledAnimationNames = update.cancelledAnimationNames();
- m_animationsWithPauseToggled = update.animationsWithPauseToggled();
+ m_cancelledAnimationIndices = update.cancelledAnimationIndices();
+ m_animationIndicesWithPauseToggled = update.animationIndicesWithPauseToggled();
m_cancelledTransitions = update.cancelledTransitions();
m_finishedTransitions = update.finishedTransitions();
m_updatedCompositorKeyframes = update.updatedCompositorKeyframes();
@@ -124,33 +126,33 @@ public:
m_newTransitions.clear();
m_activeInterpolationsForAnimations.clear();
m_activeInterpolationsForTransitions.clear();
- m_cancelledAnimationNames.clear();
- m_animationsWithPauseToggled.clear();
+ m_cancelledAnimationIndices.clear();
+ m_animationIndicesWithPauseToggled.clear();
m_cancelledTransitions.clear();
m_finishedTransitions.clear();
m_updatedCompositorKeyframes.clear();
}
- void startAnimation(const AtomicString& animationName, InertEffect* effect, const Timing& timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
+ void startAnimation(const AtomicString& animationName, size_t nameIndex, InertEffect* effect, const Timing& timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
{
effect->setName(animationName);
- m_newAnimations.append(NewAnimation(animationName, effect, timing, styleRule));
+ m_newAnimations.append(NewAnimation(animationName, nameIndex, effect, timing, styleRule));
}
// Returns whether animation has been suppressed and should be filtered during style application.
bool isSuppressedAnimation(const Animation* animation) const { return m_suppressedAnimations.contains(animation); }
- void cancelAnimation(const AtomicString& name, Animation& animation)
+ void cancelAnimation(size_t index, const Animation& animation)
{
- m_cancelledAnimationNames.append(name);
+ m_cancelledAnimationIndices.append(index);
m_suppressedAnimations.add(&animation);
}
- void toggleAnimationPaused(const AtomicString& name)
+ void toggleAnimationIndexPaused(size_t index)
{
- m_animationsWithPauseToggled.append(name);
+ m_animationIndicesWithPauseToggled.append(index);
}
- void updateAnimation(const AtomicString& name, Animation* animation, InertEffect* effect, const Timing& specifiedTiming,
+ void updateAnimation(size_t index, Animation* animation, InertEffect* effect, const Timing& specifiedTiming,
PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule)
{
- m_animationsWithUpdates.append(UpdatedAnimation(name, animation, effect, specifiedTiming, styleRule));
+ m_animationsWithUpdates.append(UpdatedAnimation(index, animation, effect, specifiedTiming, styleRule));
m_suppressedAnimations.add(animation);
}
void updateCompositorKeyframes(Animation* animation)
@@ -173,9 +175,9 @@ public:
void finishTransition(CSSPropertyID id) { m_finishedTransitions.add(id); }
const HeapVector<NewAnimation>& newAnimations() const { return m_newAnimations; }
- const Vector<AtomicString>& cancelledAnimationNames() const { return m_cancelledAnimationNames; }
+ const Vector<size_t>& cancelledAnimationIndices() const { return m_cancelledAnimationIndices; }
const HeapHashSet<Member<const Animation>>& suppressedAnimations() const { return m_suppressedAnimations; }
- const Vector<AtomicString>& animationsWithPauseToggled() const { return m_animationsWithPauseToggled; }
+ const Vector<size_t>& animationIndicesWithPauseToggled() const { return m_animationIndicesWithPauseToggled; }
const HeapVector<UpdatedAnimation>& animationsWithUpdates() const { return m_animationsWithUpdates; }
const HeapVector<Member<Animation>>& updatedCompositorKeyframes() const { return m_updatedCompositorKeyframes; }
@@ -206,9 +208,9 @@ public:
bool isEmpty() const
{
return m_newAnimations.isEmpty()
- && m_cancelledAnimationNames.isEmpty()
+ && m_cancelledAnimationIndices.isEmpty()
&& m_suppressedAnimations.isEmpty()
- && m_animationsWithPauseToggled.isEmpty()
+ && m_animationIndicesWithPauseToggled.isEmpty()
&& m_animationsWithUpdates.isEmpty()
&& m_newTransitions.isEmpty()
&& m_cancelledTransitions.isEmpty()
@@ -233,9 +235,9 @@ private:
// with the same name, due to the way in which we split up animations with
// incomplete keyframes.
HeapVector<NewAnimation> m_newAnimations;
- Vector<AtomicString> m_cancelledAnimationNames;
+ Vector<size_t> m_cancelledAnimationIndices;
HeapHashSet<Member<const Animation>> m_suppressedAnimations;
- Vector<AtomicString> m_animationsWithPauseToggled;
+ Vector<size_t> m_animationIndicesWithPauseToggled;
HeapVector<UpdatedAnimation> m_animationsWithUpdates;
HeapVector<Member<Animation>> m_updatedCompositorKeyframes;

Powered by Google App Engine
This is Rietveld 408576698