Bug 1152171 part 2 - Rename AnimationTimeline to DocumentTimeline; r=smaug
authorBrian Birtles <birtles@gmail.com>
Fri, 10 Apr 2015 10:34:22 +0900
changeset 270197 9296539ae8007e2b5c0ded48961367ab9b11b2ae
parent 270196 8c0766ab1022c291c8b98fb2297076c3bb4e179e
child 270198 df60406c8e622a29b453600b1b37232b80029681
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1152171
milestone40.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 1152171 part 2 - Rename AnimationTimeline to DocumentTimeline; r=smaug And then re-add AnimationTimeline as an abstract super-interface of DocumentTimeline.
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
dom/animation/AnimationTimeline.cpp
dom/animation/AnimationTimeline.h
dom/animation/DocumentTimeline.cpp
dom/animation/DocumentTimeline.h
dom/animation/PendingPlayerTracker.cpp
dom/animation/moz.build
dom/animation/test/animation-timeline/test_animation-timeline.html
dom/animation/test/animation-timeline/test_request_animation_frame.html
dom/animation/test/document-timeline/test_document-timeline.html
dom/animation/test/document-timeline/test_request_animation_frame.html
dom/animation/test/mochitest.ini
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsIDocument.h
dom/bindings/Bindings.conf
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/AnimationTimeline.webidl
dom/webidl/Document.webidl
dom/webidl/DocumentTimeline.webidl
dom/webidl/moz.build
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -175,17 +175,17 @@ AnimationPlayer::PlayState() const
       (mPlaybackRate < 0.0 && currentTime.Value().ToMilliseconds() <= 0.0)) {
     return AnimationPlayState::Finished;
   }
 
   return AnimationPlayState::Running;
 }
 
 static inline already_AddRefed<Promise>
-CreatePromise(AnimationTimeline* aTimeline, ErrorResult& aRv)
+CreatePromise(DocumentTimeline* aTimeline, ErrorResult& aRv)
 {
   nsIGlobalObject* global = aTimeline->GetParentObject();
   if (global) {
     return Promise::Create(global, aRv);
   }
   return nullptr;
 }
 
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/AnimationPlayer.h
@@ -7,17 +7,17 @@
 #define mozilla_dom_AnimationPlayer_h
 
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
 #include "mozilla/dom/Animation.h" // for Animation
 #include "mozilla/dom/AnimationPlayerBinding.h" // for AnimationPlayState
-#include "mozilla/dom/AnimationTimeline.h" // for AnimationTimeline
+#include "mozilla/dom/DocumentTimeline.h" // for DocumentTimeline
 #include "mozilla/dom/Promise.h" // for Promise
 #include "nsCSSProperty.h" // for nsCSSProperty
 
 // X11 has a #define for CurrentTime.
 #ifdef CurrentTime
 #undef CurrentTime
 #endif
 
@@ -46,46 +46,47 @@ namespace dom {
 
 class AnimationPlayer : public nsISupports,
                         public nsWrapperCache
 {
 protected:
   virtual ~AnimationPlayer() {}
 
 public:
-  explicit AnimationPlayer(AnimationTimeline* aTimeline)
+  explicit AnimationPlayer(DocumentTimeline* aTimeline)
     : mTimeline(aTimeline)
     , mPlaybackRate(1.0)
     , mPendingState(PendingState::NotPending)
     , mIsRunningOnCompositor(false)
     , mIsPreviousStateFinished(false)
     , mFinishedAtLastComposeStyle(false)
     , mIsRelevant(false)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer)
 
-  AnimationTimeline* GetParentObject() const { return mTimeline; }
-  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
+  DocumentTimeline* GetParentObject() const { return mTimeline; }
+  virtual JSObject* WrapObject(JSContext* aCx,
+                               JS::Handle<JSObject*> aGivenProto) override;
 
   virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; }
   virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; }
 
   // Flag to pass to DoPlay to indicate that it should not carry out finishing
   // behavior (reset the current time to the beginning of the active duration).
   enum LimitBehavior {
     AutoRewind = 0,
     Continue = 1
   };
 
   // AnimationPlayer methods
   Animation* GetSource() const { return mSource; }
-  AnimationTimeline* Timeline() const { return mTimeline; }
+  DocumentTimeline* Timeline() const { return mTimeline; }
   Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
   void SetStartTime(const Nullable<TimeDuration>& aNewStartTime);
   Nullable<TimeDuration> GetCurrentTime() const;
   void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
   void SetCurrentTime(const TimeDuration& aNewCurrentTime);
   double PlaybackRate() const { return mPlaybackRate; }
   void SetPlaybackRate(double aPlaybackRate);
   void SilentlySetPlaybackRate(double aPlaybackRate);
