Bug 1263063 - Part 5: Introduce TimingParams::EndTime(). r?dholbert draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Thu, 14 Apr 2016 19:39:42 +0900
changeset 350876 7b7765b71955e8219dc3c7444e3642881a2fda6f
parent 350875 56e52a836fb15aa3cac9d292dc4c140ac7214bd5
child 350877 cbc2808761f8a7c04847de236d94be0d0759a321
push id15434
push userbmo:hiikezoe@mozilla-japan.org
push dateThu, 14 Apr 2016 10:40:04 +0000
reviewersdholbert
bugs1263063
milestone48.0a1
Bug 1263063 - Part 5: Introduce TimingParams::EndTime(). r?dholbert MozReview-Commit-ID: 6dpnb65vndl
dom/animation/KeyframeEffect.cpp
dom/animation/TimingParams.h
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -247,18 +247,17 @@ KeyframeEffectReadOnly::GetComputedTimin
              "ValidateIterations or CSSParser");
   result.mIterations = aTiming.mIterations;
   MOZ_ASSERT(aTiming.mIterationStart >= 0.0,
              "mIterationStart should be nonnegative, as ensured by "
              "ValidateIterationStart");
   result.mIterationStart = aTiming.mIterationStart;
 
   result.mActiveDuration = aTiming.ActiveDuration();
-  result.mEndTime = aTiming.mDelay + result.mActiveDuration +
-                    aTiming.mEndDelay;
+  result.mEndTime = aTiming.EndTime();
   result.mFill = aTiming.mFill == dom::FillMode::Auto ?
                  dom::FillMode::None :
                  aTiming.mFill;
 
   // The default constructor for ComputedTiming sets all other members to
   // values consistent with an animation that has not been sampled.
   if (aLocalTime.IsNull()) {
     return result;
--- a/dom/animation/TimingParams.h
+++ b/dom/animation/TimingParams.h
@@ -107,16 +107,21 @@ struct TimingParams
     static const StickyTimeDuration zeroDuration;
     if (!mDuration || *mDuration == zeroDuration || mIterations == 0.0) {
       return zeroDuration;
     }
 
     return mDuration->MultDouble(mIterations);
   }
 
+  StickyTimeDuration EndTime() const
+  {
+    return mDelay + ActiveDuration() + mEndDelay;
+  }
+
   bool operator==(const TimingParams& aOther) const;
   bool operator!=(const TimingParams& aOther) const
   {
     return !(*this == aOther);
   }
 };
 
 } // namespace mozilla