Bug 1237467 part 2 - Clear mProgressOnLastCompose when the effect is no longer relevant; r=heycam
authorBrian Birtles <birtles@gmail.com>
Fri, 15 Jan 2016 15:15:47 +0900
changeset 322095 7fdf99692385affe2fa3170d918c7a6ea008c0e7
parent 322094 1d51246e9c8f72a71a33ba4ba16d745b5eff9d8c
child 322096 9f5396096fd990fa4ca05a2001476c98a20d5a6b
push id9530
push userdmitchell@mozilla.com
push dateFri, 15 Jan 2016 19:42:24 +0000
reviewersheycam
bugs1237467
milestone46.0a1
Bug 1237467 part 2 - Clear mProgressOnLastCompose when the effect is no longer relevant; r=heycam
dom/animation/KeyframeEffect.cpp
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -175,16 +175,24 @@ KeyframeEffectReadOnly::NotifyAnimationT
       EffectCompositor::RestyleType::Throttled :
       EffectCompositor::RestyleType::Standard;
     nsPresContext* presContext = GetPresContext();
     if (presContext) {
       presContext->EffectCompositor()->
         RequestRestyle(mTarget, mPseudoType, restyleType,
                        mAnimation->CascadeLevel());
     }
+
+    // If we're not relevant, we will have been removed from the EffectSet.
+    // As a result, when the restyle we requested above is fulfilled, our
+    // ComposeStyle will not get called and mProgressOnLastCompose will not
+    // be updated. Instead, we need to manually clear it.
+    if (!isRelevant) {
+      mProgressOnLastCompose.SetNull();
+    }
   }
 }
 
 Nullable<TimeDuration>
 KeyframeEffectReadOnly::GetLocalTime() const
 {
   // Since the *animation* start time is currently always zero, the local
   // time is equal to the parent time.