@@ -296,17 +297,17 @@ protected:
   bool IsPossiblyOrphanedPendingPlayer() const;
   StickyTimeDuration SourceContentEnd() const;
 
   nsIDocument* GetRenderedDocument() const;
   nsPresContext* GetPresContext() const;
   virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
   AnimationPlayerCollection* GetCollection() const;
 
-  nsRefPtr<AnimationTimeline> mTimeline;
+  nsRefPtr<DocumentTimeline> mTimeline;
   nsRefPtr<Animation> mSource;
   // The beginning of the delay period.
   Nullable<TimeDuration> mStartTime; // Timeline timescale
   Nullable<TimeDuration> mHoldTime;  // Player timescale
   Nullable<TimeDuration> mPendingReadyTime; // Timeline timescale
   Nullable<TimeDuration> mPreviousCurrentTime; // Player timescale
   double mPlaybackRate;
 
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -1,121 +1,22 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AnimationTimeline.h"
-#include "mozilla/dom/AnimationTimelineBinding.h"
-#include "AnimationUtils.h"
-#include "nsContentUtils.h"
-#include "nsIPresShell.h"
-#include "nsPresContext.h"
-#include "nsRefreshDriver.h"
-#include "nsDOMNavigationTiming.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationTimeline, mDocument, mWindow)
-
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationTimeline, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationTimeline, Release)
-
-JSObject*
-AnimationTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto);
-}
-
-Nullable<TimeDuration>
-AnimationTimeline::GetCurrentTime() const
-{
-  return ToTimelineTime(GetCurrentTimeStamp());
-}
-
-Nullable<double>
-AnimationTimeline::GetCurrentTimeAsDouble() const
-{
-  return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
-}
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationTimeline, mWindow)
 
-TimeStamp
-AnimationTimeline::GetCurrentTimeStamp() const
-{
-  nsRefreshDriver* refreshDriver = GetRefreshDriver();
-  TimeStamp refreshTime = refreshDriver
-                          ? refreshDriver->MostRecentRefresh()
-                          : TimeStamp();
-
-  // Always return the same object to benefit from return-value optimization.
-  TimeStamp result = !refreshTime.IsNull()
-                     ? refreshTime
-                     : mLastRefreshDriverTime;
-
-  // If we don't have a refresh driver and we've never had one use the
-  // timeline's zero time.
-  if (result.IsNull()) {
-    nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
-    if (timing) {
-      result = timing->GetNavigationStartTimeStamp();
-      // Also, let this time represent the current refresh time. This way
-      // we'll save it as the last refresh time and skip looking up
-      // navigation timing each time.
-      refreshTime = result;
-    }
-  }
+NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationTimeline)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationTimeline)
 
-  if (!refreshTime.IsNull()) {
-    mLastRefreshDriverTime = refreshTime;
-  }
-
-  return result;
-}
-
-Nullable<TimeDuration>
-AnimationTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
-{
-  Nullable<TimeDuration> result; // Initializes to null
-  if (aTimeStamp.IsNull()) {
-    return result;
-  }
-
-  nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
-  if (MOZ_UNLIKELY(!timing)) {
-    return result;
-  }
-
-  result.SetValue(aTimeStamp - timing->GetNavigationStartTimeStamp());
-  return result;
-}
-
-TimeStamp
-AnimationTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
-{
-  TimeStamp result;
-  nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
-  if (MOZ_UNLIKELY(!timing)) {
-    return result;
-  }
-
-  result = timing->GetNavigationStartTimeStamp() + aTimeDuration;
-  return result;
-}
-
-nsRefreshDriver*
-AnimationTimeline::GetRefreshDriver() const
-{
-  nsIPresShell* presShell = mDocument->GetShell();
-  if (MOZ_UNLIKELY(!presShell)) {
-    return nullptr;
-  }
-
-  nsPresContext* presContext = presShell->GetPresContext();
-  if (MOZ_UNLIKELY(!presContext)) {
-    return nullptr;
-  }
-
-  return presContext->RefreshDriver();
-}
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationTimeline)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+NS_INTERFACE_MAP_END
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -1,92 +1,56 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_AnimationTimeline_h
 #define mozilla_dom_AnimationTimeline_h
 
+#include "nsISupports.h"
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/AnimationUtils.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/TimeStamp.h"
 #include "nsIGlobalObject.h"
 #include "js/TypeDecls.h"
-#include "nsIDocument.h"
-#include "nsRefreshDriver.h"
-
-struct JSContext;
 
 namespace mozilla {
 namespace dom {
 
-class AnimationTimeline final : public nsWrapperCache
+class AnimationTimeline
+  : public nsISupports
+  , public nsWrapperCache
 {
 public:
-  explicit AnimationTimeline(nsIDocument* aDocument)
-    : mDocument(aDocument)
-    , mWindow(aDocument->GetParentObject())
+  explicit AnimationTimeline(nsIGlobalObject* aWindow)
+    : mWindow(aWindow)
   {
     MOZ_ASSERT(mWindow);
   }
 
 protected:
   virtual ~AnimationTimeline() { }
 
 public:
-  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationTimeline)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationTimeline)
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationTimeline)
 
