summaryrefslogtreecommitdiffstats
path: root/layout/style/nsAnimationManager.h
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 /layout/style/nsAnimationManager.h
parentdcc00ffadf64270b0ae82431f5b71c527590e91b (diff)
downloadUXP-aade91b13a50ee4f246016fa8d8d1561f58f80ee.tar
UXP-aade91b13a50ee4f246016fa8d8d1561f58f80ee.tar.gz
UXP-aade91b13a50ee4f246016fa8d8d1561f58f80ee.tar.lz
UXP-aade91b13a50ee4f246016fa8d8d1561f58f80ee.tar.xz
UXP-aade91b13a50ee4f246016fa8d8d1561f58f80ee.zip
moebius#89: DOM - implement animationcancel event
Issue #55
Diffstat (limited to 'layout/style/nsAnimationManager.h')
-rw-r--r--layout/style/nsAnimationManager.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/layout/style/nsAnimationManager.h b/layout/style/nsAnimationManager.h
index 868d4bb42..d838d090a 100644
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -76,7 +76,7 @@ public:
, mIsStylePaused(false)
, mPauseShouldStick(false)
, mNeedsNewAnimationIndexWhenRun(false)
- , mPreviousPhase(ComputedTiming::AnimationPhase::Null)
+ , mPreviousPhase(ComputedTiming::AnimationPhase::Idle)
, mPreviousIteration(0)
{
// We might need to drop this assertion once we add a script-accessible
@@ -110,8 +110,6 @@ public:
void PauseFromStyle();
void CancelFromStyle() override
{
- mOwningElement = OwningElementRef();
-
// When an animation is disassociated with style it enters an odd state
// where its composite order is undefined until it first transitions
// out of the idle state.
@@ -126,10 +124,15 @@ public:
mNeedsNewAnimationIndexWhenRun = true;
Animation::CancelFromStyle();
+
+ // We need to do this *after* calling CancelFromStyle() since
+ // CancelFromStyle might synchronously trigger a cancel event for which
+ // we need an owning element to target the event at.
+ mOwningElement = OwningElementRef();
}
void Tick() override;
- void QueueEvents();
+ void QueueEvents(StickyTimeDuration aActiveTime = StickyTimeDuration());
bool IsStylePaused() const { return mIsStylePaused; }
@@ -158,6 +161,10 @@ public:
// reflect changes to that markup.
bool IsTiedToMarkup() const { return mOwningElement.IsSet(); }
+ void MaybeQueueCancelEvent(StickyTimeDuration aActiveTime) override {
+ QueueEvents(aActiveTime);
+ }
+
protected:
virtual ~CSSAnimation()
{