From 831293b9dc0cb3d3dfc63d574098d7fb207d7025 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 19 Feb 2016 09:16:15 +0900 Subject: [PATCH] Bug 1242872 - Part 5: Change CopyPropertiesFrom to UpdateProperties. r=birtles Once we don't create any temporary effect, we do not need to pass the effect to CopyPropertiesFrom. MozReview-Commit-ID: HczU5IU6Ggp --- dom/animation/KeyframeEffect.cpp | 5 +++-- dom/animation/KeyframeEffect.h | 9 +++++---- layout/style/nsAnimationManager.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 01e8af75244ca..9d91443f3987e 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -453,7 +453,8 @@ KeyframeEffectReadOnly::HasAnimationOfProperties( } void -KeyframeEffectReadOnly::CopyPropertiesFrom(const KeyframeEffectReadOnly& aOther) +KeyframeEffectReadOnly::UpdateProperties( + const InfallibleTArray& aProperties) { nsCSSPropertySet winningInCascadeProperties; nsCSSPropertySet runningOnCompositorProperties; @@ -467,7 +468,7 @@ KeyframeEffectReadOnly::CopyPropertiesFrom(const KeyframeEffectReadOnly& aOther) } } - mProperties = aOther.mProperties; + mProperties = aProperties; for (AnimationProperty& property : mProperties) { property.mWinsInCascade = diff --git a/dom/animation/KeyframeEffect.h b/dom/animation/KeyframeEffect.h index f4c9d8fc2f88c..a3138be344fd8 100644 --- a/dom/animation/KeyframeEffect.h +++ b/dom/animation/KeyframeEffect.h @@ -287,10 +287,11 @@ class KeyframeEffectReadOnly : public AnimationEffectReadOnly InfallibleTArray& Properties() { return mProperties; } - // Copies the properties from another keyframe effect whilst preserving - // the mWinsInCascade and mIsRunningOnCompositor state of matching - // properties. - void CopyPropertiesFrom(const KeyframeEffectReadOnly& aOther); + // Updates the set of properties using the supplied list whilst preserving + // the mWinsInCascade and mIsRunningOnCompositor state of any matching + // properties + void UpdateProperties( + const InfallibleTArray& aProperties); // Updates |aStyleRule| with the animation values produced by this // AnimationEffect for the current time except any properties already diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp index 6acf46512f0e1..954d7e196cefe 100644 --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -341,7 +341,7 @@ UpdateOldAnimationPropertiesWithNew(CSSAnimation& aOld, Animation& aNew) oldEffect->SpecifiedTiming() != newEffect->SpecifiedTiming() || oldEffect->Properties() != newEffect->Properties(); oldEffect->SetSpecifiedTiming(newEffect->SpecifiedTiming()); - oldEffect->CopyPropertiesFrom(*newEffect); + oldEffect->UpdateProperties(newEffect->Properties()); } // Handle changes in play state. If the animation is idle, however,