зеркало из https://github.com/mozilla/gecko-dev.git
Bug 822891: Make animationiteration events fire when we're running off-main-thread animations and throttling style changes. r=nrc
This commit is contained in:
Родитель
5c1ccd273f
Коммит
48c38cd8b2
|
@ -171,17 +171,30 @@ ElementAnimations::EnsureStyleRuleFor(TimeStamp aRefreshTime,
|
||||||
ElementAnimation &anim = mAnimations[animIdx];
|
ElementAnimation &anim = mAnimations[animIdx];
|
||||||
|
|
||||||
if (anim.mProperties.Length() == 0 ||
|
if (anim.mProperties.Length() == 0 ||
|
||||||
anim.mIterationDuration.ToMilliseconds() <= 0.0 ||
|
anim.mIterationDuration.ToMilliseconds() <= 0.0) {
|
||||||
anim.IsPaused()) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t oldLastNotification = anim.mLastNotification;
|
||||||
|
|
||||||
|
// We need to call GetPositionInIteration here to populate
|
||||||
|
// aEventsToDispatch.
|
||||||
|
// The ElapsedDurationAt() call here handles pausing. But:
|
||||||
|
// FIXME: avoid recalculating every time when paused.
|
||||||
|
GetPositionInIteration(anim.ElapsedDurationAt(aRefreshTime),
|
||||||
|
anim.mIterationDuration, anim.mIterationCount,
|
||||||
|
anim.mDirection, IsForElement(),
|
||||||
|
&anim, this, &aEventsToDispatch);
|
||||||
|
|
||||||
|
// GetPositionInIteration just adjusted mLastNotification; check
|
||||||
|
// its new value against the value before we called
|
||||||
|
// GetPositionInIteration.
|
||||||
// XXX We shouldn't really be using mLastNotification as a general
|
// XXX We shouldn't really be using mLastNotification as a general
|
||||||
// indicator that the animation has finished, it should be reserved for
|
// indicator that the animation has finished, it should be reserved for
|
||||||
// events. If we use it differently in the future this use might need
|
// events. If we use it differently in the future this use might need
|
||||||
// changing.
|
// changing.
|
||||||
if ((aRefreshTime - anim.mStartTime) / anim.mIterationDuration >= anim.mIterationCount &&
|
if (anim.mLastNotification == ElementAnimation::LAST_NOTIFICATION_END &&
|
||||||
anim.mLastNotification != ElementAnimation::LAST_NOTIFICATION_END) {
|
anim.mLastNotification != oldLastNotification) {
|
||||||
aIsThrottled = false;
|
aIsThrottled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче