Bug 1178662 part 4 - Implement the setting timeline procedure. r=birtles
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 31 May 2016 09:42:37 +0900
changeset 340634 ca028a4f21e9458477d0e7fe55bfaac59d914481
parent 340633 2f29a879a99b23540addcd077c08ead79b035502
child 340635 127e959fd8623aafd60d9eb347d3e98a75d4769c
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1178662
milestone49.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 1178662 part 4 - Implement the setting timeline procedure. r=birtles This is implementation of 'Setting the timeline of an animation'.[1] [1] https://w3c.github.io/web-animations/#setting-the-timeline MozReview-Commit-ID: A5YMXhkxHjr
dom/animation/Animation.cpp
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -150,31 +150,30 @@ Animation::SetEffect(KeyframeEffectReadO
 
 void
 Animation::SetTimeline(AnimationTimeline* aTimeline)
 {
   SetTimelineNoUpdate(aTimeline);
   PostUpdate();
 }
 
+// https://w3c.github.io/web-animations/#setting-the-timeline
 void
 Animation::SetTimelineNoUpdate(AnimationTimeline* aTimeline)
 {
+  RefPtr<AnimationTimeline> oldTimeline = mTimeline;
   if (mTimeline == aTimeline) {
     return;
   }
 
-  if (mTimeline) {
-    mTimeline->NotifyAnimationUpdated(*this);
+  mTimeline = aTimeline;
+  if (!mStartTime.IsNull()) {
+    mHoldTime.SetNull();
   }
 
-  mTimeline = aTimeline;
-
-  // FIXME(spec): Once we implement the seeking defined in the spec
-  // surely this should be SeekFlag::DidSeek but the spec says otherwise.
   UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
 }
 
 // https://w3c.github.io/web-animations/#set-the-animation-start-time
 void
 Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
 {
   if (aNewStartTime == mStartTime) {