-  nsIGlobalObject* GetParentObject() const
-  {
-    return mWindow;
-  }
-  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
+  nsIGlobalObject* GetParentObject() const { return mWindow; }
 
   // AnimationTimeline methods
-  Nullable<TimeDuration> GetCurrentTime() const;
+  virtual Nullable<TimeDuration> GetCurrentTime() const = 0;
 
   // Wrapper functions for AnimationTimeline DOM methods when called from
   // script.
-  Nullable<double> GetCurrentTimeAsDouble() const;
-
-  // Converts a TimeStamp to the equivalent value in timeline time.
-  // Note that when IsUnderTestControl() is true, there is no correspondence
-  // between timeline time and wallclock time. In such a case, passing a
-  // timestamp from TimeStamp::Now() to this method will not return a
-  // meaningful result.
-  Nullable<TimeDuration> ToTimelineTime(const TimeStamp& aTimeStamp) const;
-  TimeStamp ToTimeStamp(const TimeDuration& aTimelineTime) const;
-
-  nsRefreshDriver* GetRefreshDriver() const;
-  // Returns true if this timeline is driven by a refresh driver that is
-  // under test control. In such a case, there is no correspondence between
-  // TimeStamp values returned by the refresh driver and wallclock time.
-  // As a result, passing a value from TimeStamp::Now() to ToTimelineTime()
-  // would not return a meaningful result.
-  bool IsUnderTestControl() const
-  {
-    nsRefreshDriver* refreshDriver = GetRefreshDriver();
-    return refreshDriver && refreshDriver->IsTestControllingRefreshesEnabled();
+  Nullable<double> GetCurrentTimeAsDouble() const {
+    return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
   }
 
 protected:
-  TimeStamp GetCurrentTimeStamp() const;
-
-  // Sometimes documents can be given a new window, or windows can be given a
-  // new document (e.g. document.open()). Since GetParentObject is required to
-  // _always_ return the same object it can't get the window from our
-  // mDocument, which is why we have pointers to both our document and window.
-  nsCOMPtr<nsIDocument> mDocument;
   nsCOMPtr<nsIGlobalObject> mWindow;
-
-  // The most recently used refresh driver time. This is used in cases where
-  // we don't have a refresh driver (e.g. because we are in a display:none
-  // iframe).
-  mutable TimeStamp mLastRefreshDriverTime;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_AnimationTimeline_h
copy from dom/animation/AnimationTimeline.cpp
copy to dom/animation/DocumentTimeline.cpp
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/DocumentTimeline.cpp
@@ -1,50 +1,52 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "AnimationTimeline.h"
-#include "mozilla/dom/AnimationTimelineBinding.h"
+#include "DocumentTimeline.h"
+#include "mozilla/dom/DocumentTimelineBinding.h"
 #include "AnimationUtils.h"
 #include "nsContentUtils.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsRefreshDriver.h"
 #include "nsDOMNavigationTiming.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationTimeline, mDocument, mWindow)
+NS_IMPL_CYCLE_COLLECTION_INHERITED(DocumentTimeline, AnimationTimeline,
+                                   mDocument)
 
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationTimeline, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationTimeline, Release)
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(DocumentTimeline,
+                                               AnimationTimeline)
+NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DocumentTimeline)
+NS_INTERFACE_MAP_END_INHERITING(AnimationTimeline)
+
+NS_IMPL_ADDREF_INHERITED(DocumentTimeline, AnimationTimeline)
+NS_IMPL_RELEASE_INHERITED(DocumentTimeline, AnimationTimeline)
 
 JSObject*
-AnimationTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+DocumentTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto);
+  return DocumentTimelineBinding::Wrap(aCx, this, aGivenProto);
 }
 
 Nullable<TimeDuration>
-AnimationTimeline::GetCurrentTime() const
+DocumentTimeline::GetCurrentTime() const
 {
   return ToTimelineTime(GetCurrentTimeStamp());
 }
 
-Nullable<double>
-AnimationTimeline::GetCurrentTimeAsDouble() const
-{
-  return AnimationUtils::TimeDurationToDouble(GetCurrentTime());
-}
-
 TimeStamp
