Skip to content

Commit

Permalink
Bug 1242872 - Part 5: Change CopyPropertiesFrom to UpdateProperties. …
Browse files Browse the repository at this point in the history
…r=birtles

Once we don't create any temporary effect, we do not need to pass
the effect to CopyPropertiesFrom.

MozReview-Commit-ID: HczU5IU6Ggp
  • Loading branch information
Hiroyuki Ikezoe committed Feb 19, 2016
1 parent 88ae2b6 commit 831293b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions dom/animation/KeyframeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ KeyframeEffectReadOnly::HasAnimationOfProperties(
}

void
KeyframeEffectReadOnly::CopyPropertiesFrom(const KeyframeEffectReadOnly& aOther)
KeyframeEffectReadOnly::UpdateProperties(
const InfallibleTArray<AnimationProperty>& aProperties)
{
nsCSSPropertySet winningInCascadeProperties;
nsCSSPropertySet runningOnCompositorProperties;
Expand All @@ -467,7 +468,7 @@ KeyframeEffectReadOnly::CopyPropertiesFrom(const KeyframeEffectReadOnly& aOther)
}
}

mProperties = aOther.mProperties;
mProperties = aProperties;

for (AnimationProperty& property : mProperties) {
property.mWinsInCascade =
Expand Down
9 changes: 5 additions & 4 deletions dom/animation/KeyframeEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,11 @@ class KeyframeEffectReadOnly : public AnimationEffectReadOnly
InfallibleTArray<AnimationProperty>& 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<AnimationProperty>& aProperties);

// Updates |aStyleRule| with the animation values produced by this
// AnimationEffect for the current time except any properties already
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsAnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 831293b

Please sign in to comment.