Bug 1194028 - Part 1: Implement Animation NotifyEffectTimingUpdate and KeyframeEffect SetTiming. r=bbirtles

This commit is contained in:
Hiroyuki Ikezoe 2015-08-17 14:28:00 -04:00
parent 39f9cd380f
commit a4077879ac
4 changed files with 28 additions and 0 deletions

View File

@ -650,6 +650,16 @@ Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
}
}
void
Animation::NotifyEffectTimingUpdated()
{
MOZ_ASSERT(mEffect,
"We should only update timing effect when we have a target "
"effect");
UpdateTiming(Animation::SeekFlag::NoSeek,
Animation::SyncNotifyFlag::Async);
}
// http://w3c.github.io/web-animations/#play-an-animation
void
Animation::DoPlay(ErrorResult& aRv, LimitBehavior aLimitBehavior)

View File

@ -297,6 +297,9 @@ public:
void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties,
bool& aNeedsRefreshes);
void NotifyEffectTimingUpdated();
protected:
void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
void SilentlySetPlaybackRate(double aPlaybackRate);

View File

@ -87,6 +87,17 @@ KeyframeEffectReadOnly::SetParentTime(Nullable<TimeDuration> aParentTime)
mParentTime = aParentTime;
}
void
KeyframeEffectReadOnly::SetTiming(const AnimationTiming& aTiming,
Animation& aOwningAnimation)
{
if (mTiming == aTiming) {
return;
}
mTiming = aTiming;
aOwningAnimation.NotifyEffectTimingUpdated();
}
ComputedTiming
KeyframeEffectReadOnly::GetComputedTimingAt(
const Nullable<TimeDuration>& aLocalTime,

View File

@ -242,6 +242,10 @@ public:
return mTiming;
}
// FIXME: Drop |aOwningAnimation| once we make AnimationEffects track their
// owning animation.
void SetTiming(const AnimationTiming& aTiming, Animation& aOwningAnimtion);
// Return the duration from the start the active interval to the point where
// the animation begins playback. This is zero unless the animation has
// a negative delay in which case it is the absolute value of the delay.