summaryrefslogtreecommitdiff
path: root/dom/animation/Animation.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-14 11:45:38 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-14 11:45:38 +0100
commitaade91b13a50ee4f246016fa8d8d1561f58f80ee (patch)
tree5deac61e124e06478040bedfbb1784b68fc8cc97 /dom/animation/Animation.cpp
parentdcc00ffadf64270b0ae82431f5b71c527590e91b (diff)
downloaduxp-aade91b13a50ee4f246016fa8d8d1561f58f80ee.tar.gz
moebius#89: DOM - implement animationcancel event
Issue #55
Diffstat (limited to 'dom/animation/Animation.cpp')
-rw-r--r--dom/animation/Animation.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp
index 242a0c6d66..bd318f79e3 100644
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -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