-AnimationTimeline::GetCurrentTimeStamp() const
+DocumentTimeline::GetCurrentTimeStamp() const
 {
   nsRefreshDriver* refreshDriver = GetRefreshDriver();
   TimeStamp refreshTime = refreshDriver
                           ? refreshDriver->MostRecentRefresh()
                           : TimeStamp();
 
   // Always return the same object to benefit from return-value optimization.
   TimeStamp result = !refreshTime.IsNull()
@@ -67,47 +69,47 @@ AnimationTimeline::GetCurrentTimeStamp()
   if (!refreshTime.IsNull()) {
     mLastRefreshDriverTime = refreshTime;
   }
 
   return result;
 }
 
 Nullable<TimeDuration>
-AnimationTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
+DocumentTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
 {
   Nullable<TimeDuration> result; // Initializes to null
   if (aTimeStamp.IsNull()) {
     return result;
   }
 
   nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
   if (MOZ_UNLIKELY(!timing)) {
     return result;
   }
 
   result.SetValue(aTimeStamp - timing->GetNavigationStartTimeStamp());
   return result;
 }
 
 TimeStamp
-AnimationTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
+DocumentTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
 {
   TimeStamp result;
   nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
   if (MOZ_UNLIKELY(!timing)) {
     return result;
   }
 
   result = timing->GetNavigationStartTimeStamp() + aTimeDuration;
   return result;
 }
 
 nsRefreshDriver*
