Bug 1207951 - Fix buggy logic in ComposeStyle; r=heycam

This commit is contained in:
Brian Birtles 2015-09-28 12:38:41 +09:00
parent 9f7447f6cb
commit ead24303e1

View File

@ -617,11 +617,9 @@ Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
// immediately before updating the style rule and then restore it immediately
// afterwards. This is purely to prevent visual flicker. Other behavior
// such as dispatching events continues to rely on the regular timeline time.
bool updatedHoldTime = false;
{
AutoRestore<Nullable<TimeDuration>> restoreHoldTime(mHoldTime);
bool updatedHoldTime = false;
AnimationPlayState playState = PlayState();
if (playState == AnimationPlayState::Pending &&
mHoldTime.IsNull() &&
@ -642,13 +640,16 @@ Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
}
mEffect->ComposeStyle(aStyleRule, aSetProperties);
if (updatedHoldTime) {
UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
}
mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished);
}
// Now that the hold time has been restored, update the effect
if (updatedHoldTime) {
UpdateEffect();
}
MOZ_ASSERT(playState == PlayState(),
"Play state should not change during the course of compositing");
mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished);
}
void