moebius#89: DOM - implement animationcancel event

Issue #55
This commit is contained in:
janekptacijarabaci 2018-03-14 11:45:38 +01:00 committed by Roy Tam
commit 901d2a277f
11 changed files with 99 additions and 73 deletions

View file

@ -787,12 +787,21 @@ Animation::CancelNoUpdate()
mHoldTime.SetNull();
mStartTime.SetNull();
UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
if (mTimeline) {
mTimeline->RemoveAnimation(this);
}
MaybeQueueCancelEvent(activeTime);
// When an animation is cancelled it no longer needs further ticks from the
// timeline. However, if we queued a cancel event and this was the last
// animation attached to the timeline, the timeline will stop observing the
// refresh driver and there may be no subsequent refresh driver tick for
// dispatching the queued event.
//
// By calling UpdateTiming *after* removing ourselves from our timeline, we
// ensure the timeline will register with the refresh driver for at least one
// more tick.
UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
}
void