-AnimationTimeline::GetRefreshDriver() const
+DocumentTimeline::GetRefreshDriver() const
 {
   nsIPresShell* presShell = mDocument->GetShell();
   if (MOZ_UNLIKELY(!presShell)) {
     return nullptr;
   }
 
   nsPresContext* presContext = presShell->GetPresContext();
   if (MOZ_UNLIKELY(!presContext)) {
copy from dom/animation/AnimationTimeline.h
copy to dom/animation/DocumentTimeline.h
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/DocumentTimeline.h
@@ -1,59 +1,48 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_AnimationTimeline_h
-#define mozilla_dom_AnimationTimeline_h
+#ifndef mozilla_dom_DocumentTimeline_h
+#define mozilla_dom_DocumentTimeline_h
 
-#include "nsWrapperCache.h"
-#include "nsCycleCollectionParticipant.h"
-#include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h"
-#include "nsIGlobalObject.h"
-#include "js/TypeDecls.h"
+#include "AnimationTimeline.h"
 #include "nsIDocument.h"
 #include "nsRefreshDriver.h"
 
 struct JSContext;
 
 namespace mozilla {
 namespace dom {
 
-class AnimationTimeline final : public nsWrapperCache
+class DocumentTimeline final : public AnimationTimeline
 {
 public:
-  explicit AnimationTimeline(nsIDocument* aDocument)
-    : mDocument(aDocument)
-    , mWindow(aDocument->GetParentObject())
+  explicit DocumentTimeline(nsIDocument* aDocument)
+    : AnimationTimeline(aDocument->GetParentObject())
+    , mDocument(aDocument)
   {
-    MOZ_ASSERT(mWindow);
   }
 
 protected:
-  virtual ~AnimationTimeline() { }
+  virtual ~DocumentTimeline() { }
 
 public:
-  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationTimeline)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationTimeline)
+  NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(DocumentTimeline,
+                                                         AnimationTimeline)
 
-  nsIGlobalObject* GetParentObject() const
-  {
-    return mWindow;
-  }
-  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
+  virtual JSObject* WrapObject(JSContext* aCx,
+                               JS::Handle<JSObject*> aGivenProto) override;
 
-  // AnimationTimeline methods
-  Nullable<TimeDuration> GetCurrentTime() const;
-
-  // Wrapper functions for AnimationTimeline DOM methods when called from
-  // script.
-  Nullable<double> GetCurrentTimeAsDouble() const;
+  // DocumentTimeline methods
+  virtual Nullable<TimeDuration> GetCurrentTime() const override;
 
   // Converts a TimeStamp to the equivalent value in timeline time.
   // Note that when IsUnderTestControl() is true, there is no correspondence
   // between timeline time and wallclock time. In such a case, passing a
   // timestamp from TimeStamp::Now() to this method will not return a
   // meaningful result.
   Nullable<TimeDuration> ToTimelineTime(const TimeStamp& aTimeStamp) const;
   TimeStamp ToTimeStamp(const TimeDuration& aTimelineTime) const;
@@ -68,25 +57,20 @@ public:
   {
     nsRefreshDriver* refreshDriver = GetRefreshDriver();
     return refreshDriver && refreshDriver->IsTestControllingRefreshesEnabled();
   }
 
 protected:
   TimeStamp GetCurrentTimeStamp() const;
 
-  // Sometimes documents can be given a new window, or windows can be given a
-  // new document (e.g. document.open()). Since GetParentObject is required to
-  // _always_ return the same object it can't get the window from our
-  // mDocument, which is why we have pointers to both our document and window.
   nsCOMPtr<nsIDocument> mDocument;
-  nsCOMPtr<nsIGlobalObject> mWindow;
 
   // The most recently used refresh driver time. This is used in cases where
   // we don't have a refresh driver (e.g. because we are in a display:none
   // iframe).
   mutable TimeStamp mLastRefreshDriverTime;
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_AnimationTimeline_h
+#endif // mozilla_dom_DocumentTimeline_h
--- a/dom/animation/PendingPlayerTracker.cpp
+++ b/dom/animation/PendingPlayerTracker.cpp
@@ -1,16 +1,16 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PendingPlayerTracker.h"
 
-#include "mozilla/dom/AnimationTimeline.h"
+#include "mozilla/dom/DocumentTimeline.h"
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
 
 using namespace mozilla;
 
 namespace mozilla {
 
 NS_IMPL_CYCLE_COLLECTION(PendingPlayerTracker,
@@ -47,17 +47,17 @@ PendingPlayerTracker::IsWaiting(const do
   return aSet.Contains(const_cast<dom::AnimationPlayer*>(&aPlayer));
 }
 
 PLDHashOperator
 TriggerPlayerAtTime(nsRefPtrHashKey<dom::AnimationPlayer>* aKey,
                     void* aReadyTime)
 {
   dom::AnimationPlayer* player = aKey->GetKey();
-  dom::AnimationTimeline* timeline = player->Timeline();
+  dom::DocumentTimeline* timeline = player->Timeline();
 
   // When the timeline's refresh driver is under test control, its values
   // have no correspondance to wallclock times so we shouldn't try to convert
   // aReadyTime (which is a wallclock time) to a timeline value. Instead, the
   // animation player will be started/paused when the refresh driver is next
   // advanced since this will trigger a call to TriggerPendingPlayersNow.
   if (timeline->IsUnderTestControl()) {
     return PL_DHASH_NEXT;
--- a/dom/animation/moz.build
+++ b/dom/animation/moz.build
@@ -7,25 +7,28 @@
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 EXPORTS.mozilla.dom += [
     'Animation.h',
     'AnimationEffect.h',
     'AnimationPlayer.h',
     'AnimationTimeline.h',
+    'DocumentTimeline.h',
 ]
 
 EXPORTS.mozilla += [
+    'AnimationUtils.h',
     'PendingPlayerTracker.h',
 ]
 
 UNIFIED_SOURCES += [
     'Animation.cpp',
     'AnimationEffect.cpp',
     'AnimationPlayer.cpp',
     'AnimationTimeline.cpp',
+    'DocumentTimeline.cpp',
     'PendingPlayerTracker.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
 FINAL_LIBRARY = 'xul'
rename from dom/animation/test/animation-timeline/test_animation-timeline.html
rename to dom/animation/test/document-timeline/test_document-timeline.html
--- a/dom/animation/test/animation-timeline/test_animation-timeline.html
+++ b/dom/animation/test/document-timeline/test_document-timeline.html
@@ -1,11 +1,11 @@
 <!doctype html>
 <meta charset=utf-8>
-<title>Web Animations API: AnimationTimeline tests</title>
+<title>Web Animations API: DocumentTimeline tests</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <iframe src="data:text/html;charset=utf-8," width="10" height="10" id="iframe"></iframe>
 <iframe src="data:text/html;charset=utf-8,%3Chtml%20style%3D%22display%3Anone%22%3E%3C%2Fhtml%3E" width="10" height="10" id="hidden-iframe"></iframe>
 <script>
 'use strict';
 
rename from dom/animation/test/animation-timeline/test_request_animation_frame.html
rename to dom/animation/test/document-timeline/test_request_animation_frame.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -1,15 +1,12 @@
 [DEFAULT]
 support-files =
   testcommon.js
 
-[animation-timeline/test_animation-timeline.html]
-[animation-timeline/test_request_animation_frame.html]
-skip-if = buildapp == 'mulet'
 [css-animations/test_animations-dynamic-changes.html]
 [css-animations/test_animation-effect-name.html]
 [css-animations/test_animation-pausing.html]
 [css-animations/test_animation-player-currenttime.html]
 [css-animations/test_animation-player-finished.html]
 [css-animations/test_animation-player-playstate.html]
 [css-animations/test_animation-player-ready.html]
 [css-animations/test_animation-player-starttime.html]
@@ -19,9 +16,12 @@ skip-if = buildapp == 'mulet'
 [css-transitions/test_animation-effect-name.html]
 [css-transitions/test_animation-pausing.html]
 [css-transitions/test_animation-player-currenttime.html]
 [css-transitions/test_animation-player-ready.html]
 [css-transitions/test_animation-target.html]
 [css-transitions/test_animation-player-starttime.html]
 [css-transitions/test_element-get-animation-players.html]
 skip-if = buildapp == 'mulet'
+[document-timeline/test_document-timeline.html]
+[document-timeline/test_request_animation_frame.html]
+skip-if = buildapp == 'mulet'
 [mozilla/test_deferred_start.html]
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -181,19 +181,19 @@
 #include "mozilla/Preferences.h"
 
 #include "imgILoader.h"
 #include "imgRequestProxy.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsSandboxFlags.h"
 #include "nsIAppsService.h"
 #include "mozilla/dom/AnonymousContent.h"
-#include "mozilla/dom/AnimationTimeline.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/DocumentFragment.h"
+#include "mozilla/dom/DocumentTimeline.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/MediaQueryList.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/OwningNonNull.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/UndoManager.h"
@@ -2012,17 +2012,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnloadBlocker)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFirstBaseNodeWithHref)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOriginalDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedEncoder)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStateObjectCached)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mUndoManager)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnimationTimeline)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentTimeline)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPendingPlayerTracker)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTemplateContentsOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChildrenCollection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRegistry)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnonymousContents)
 
   // Traverse all our nsCOMArrays.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)
