Bug 1263063 - Part 5: Introduce TimingParams::EndTime(). r=dholbert
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Thu, 14 Apr 2016 19:39:42 +0900
changeset 331247 eeda1ce1705512036048ac378d3ac8cbfc8030f4
parent 331246 4160ea9c6de3c74e97a42a5fcef7f6739de0c002
child 331248 966cee83e97999304da409bec6697b277b85fe14
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1263063
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -249,18 +249,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