Bug 1267937 - Part 1: Clear mProgressOnLastCompose once we are not in effect. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Sat, 30 Apr 2016 07:08:10 +0900
changeset 358016 ed8b34b4178b724c09c21b5600d753c74bf70c35
parent 357990 2b7c421063ad7e30b6491d62ed8480ca333b628a
child 358017 ae84c58df09034c7195e40c7184aa84b95acd93a
push id16908
push userhiikezoe@mozilla-japan.org
push dateFri, 29 Apr 2016 23:19:29 +0000
reviewersbirtles
bugs1267937
milestone49.0a1
Bug 1267937 - Part 1: Clear mProgressOnLastCompose once we are not in effect. r?birtles MozReview-Commit-ID: 7g0eytuTE8P
dom/animation/KeyframeEffect.cpp
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -180,24 +180,24 @@ KeyframeEffectReadOnly::NotifyAnimationT
   // Bug 1216843: When we implement iteration composite modes, we need to
   // also detect if the current iteration has changed.
   if (mAnimation && GetComputedTiming().mProgress != mProgressOnLastCompose) {
     EffectCompositor::RestyleType restyleType =
       CanThrottle() ?
       EffectCompositor::RestyleType::Throttled :
       EffectCompositor::RestyleType::Standard;
     RequestRestyle(restyleType);
+  }
 
-    // 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();
-    }
+  // If we're no longer "in effect", our ComposeStyle method will never be
+  // called and we will never have a chance to update mProgressOnLastCompose.
+  // We clear mProgressOnLastCompose here to ensure that if we later become
+  // "in effect" we will request a restyle (above).
+  if (!inEffect) {
+     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.