@@ -2096,17 +2096,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
   tmp->mCachedRootElement = nullptr; // Avoid a dangling pointer
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDisplayDocument)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mFirstBaseNodeWithHref)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mOriginalDocument)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mCachedEncoder)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mUndoManager)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnimationTimeline)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocumentTimeline)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPendingPlayerTracker)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTemplateContentsOwner)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mChildrenCollection)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mRegistry)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mMasterDocument)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mImportManager)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mSubImportLinks)
 
@@ -2298,17 +2298,17 @@ nsDocument::Reset(nsIChannel* aChannel, 
     }
   }
 
   ResetToURI(uri, aLoadGroup, principal);
 
   // Note that, since mTiming does not change during a reset, the
   // navigationStart time remains unchanged and therefore any future new
   // timeline will have the same global clock time as the old one.
-  mAnimationTimeline = nullptr;
+  mDocumentTimeline = nullptr;
 
   nsCOMPtr<nsIPropertyBag2> bag = do_QueryInterface(aChannel);
   if (bag) {
     nsCOMPtr<nsIURI> baseURI;
     bag->GetPropertyAsInterface(NS_LITERAL_STRING("baseURI"),
                                 NS_GET_IID(nsIURI), getter_AddRefs(baseURI));
     if (baseURI) {
       mDocumentBaseURI = baseURI;
@@ -3317,24 +3317,24 @@ bool
 nsDocument::IsWebAnimationsEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   return nsContentUtils::IsCallerChrome() ||
          Preferences::GetBool("dom.animations-api.core.enabled");
 }
 
-AnimationTimeline*
+DocumentTimeline*
 nsDocument::Timeline()
 {
-  if (!mAnimationTimeline) {
-    mAnimationTimeline = new AnimationTimeline(this);
-  }
-
-  return mAnimationTimeline;
+  if (!mDocumentTimeline) {
+    mDocumentTimeline = new DocumentTimeline(this);
+  }
+
+  return mDocumentTimeline;
 }
 
 /* Return true if the document is in the focused top-level window, and is an
  * ancestor of the focused DOMWindow. */
 NS_IMETHODIMP
 nsDocument::HasFocus(bool* aResult)
 {
   ErrorResult rv;
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -780,17 +780,17 @@ public:
                                                      nsStyleSet* aStyleSet) override;
   virtual void DeleteShell() override;
 
   virtual nsresult GetAllowPlugins(bool* aAllowPlugins) override;
 
   virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() override;
 
   static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
-  virtual mozilla::dom::AnimationTimeline* Timeline() override;
+  virtual mozilla::dom::DocumentTimeline* Timeline() override;
 
   virtual nsresult SetSubDocumentFor(Element* aContent,
                                      nsIDocument* aSubDoc) override;
   virtual nsIDocument* GetSubDocumentFor(nsIContent* aContent) const override;
   virtual Element* FindContentForSubDocument(nsIDocument *aDocument) const override;
   virtual Element* GetRootElementInternal() const override;
 
   virtual void EnsureOnDemandBuiltInUASheet(mozilla::CSSStyleSheet* aSheet) override;
@@ -1800,17 +1800,17 @@ private:
   // Tracking for images in the document.
   nsDataHashtable< nsPtrHashKey<imgIRequest>, uint32_t> mImageTracker;
 
   // Tracking for plugins in the document.
   nsTHashtable< nsPtrHashKey<nsIObjectLoadingContent> > mPlugins;
 
   nsRefPtr<mozilla::dom::UndoManager> mUndoManager;
 
-  nsRefPtr<mozilla::dom::AnimationTimeline> mAnimationTimeline;
+  nsRefPtr<mozilla::dom::DocumentTimeline> mDocumentTimeline;
 
   enum ViewportType {
     DisplayWidthHeight,
     DisplayWidthHeightNoZoom,
     Specified,
     Unknown
   };
 
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -96,24 +96,24 @@ class Loader;
 class ImageLoader;
 } // namespace css
 
 namespace gfx {
 class VRHMDInfo;
 } // namespace gfx
 
 namespace dom {
-class AnimationTimeline;
 class AnonymousContent;
 class Attr;
 class BoxObject;
 class CDATASection;
 class Comment;
 struct CustomElementDefinition;
 class DocumentFragment;
+class DocumentTimeline;
 class DocumentType;
 class DOMImplementation;
 class DOMStringList;
 class Element;
 struct ElementRegistrationOptions;
 class Event;
 class EventTarget;
 class FontFaceSet;
@@ -2082,17 +2082,17 @@ public:
    * elements set using mozSetImageElement have higher priority.
    * @param aId the ID associated the element we want to lookup
    * @return the element associated with |aId|
    */
   virtual Element* LookupImageElement(const nsAString& aElementId) = 0;
 
   virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() = 0;
 
-  virtual mozilla::dom::AnimationTimeline* Timeline() = 0;
+  virtual mozilla::dom::DocumentTimeline* Timeline() = 0;
 
   typedef mozilla::dom::CallbackObjectHolder<
     mozilla::dom::FrameRequestCallback,
     nsIFrameRequestCallback> FrameRequestCallbackHolder;
   nsresult ScheduleFrameRequestCallback(const FrameRequestCallbackHolder& aCallback,
                                         int32_t *aHandle);
   void CancelFrameRequestCallback(int32_t aHandle);
 
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -83,16 +83,20 @@ DOMInterfaces = {
 'MozAbortablePromise': {
     'nativeType': 'mozilla::dom::AbortablePromise',
 },
 
 'AbstractWorker': {
     'concrete': False
 },
 
+'AnimationTimeline': {
+    'concrete': False
+},
+
 'AnonymousContent': {
     'wrapperCache': False
 },
 
 'ArchiveReader': {
     'nativeType': 'mozilla::dom::archivereader::ArchiveReader',
 },
 
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -348,16 +348,18 @@ var interfaceNamesInGlobalScope =
     { name: "DeviceStorageChangeEvent", pref: "device.storage.enabled" },
     // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "DisplayPortInputPort", b2g: true, pref: "dom.inputport.enabled", permission: ["inputport"]},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Document",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "DocumentFragment",
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    {name: "DocumentTimeline", pref: "dom.animations-api.core.enabled"},
+// IMPORTANT: Do not change this list without review from a DOM peer!
     "DocumentType",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "DOMConstructor", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "DOMCursor",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "DOMError",
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/AnimationTimeline.webidl
+++ b/dom/webidl/AnimationTimeline.webidl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
- * http://dev.w3.org/fxtf/web-animations/#the-animationtimeline-interface
+ * https://w3c.github.io/web-animations/#animationtimeline
  *
- * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Func="nsDocument::IsWebAnimationsEnabled"]
 interface AnimationTimeline {
   [BinaryName="currentTimeAsDouble"]
   readonly attribute double? currentTime;
   // Not yet implemented:
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -287,20 +287,20 @@ partial interface Document {
   Element?  querySelector(DOMString selectors);
   [Throws, Pure]
   NodeList  querySelectorAll(DOMString selectors);
 
   //(Not implemented)Element?  find(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
   //(Not implemented)NodeList  findAll(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
 };
 
-// http://dev.w3.org/fxtf/web-animations/#extensions-to-the-document-interface
+// http://w3c.github.io/web-animations/#extensions-to-the-document-interface
 partial interface Document {
   [Func="nsDocument::IsWebAnimationsEnabled"]
-  readonly attribute AnimationTimeline timeline;
+  readonly attribute DocumentTimeline timeline;
 };
 
 //  Mozilla extensions of various sorts
 partial interface Document {
   // nsIDOMDocumentXBL.  Wish we could make these [ChromeOnly], but
   // that would likely break bindings running with the page principal.
   [Func="IsChromeOrXBL"]
   NodeList? getAnonymousNodes(Element elt);
new file mode 100644
--- /dev/null
+++ b/dom/webidl/DocumentTimeline.webidl
@@ -0,0 +1,17 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://w3c.github.io/web-animations/#documenttimeline
+ *
+ * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+// Not yet implemented:
+// [Constructor (DOMHighResTimeStamp originTime)]
+[Func="nsDocument::IsWebAnimationsEnabled"]
+interface DocumentTimeline : AnimationTimeline {
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -103,16 +103,17 @@ WEBIDL_FILES = [
     'DelayNode.webidl',
     'DesktopNotification.webidl',
     'DeviceMotionEvent.webidl',
     'DeviceStorage.webidl',
     'Directory.webidl',
     'DisplayPortInputPort.webidl',
     'Document.webidl',
     'DocumentFragment.webidl',
+    'DocumentTimeline.webidl',
     'DocumentType.webidl',
     'DOMCursor.webidl',
     'DOMError.webidl',
     'DOMException.webidl',
     'DOMImplementation.webidl',
     'DOMMatrix.webidl',
     'DOMMobileMessageError.webidl',
     'DOMParser.webidl',
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -285,17 +285,17 @@ nsAnimationManager::CheckAnimationRule(n
       disp->mAnimationNameCount == 1 &&
       disp->mAnimations[0].GetName().IsEmpty()) {
     return nullptr;
   }
 
   nsAutoAnimationMutationBatch mb(aElement);
 
   // build the animations list
-  dom::AnimationTimeline* timeline = aElement->OwnerDoc()->Timeline();
+  dom::DocumentTimeline* timeline = aElement->OwnerDoc()->Timeline();
   AnimationPlayerPtrArray newPlayers;
   if (!aStyleContext->IsInDisplayNoneSubtree()) {
     BuildAnimations(aStyleContext, aElement, timeline, newPlayers);
   }
 
   if (newPlayers.IsEmpty()) {
     if (collection) {
       // There might be transitions that run now that animations don't
@@ -482,17 +482,17 @@ ResolvedStyleCache::Get(nsPresContext *a
     result = resultStrong;
   }
   return result;
 }
 
 void
 nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
                                     dom::Element* aTarget,
-                                    dom::AnimationTimeline* aTimeline,
+                                    dom::DocumentTimeline* aTimeline,
                                     AnimationPlayerPtrArray& aPlayers)
 {
   MOZ_ASSERT(aPlayers.IsEmpty(), "expect empty array");
 
   ResolvedStyleCache resolvedStyles;
 
   const nsStyleDisplay *disp = aStyleContext->StyleDisplay();
 
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -50,17 +50,17 @@ struct AnimationEventInfo {
   }
 };
 
 typedef InfallibleTArray<AnimationEventInfo> EventArray;
 
 class CSSAnimationPlayer final : public dom::AnimationPlayer
 {
 public:
- explicit CSSAnimationPlayer(dom::AnimationTimeline* aTimeline)
+ explicit CSSAnimationPlayer(dom::DocumentTimeline* aTimeline)
     : dom::AnimationPlayer(aTimeline)
     , mIsStylePaused(false)
     , mPauseShouldStick(false)
     , mPreviousPhaseOrIteration(PREVIOUS_PHASE_BEFORE)
   {
   }
 
   virtual CSSAnimationPlayer*
@@ -232,17 +232,17 @@ protected:
   }
   virtual bool IsAnimationManager() override {
     return true;
   }
 
 private:
   void BuildAnimations(nsStyleContext* aStyleContext,
                        mozilla::dom::Element* aTarget,
-                       mozilla::dom::AnimationTimeline* aTimeline,
+                       mozilla::dom::DocumentTimeline* aTimeline,
                        mozilla::AnimationPlayerPtrArray& aAnimations);
   bool BuildSegment(InfallibleTArray<mozilla::AnimationPropertySegment>&
                       aSegments,
                     nsCSSProperty aProperty,
                     const mozilla::StyleAnimation& aAnimation,
                     float aFromKey, nsStyleContext* aFromContext,
                     mozilla::css::Declaration* aFromDeclaration,
                     float aToKey, nsStyleContext* aToContext);
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -393,17 +393,17 @@ nsTransitionManager::ConsiderStartingTra
     // http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html .
     return;
   }
 
   if (nsCSSProps::kAnimTypeTable[aProperty] == eStyleAnimType_None) {
     return;
   }
 
-  dom::AnimationTimeline* timeline = aElement->OwnerDoc()->Timeline();
+  dom::DocumentTimeline* timeline = aElement->OwnerDoc()->Timeline();
 
   StyleAnimationValue startValue, endValue, dummyValue;
   bool haveValues =
     ExtractComputedValueForTransition(aProperty, aOldStyleContext,
                                       startValue) &&
     ExtractComputedValueForTransition(aProperty, aNewStyleContext,
                                       endValue);
 
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -63,17 +63,17 @@ struct ElementPropertyTransition : publi
   // at the current time.  (The input to the transition timing function
   // has time units, the output has value units.)
   double CurrentValuePortion() const;
 };
 
 class CSSTransitionPlayer final : public dom::AnimationPlayer
 {
 public:
- explicit CSSTransitionPlayer(dom::AnimationTimeline* aTimeline)
+ explicit CSSTransitionPlayer(dom::DocumentTimeline* aTimeline)
     : dom::AnimationPlayer(aTimeline)
   {
   }
 
   virtual CSSTransitionPlayer*
   AsCSSTransitionPlayer() override { return this; }
 
   virtual dom::AnimationPlayState PlayStateFromJS() const override;