Bug 1521575 - Move nsSMILTimeValue classes and nsSMILInstanceTime to the mozilla namespace r=birtles
authorlongsonr <longsonr@gmail.com>
Tue, 22 Jan 2019 07:28:40 +0000
changeset 514814 d358a9083413cb023f6875a8432ead7bafa1f1d2
parent 514792 f83bdfcf0804d0e294fd41497208f92e418ad213
child 514815 2d921f6ce0a911d403a5fa9cabc3e9eabe24e645
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1521575
milestone66.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 1521575 - Move nsSMILTimeValue classes and nsSMILInstanceTime to the mozilla namespace r=birtles
dom/smil/SMILAnimationController.cpp
dom/smil/SMILAnimationFunction.cpp
dom/smil/SMILAnimationFunction.h
dom/smil/SMILInstanceTime.cpp
dom/smil/SMILInstanceTime.h
dom/smil/SMILInterval.cpp
dom/smil/SMILInterval.h
dom/smil/SMILParserUtils.cpp
dom/smil/SMILParserUtils.h
dom/smil/SMILRepeatCount.cpp
dom/smil/SMILTimeContainer.cpp
dom/smil/SMILTimeContainer.h
dom/smil/SMILTimeValue.cpp
dom/smil/SMILTimeValue.h
dom/smil/SMILTimeValueSpec.cpp
dom/smil/SMILTimeValueSpec.h
dom/smil/SMILTimeValueSpecParams.h
dom/smil/SMILTimedElement.cpp
dom/smil/SMILTimedElement.h
dom/smil/moz.build
dom/smil/nsSMILInstanceTime.cpp
dom/smil/nsSMILInstanceTime.h
dom/smil/nsSMILTimeValue.cpp
dom/smil/nsSMILTimeValue.h
dom/smil/nsSMILTimeValueSpec.cpp
dom/smil/nsSMILTimeValueSpec.h
dom/smil/nsSMILTimeValueSpecParams.h
dom/smil/nsSMILTypes.h
dom/svg/SVGAnimationElement.cpp
--- a/dom/smil/SMILAnimationController.cpp
+++ b/dom/smil/SMILAnimationController.cpp
@@ -516,17 +516,17 @@ void SMILAnimationController::DoMileston
       SVGAnimationElement* elem = elements[i].get();
       MOZ_ASSERT(elem, "nullptr animation element in list");
       SMILTimeContainer* container = elem->GetTimeContainer();
       if (!container)
         // The container may be nullptr if the element has been detached from
         // its parent since registering a milestone.
         continue;
 
-      nsSMILTimeValue containerTimeValue =
+      SMILTimeValue containerTimeValue =
           container->ParentToContainerTime(sampleTime);
       if (!containerTimeValue.IsDefinite()) continue;
 
       // Clamp the converted container time to non-negative values.
       nsSMILTime containerTime =
           std::max<nsSMILTime>(0, containerTimeValue.GetMillis());
 
       if (nextMilestone.mIsEnd) {
--- a/dom/smil/SMILAnimationFunction.cpp
+++ b/dom/smil/SMILAnimationFunction.cpp
@@ -126,17 +126,17 @@ bool SMILAnimationFunction::UnsetAttr(ns
   } else {
     foundMatch = false;
   }
 
   return foundMatch;
 }
 
 void SMILAnimationFunction::SampleAt(nsSMILTime aSampleTime,
-                                     const nsSMILTimeValue& aSimpleDuration,
+                                     const SMILTimeValue& aSimpleDuration,
                                      uint32_t aRepeatIteration) {
   // * Update mHasChanged ("Might this sample be different from prev one?")
   // Were we previously sampling a fill="freeze" final val? (We're not anymore.)
   mHasChanged |= mLastValue;
 
   // Are we sampling at a new point in simple duration? And does that matter?
   mHasChanged |=
       (mSampleTime != aSampleTime || mSimpleDuration != aSimpleDuration) &&
--- a/dom/smil/SMILAnimationFunction.h
+++ b/dom/smil/SMILAnimationFunction.h
@@ -2,22 +2,22 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 NS_SMILANIMATIONFUNCTION_H_
 #define NS_SMILANIMATIONFUNCTION_H_
 
+#include "mozilla/SMILKeySpline.h"
 #include "mozilla/SMILTargetIdentifier.h"
+#include "mozilla/SMILTimeValue.h"
 #include "nsAttrValue.h"
 #include "nsGkAtoms.h"
 #include "nsISMILAttr.h"
-#include "SMILKeySpline.h"
-#include "nsSMILTimeValue.h"
 #include "nsSMILTypes.h"
 #include "nsSMILValue.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 class SVGAnimationElement;
@@ -74,17 +74,17 @@ class SMILAnimationFunction {
    * Indicate a new sample has occurred.
    *
    * @param aSampleTime The sample time for this timed element expressed in
    *                    simple time.
    * @param aSimpleDuration The simple duration for this timed element.
    * @param aRepeatIteration  The repeat iteration for this sample. The first
    *                          iteration has a value of 0.
    */
-  void SampleAt(nsSMILTime aSampleTime, const nsSMILTimeValue& aSimpleDuration,
+  void SampleAt(nsSMILTime aSampleTime, const SMILTimeValue& aSimpleDuration,
                 uint32_t aRepeatIteration);
 
   /**
    * Indicate to sample using the last value defined for the animation function.
    * This value is not normally sampled due to the end-point exclusive timing
    * model but only occurs when the fill mode is "freeze" and the active
    * duration is an even multiple of the simple duration.
    *
@@ -404,17 +404,17 @@ class SMILAnimationFunction {
   FallibleTArray<SMILKeySpline> mKeySplines;
 
   // These are the parameters provided by the previous sample. Currently we
   // perform lazy calculation. That is, we only calculate the result if and when
   // instructed by the compositor. This allows us to apply the result directly
   // to the animation value and allows the compositor to filter out functions
   // that it determines will not contribute to the final result.
   nsSMILTime mSampleTime;  // sample time within simple dur
-  nsSMILTimeValue mSimpleDuration;
+  SMILTimeValue mSimpleDuration;
   uint32_t mRepeatIteration;
 
   nsSMILTime mBeginTime;  // document time
 
   // The owning animation element. This is used for sorting based on document
   // position and for fetching attribute values stored in the element.
   // Raw pointer is OK here, because this SMILAnimationFunction can't outlive
   // its owning animation element.
rename from dom/smil/nsSMILInstanceTime.cpp
rename to dom/smil/SMILInstanceTime.cpp
--- a/dom/smil/nsSMILInstanceTime.cpp
+++ b/dom/smil/SMILInstanceTime.cpp
@@ -1,27 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "nsSMILInstanceTime.h"
+#include "SMILInstanceTime.h"
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/SMILInterval.h"
-#include "nsSMILTimeValueSpec.h"
+#include "mozilla/SMILTimeValueSpec.h"
+
+namespace mozilla {
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSMILInstanceTime::nsSMILInstanceTime(const nsSMILTimeValue& aTime,
-                                       nsSMILInstanceTimeSource aSource,
-                                       nsSMILTimeValueSpec* aCreator,
-                                       SMILInterval* aBaseInterval)
+SMILInstanceTime::SMILInstanceTime(const SMILTimeValue& aTime,
+                                   SMILInstanceTimeSource aSource,
+                                   SMILTimeValueSpec* aCreator,
+                                   SMILInterval* aBaseInterval)
     : mTime(aTime),
       mFlags(0),
       mVisited(false),
       mFixedEndpointRefCnt(0),
       mSerial(0),
       mCreator(aCreator),
       mBaseInterval(nullptr)  // This will get set to aBaseInterval in a call to
                               // SetBaseInterval() at end of constructor
@@ -42,34 +44,34 @@ nsSMILInstanceTime::nsSMILInstanceTime(c
     case SOURCE_EVENT:
       mFlags = kDynamic;
       break;
   }
 
   SetBaseInterval(aBaseInterval);
 }
 
-nsSMILInstanceTime::~nsSMILInstanceTime() {
+SMILInstanceTime::~SMILInstanceTime() {
   MOZ_ASSERT(!mBaseInterval,
              "Destroying instance time without first calling Unlink()");
   MOZ_ASSERT(mFixedEndpointRefCnt == 0,
              "Destroying instance time that is still used as the fixed "
              "endpoint of an interval");
 }
 
-void nsSMILInstanceTime::Unlink() {
-  RefPtr<nsSMILInstanceTime> deathGrip(this);
+void SMILInstanceTime::Unlink() {
+  RefPtr<SMILInstanceTime> deathGrip(this);
   if (mBaseInterval) {
     mBaseInterval->RemoveDependentTime(*this);
     mBaseInterval = nullptr;
   }
   mCreator = nullptr;
 }
 
-void nsSMILInstanceTime::HandleChangedInterval(
+void SMILInstanceTime::HandleChangedInterval(
     const SMILTimeContainer* aSrcContainer, bool aBeginObjectChanged,
     bool aEndObjectChanged) {
   // It's possible a sequence of notifications might cause our base interval to
   // be updated and then deleted. Furthermore, the delete might happen whilst
   // we're still in the queue to be notified of the change. In any case, if we
   // don't have a base interval, just ignore the change.
   if (!mBaseInterval) return;
 
@@ -79,106 +81,108 @@ void nsSMILInstanceTime::HandleChangedIn
     // Break the cycle here
     Unlink();
     return;
   }
 
   bool objectChanged =
       mCreator->DependsOnBegin() ? aBeginObjectChanged : aEndObjectChanged;
 
-  RefPtr<nsSMILInstanceTime> deathGrip(this);
+  RefPtr<SMILInstanceTime> deathGrip(this);
   mozilla::AutoRestore<bool> setVisited(mVisited);
   mVisited = true;
 
   mCreator->HandleChangedInstanceTime(*GetBaseTime(), aSrcContainer, *this,
                                       objectChanged);
 }
 
-void nsSMILInstanceTime::HandleDeletedInterval() {
+void SMILInstanceTime::HandleDeletedInterval() {
   MOZ_ASSERT(mBaseInterval,
              "Got call to HandleDeletedInterval on an independent instance "
              "time");
   MOZ_ASSERT(mCreator, "Base interval is set but creator is not");
 
   mBaseInterval = nullptr;
   mFlags &= ~kMayUpdate;  // Can't update without a base interval
 
-  RefPtr<nsSMILInstanceTime> deathGrip(this);
+  RefPtr<SMILInstanceTime> deathGrip(this);
   mCreator->HandleDeletedInstanceTime(*this);
   mCreator = nullptr;
 }
 
-void nsSMILInstanceTime::HandleFilteredInterval() {
+void SMILInstanceTime::HandleFilteredInterval() {
   MOZ_ASSERT(mBaseInterval,
              "Got call to HandleFilteredInterval on an independent instance "
              "time");
 
   mBaseInterval = nullptr;
   mFlags &= ~kMayUpdate;  // Can't update without a base interval
   mCreator = nullptr;
 }
 
-bool nsSMILInstanceTime::ShouldPreserve() const {
+bool SMILInstanceTime::ShouldPreserve() const {
   return mFixedEndpointRefCnt > 0 || (mFlags & kWasDynamicEndpoint);
 }
 
-void nsSMILInstanceTime::UnmarkShouldPreserve() {
+void SMILInstanceTime::UnmarkShouldPreserve() {
   mFlags &= ~kWasDynamicEndpoint;
 }
 
-void nsSMILInstanceTime::AddRefFixedEndpoint() {
+void SMILInstanceTime::AddRefFixedEndpoint() {
   MOZ_ASSERT(mFixedEndpointRefCnt < UINT16_MAX,
              "Fixed endpoint reference count upper limit reached");
   ++mFixedEndpointRefCnt;
   mFlags &= ~kMayUpdate;  // Once fixed, always fixed
 }
 
-void nsSMILInstanceTime::ReleaseFixedEndpoint() {
+void SMILInstanceTime::ReleaseFixedEndpoint() {
   MOZ_ASSERT(mFixedEndpointRefCnt > 0, "Duplicate release");
   --mFixedEndpointRefCnt;
   if (mFixedEndpointRefCnt == 0 && IsDynamic()) {
     mFlags |= kWasDynamicEndpoint;
   }
 }
 
-bool nsSMILInstanceTime::IsDependentOn(const nsSMILInstanceTime& aOther) const {
+bool SMILInstanceTime::IsDependentOn(const SMILInstanceTime& aOther) const {
   if (mVisited) return false;
 
-  const nsSMILInstanceTime* myBaseTime = GetBaseTime();
+  const SMILInstanceTime* myBaseTime = GetBaseTime();
   if (!myBaseTime) return false;
 
   if (myBaseTime == &aOther) return true;
 
   mozilla::AutoRestore<bool> setVisited(mVisited);
   mVisited = true;
   return myBaseTime->IsDependentOn(aOther);
 }
 
-const nsSMILInstanceTime* nsSMILInstanceTime::GetBaseTime() const {
+const SMILInstanceTime* SMILInstanceTime::GetBaseTime() const {
   if (!mBaseInterval) {
     return nullptr;
   }
 
   MOZ_ASSERT(mCreator, "Base interval is set but there is no creator.");
   if (!mCreator) {
     return nullptr;
   }
 
   return mCreator->DependsOnBegin() ? mBaseInterval->Begin()
                                     : mBaseInterval->End();
 }
 
-void nsSMILInstanceTime::SetBaseInterval(SMILInterval* aBaseInterval) {
+void SMILInstanceTime::SetBaseInterval(SMILInterval* aBaseInterval) {
   MOZ_ASSERT(!mBaseInterval,
              "Attempting to reassociate an instance time with a different "
              "interval.");
 
   if (aBaseInterval) {
     MOZ_ASSERT(mCreator,
                "Attempting to create a dependent instance time without "
-               "reference to the creating nsSMILTimeValueSpec object.");
+               "reference to the creating SMILTimeValueSpec object.");
     if (!mCreator) return;
 
     aBaseInterval->AddDependentTime(*this);
   }
 
   mBaseInterval = aBaseInterval;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILInstanceTime.h
rename to dom/smil/SMILInstanceTime.h
--- a/dom/smil/nsSMILInstanceTime.h
+++ b/dom/smil/SMILInstanceTime.h
@@ -3,137 +3,132 @@
 /* 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 NS_SMILINSTANCETIME_H_
 #define NS_SMILINSTANCETIME_H_
 
 #include "nsISupportsImpl.h"
-#include "nsSMILTimeValue.h"
-
-class nsSMILTimeValueSpec;
+#include "mozilla/SMILTimeValue.h"
 
 namespace mozilla {
 class SMILInterval;
 class SMILTimeContainer;
-}
+class SMILTimeValueSpec;
 
 //----------------------------------------------------------------------
-// nsSMILInstanceTime
+// SMILInstanceTime
 //
 // An instant in document simple time that may be used in creating a new
 // interval.
 //
 // For an overview of how this class is related to other SMIL time classes see
-// the documentation in nsSMILTimeValue.h
+// the documentation in SMILTimeValue.h
 //
 // These objects are owned by an SMILTimedElement but MAY also be referenced
 // by:
 //
 // a) SMILIntervals that belong to the same SMILTimedElement and which refer
-//    to the nsSMILInstanceTimes which form the interval endpoints; and/or
+//    to the SMILInstanceTimes which form the interval endpoints; and/or
 // b) SMILIntervals that belong to other SMILTimedElements but which need to
 //    update dependent instance times when they change or are deleted.
 //    E.g. for begin='a.begin', 'a' needs to inform dependent
-//    nsSMILInstanceTimes if its begin time changes. This notification is
+//    SMILInstanceTimes if its begin time changes. This notification is
 //    performed by the SMILInterval.
 
-class nsSMILInstanceTime final {
-  typedef mozilla::SMILInterval SMILInterval;
-  typedef mozilla::SMILTimeContainer SMILTimeContainer;
-
+class SMILInstanceTime final {
  public:
   // Instance time source. Times generated by events, syncbase relationships,
   // and DOM calls behave differently in some circumstances such as when a timed
   // element is reset.
-  enum nsSMILInstanceTimeSource {
+  enum SMILInstanceTimeSource {
     // No particularly significant source, e.g. offset time, 'indefinite'
     SOURCE_NONE,
     // Generated by a DOM call such as beginElement
     SOURCE_DOM,
     // Generated by a syncbase relationship
     SOURCE_SYNCBASE,
     // Generated by an event
     SOURCE_EVENT
   };
 
-  explicit nsSMILInstanceTime(const nsSMILTimeValue& aTime,
-                              nsSMILInstanceTimeSource aSource = SOURCE_NONE,
-                              nsSMILTimeValueSpec* aCreator = nullptr,
-                              SMILInterval* aBaseInterval = nullptr);
+  explicit SMILInstanceTime(const SMILTimeValue& aTime,
+                            SMILInstanceTimeSource aSource = SOURCE_NONE,
+                            SMILTimeValueSpec* aCreator = nullptr,
+                            SMILInterval* aBaseInterval = nullptr);
 
   void Unlink();
   void HandleChangedInterval(const SMILTimeContainer* aSrcContainer,
                              bool aBeginObjectChanged, bool aEndObjectChanged);
   void HandleDeletedInterval();
   void HandleFilteredInterval();
 
-  const nsSMILTimeValue& Time() const { return mTime; }
-  const nsSMILTimeValueSpec* GetCreator() const { return mCreator; }
+  const SMILTimeValue& Time() const { return mTime; }
+  const SMILTimeValueSpec* GetCreator() const { return mCreator; }
 
   bool IsDynamic() const { return !!(mFlags & kDynamic); }
   bool IsFixedTime() const { return !(mFlags & kMayUpdate); }
   bool FromDOM() const { return !!(mFlags & kFromDOM); }
 
   bool ShouldPreserve() const;
   void UnmarkShouldPreserve();
 
   void AddRefFixedEndpoint();
   void ReleaseFixedEndpoint();
 
-  void DependentUpdate(const nsSMILTimeValue& aNewTime) {
+  void DependentUpdate(const SMILTimeValue& aNewTime) {
     MOZ_ASSERT(!IsFixedTime(),
                "Updating an instance time that is not expected to be updated");
     mTime = aNewTime;
   }
 
   bool IsDependent() const { return !!mBaseInterval; }
-  bool IsDependentOn(const nsSMILInstanceTime& aOther) const;
+  bool IsDependentOn(const SMILInstanceTime& aOther) const;
   const SMILInterval* GetBaseInterval() const { return mBaseInterval; }
-  const nsSMILInstanceTime* GetBaseTime() const;
+  const SMILInstanceTime* GetBaseTime() const;
 
-  bool SameTimeAndBase(const nsSMILInstanceTime& aOther) const {
+  bool SameTimeAndBase(const SMILInstanceTime& aOther) const {
     return mTime == aOther.mTime && GetBaseTime() == aOther.GetBaseTime();
   }
 
   // Get and set a serial number which may be used by a containing class to
   // control the sort order of otherwise similar instance times.
   uint32_t Serial() const { return mSerial; }
   void SetSerial(uint32_t aIndex) { mSerial = aIndex; }
 
-  NS_INLINE_DECL_REFCOUNTING(nsSMILInstanceTime)
+  NS_INLINE_DECL_REFCOUNTING(SMILInstanceTime)
 
  private:
   // Private destructor, to discourage deletion outside of Release():
-  ~nsSMILInstanceTime();
+  ~SMILInstanceTime();
 
   void SetBaseInterval(SMILInterval* aBaseInterval);
 
-  nsSMILTimeValue mTime;
+  SMILTimeValue mTime;
 
   // Internal flags used to represent the behaviour of different instance times
   enum {
     // Indicates that this instance time was generated by an event or a DOM
     // call. Such instance times require special handling when (i) the owning
     // element is reset, (ii) when they are to be added as a new end instance
     // times (as per SMIL's event sensitivity contraints), and (iii) when
     // a backwards seek is performed and the timing model is reconstructed.
     kDynamic = 1,
 
     // Indicates that this instance time is referred to by an
-    // nsSMILTimeValueSpec and as such may be updated. Such instance time should
+    // SMILTimeValueSpec and as such may be updated. Such instance time should
     // not be filtered out by the SMILTimedElement even if they appear to be
     // in the past as they may be updated to a future time.
     kMayUpdate = 2,
 
     // Indicates that this instance time was generated from the DOM as opposed
-    // to an nsSMILTimeValueSpec. When a 'begin' or 'end' attribute is set or
+    // to an SMILTimeValueSpec. When a 'begin' or 'end' attribute is set or
     // reset we should clear all the instance times that have been generated by
-    // that attribute (and hence an nsSMILTimeValueSpec), but not those from the
+    // that attribute (and hence an SMILTimeValueSpec), but not those from the
     // DOM.
     kFromDOM = 4,
 
     // Indicates that this instance time was used as the endpoint of an interval
     // that has been filtered or removed. However, since it is a dynamic time it
     // should be preserved and not filtered.
     kWasDynamicEndpoint = 8
   };
@@ -154,16 +149,18 @@ class nsSMILInstanceTime final {
   // d) trimmed intervals
   // Hence the limited range of a uint16_t should be more than adequate.
   uint16_t mFixedEndpointRefCnt;
 
   uint32_t mSerial;  // A serial number used by the containing class to
                      // specify the sort order for instance times with the
                      // same mTime.
 
-  nsSMILTimeValueSpec* mCreator;  // The nsSMILTimeValueSpec object that created
-                                  // us. (currently only needed for syncbase
-                                  // instance times.)
-  SMILInterval* mBaseInterval;    // Interval from which this time is derived
-                                  // (only used for syncbase instance times)
+  SMILTimeValueSpec* mCreator;  // The SMILTimeValueSpec object that created
+                                // us. (currently only needed for syncbase
+                                // instance times.)
+  SMILInterval* mBaseInterval;  // Interval from which this time is derived
+                                // (only used for syncbase instance times)
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILINSTANCETIME_H_
--- a/dom/smil/SMILInterval.cpp
+++ b/dom/smil/SMILInterval.cpp
@@ -47,41 +47,41 @@ void SMILInterval::Unlink(bool aFiltered
   }
   mBegin = nullptr;
   if (mEnd && mEndFixed) {
     mEnd->ReleaseFixedEndpoint();
   }
   mEnd = nullptr;
 }
 
-nsSMILInstanceTime* SMILInterval::Begin() {
+SMILInstanceTime* SMILInterval::Begin() {
   MOZ_ASSERT(mBegin && mEnd, "Requesting Begin() on un-initialized interval.");
   return mBegin;
 }
 
-nsSMILInstanceTime* SMILInterval::End() {
+SMILInstanceTime* SMILInterval::End() {
   MOZ_ASSERT(mBegin && mEnd, "Requesting End() on un-initialized interval.");
   return mEnd;
 }
 
-void SMILInterval::SetBegin(nsSMILInstanceTime& aBegin) {
+void SMILInterval::SetBegin(SMILInstanceTime& aBegin) {
   MOZ_ASSERT(aBegin.Time().IsDefinite(),
              "Attempt to set unresolved or indefinite begin time on interval");
   MOZ_ASSERT(!mBeginFixed,
              "Attempt to set begin time but the begin point is fixed");
   // Check that we're not making an instance time dependent on itself. Such an
   // arrangement does not make intuitive sense and should be detected when
   // creating or updating intervals.
   MOZ_ASSERT(!mBegin || aBegin.GetBaseTime() != mBegin,
              "Attempt to make self-dependent instance time");
 
   mBegin = &aBegin;
 }
 
-void SMILInterval::SetEnd(nsSMILInstanceTime& aEnd) {
+void SMILInterval::SetEnd(SMILInstanceTime& aEnd) {
   MOZ_ASSERT(!mEndFixed, "Attempt to set end time but the end point is fixed");
   // As with SetBegin, check we're not making an instance time dependent on
   // itself.
   MOZ_ASSERT(!mEnd || aEnd.GetBaseTime() != mEnd,
              "Attempting to make self-dependent instance time");
 
   mEnd = &aEnd;
 }
@@ -97,25 +97,25 @@ void SMILInterval::FixEnd() {
   MOZ_ASSERT(mBegin && mEnd, "Fixing end point on un-initialized interval");
   MOZ_ASSERT(mBeginFixed,
              "Fixing the end of an interval without a fixed begin");
   MOZ_ASSERT(!mEndFixed, "Duplicate calls to FixEnd()");
   mEndFixed = true;
   mEnd->AddRefFixedEndpoint();
 }
 
-void SMILInterval::AddDependentTime(nsSMILInstanceTime& aTime) {
-  RefPtr<nsSMILInstanceTime>* inserted =
+void SMILInterval::AddDependentTime(SMILInstanceTime& aTime) {
+  RefPtr<SMILInstanceTime>* inserted =
       mDependentTimes.InsertElementSorted(&aTime);
   if (!inserted) {
     NS_WARNING("Insufficient memory to insert instance time.");
   }
 }
 
-void SMILInterval::RemoveDependentTime(const nsSMILInstanceTime& aTime) {
+void SMILInterval::RemoveDependentTime(const SMILInstanceTime& aTime) {
 #ifdef DEBUG
   bool found =
 #endif
       mDependentTimes.RemoveElementSorted(&aTime);
   MOZ_ASSERT(found, "Couldn't find instance time to delete.");
 }
 
 void SMILInterval::GetDependentTimes(InstanceTimeList& aTimes) {
--- a/dom/smil/SMILInterval.h
+++ b/dom/smil/SMILInterval.h
@@ -2,85 +2,85 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 NS_SMILINTERVAL_H_
 #define NS_SMILINTERVAL_H_
 
-#include "nsSMILInstanceTime.h"
+#include "mozilla/SMILInstanceTime.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 
 //----------------------------------------------------------------------
 // SMILInterval class
 //
 // A structure consisting of a begin and end time. The begin time must be
 // resolved (i.e. not indefinite or unresolved).
 //
 // For an overview of how this class is related to other SMIL time classes see
-// the documentation in nsSMILTimeValue.h
+// the documentation in SMILTimeValue.h
 
 class SMILInterval {
  public:
   SMILInterval();
   SMILInterval(const SMILInterval& aOther);
   ~SMILInterval();
   void Unlink(bool aFiltered = false);
 
-  const nsSMILInstanceTime* Begin() const {
+  const SMILInstanceTime* Begin() const {
     MOZ_ASSERT(mBegin && mEnd,
                "Requesting Begin() on un-initialized instance time");
     return mBegin;
   }
-  nsSMILInstanceTime* Begin();
+  SMILInstanceTime* Begin();
 
-  const nsSMILInstanceTime* End() const {
+  const SMILInstanceTime* End() const {
     MOZ_ASSERT(mBegin && mEnd,
                "Requesting End() on un-initialized instance time");
     return mEnd;
   }
-  nsSMILInstanceTime* End();
+  SMILInstanceTime* End();
 
-  void SetBegin(nsSMILInstanceTime& aBegin);
-  void SetEnd(nsSMILInstanceTime& aEnd);
-  void Set(nsSMILInstanceTime& aBegin, nsSMILInstanceTime& aEnd) {
+  void SetBegin(SMILInstanceTime& aBegin);
+  void SetEnd(SMILInstanceTime& aEnd);
+  void Set(SMILInstanceTime& aBegin, SMILInstanceTime& aEnd) {
     SetBegin(aBegin);
     SetEnd(aEnd);
   }
 
   void FixBegin();
   void FixEnd();
 
-  typedef nsTArray<RefPtr<nsSMILInstanceTime> > InstanceTimeList;
+  typedef nsTArray<RefPtr<SMILInstanceTime> > InstanceTimeList;
 
-  void AddDependentTime(nsSMILInstanceTime& aTime);
-  void RemoveDependentTime(const nsSMILInstanceTime& aTime);
+  void AddDependentTime(SMILInstanceTime& aTime);
+  void RemoveDependentTime(const SMILInstanceTime& aTime);
   void GetDependentTimes(InstanceTimeList& aTimes);
 
   // Cue for assessing if this interval can be filtered
   bool IsDependencyChainLink() const;
 
  private:
-  RefPtr<nsSMILInstanceTime> mBegin;
-  RefPtr<nsSMILInstanceTime> mEnd;
+  RefPtr<SMILInstanceTime> mBegin;
+  RefPtr<SMILInstanceTime> mEnd;
 
-  // nsSMILInstanceTimes to notify when this interval is changed or deleted.
+  // SMILInstanceTimes to notify when this interval is changed or deleted.
   InstanceTimeList mDependentTimes;
 
   // Indicates if the end points of the interval are fixed or not.
   //
   // Note that this is not the same as having an end point whose TIME is fixed
-  // (i.e. nsSMILInstanceTime::IsFixed() returns true). This is because it is
+  // (i.e. SMILInstanceTime::IsFixed() returns true). This is because it is
   // possible to have an end point with a fixed TIME and yet still update the
-  // end point to refer to a different nsSMILInstanceTime object.
+  // end point to refer to a different SMILInstanceTime object.
   //
-  // However, if mBegin/EndFixed is true, then BOTH the nsSMILInstanceTime
+  // However, if mBegin/EndFixed is true, then BOTH the SMILInstanceTime
   // OBJECT returned for that end point and its TIME value will not change.
   bool mBeginFixed;
   bool mEndFixed;
 };
 
 }  // namespace mozilla
 
 #endif  // NS_SMILINTERVAL_H_
--- a/dom/smil/SMILParserUtils.cpp
+++ b/dom/smil/SMILParserUtils.cpp
@@ -3,22 +3,22 @@
 /* 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 "SMILParserUtils.h"
 
 #include "mozilla/SMILKeySpline.h"
 #include "mozilla/SMILRepeatCount.h"
+#include "mozilla/SMILTimeValue.h"
+#include "mozilla/SMILTimeValueSpecParams.h"
 #include "mozilla/SVGContentUtils.h"
 #include "mozilla/TextUtils.h"
 #include "nsISMILAttr.h"
 #include "nsSMILValue.h"
-#include "nsSMILTimeValue.h"
-#include "nsSMILTimeValueSpecParams.h"
 #include "nsSMILTypes.h"
 #include "nsContentUtils.h"
 #include "nsCharSeparatedTokenizer.h"
 
 using namespace mozilla::dom;
 //------------------------------------------------------------------------------
 // Helper functions and Constants
 
@@ -123,17 +123,17 @@ inline bool ParseClockMetric(RangedPtr<c
   return false;
 }
 
 /**
  * See http://www.w3.org/TR/SVG/animate.html#ClockValueSyntax
  */
 bool ParseClockValue(RangedPtr<const char16_t>& aIter,
                      const RangedPtr<const char16_t>& aEnd,
-                     nsSMILTimeValue* aResult) {
+                     SMILTimeValue* aResult) {
   if (aIter == aEnd) {
     return false;
   }
 
   // TIMECOUNT_VALUE     ::= Timecount ("." Fraction)? (Metric)?
   // PARTIAL_CLOCK_VALUE ::= Minutes ":" Seconds ("." Fraction)?
   // FULL_CLOCK_VALUE    ::= Hours ":" Minutes ":" Seconds ("." Fraction)?
   enum ClockType { TIMECOUNT_VALUE, PARTIAL_CLOCK_VALUE, FULL_CLOCK_VALUE };
@@ -208,41 +208,41 @@ bool ParseClockValue(RangedPtr<const cha
       return true;
   }
 
   return false;
 }
 
 bool ParseOffsetValue(RangedPtr<const char16_t>& aIter,
                       const RangedPtr<const char16_t>& aEnd,
-                      nsSMILTimeValue* aResult) {
+                      SMILTimeValue* aResult) {
   RangedPtr<const char16_t> iter(aIter);
 
   int32_t sign;
   if (!SVGContentUtils::ParseOptionalSign(iter, aEnd, sign) ||
       !SkipWhitespace(iter, aEnd) || !ParseClockValue(iter, aEnd, aResult)) {
     return false;
   }
   if (sign == -1) {
     aResult->SetMillis(-aResult->GetMillis());
   }
   aIter = iter;
   return true;
 }
 
-bool ParseOffsetValue(const nsAString& aSpec, nsSMILTimeValue* aResult) {
+bool ParseOffsetValue(const nsAString& aSpec, SMILTimeValue* aResult) {
   RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
   const RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   return ParseOffsetValue(iter, end, aResult) && iter == end;
 }
 
 bool ParseOptionalOffset(RangedPtr<const char16_t>& aIter,
                          const RangedPtr<const char16_t>& aEnd,
-                         nsSMILTimeValue* aResult) {
+                         SMILTimeValue* aResult) {
   if (aIter == aEnd) {
     aResult->SetMillis(0L);
     return true;
   }
 
   return SkipWhitespace(aIter, aEnd) && ParseOffsetValue(aIter, aEnd, aResult);
 }
 
@@ -302,18 +302,18 @@ already_AddRefed<nsAtom> ConvertTokenToA
     }
   }
   token.Truncate(write - token.BeginReading());
 
   return ConvertUnescapedTokenToAtom(token);
 }
 
 bool ParseElementBaseTimeValueSpec(const nsAString& aSpec,
-                                   nsSMILTimeValueSpecParams& aResult) {
-  nsSMILTimeValueSpecParams result;
+                                   SMILTimeValueSpecParams& aResult) {
+  SMILTimeValueSpecParams result;
 
   //
   // The spec will probably look something like one of these
   //
   // element-name.begin
   // element-name.event-name
   // event-name
   // element-name.repeat(3)
@@ -348,47 +348,47 @@ bool ParseElementBaseTimeValueSpec(const
     ++tokenEnd;
     start = tokenEnd;
     MoveToNextToken(tokenEnd, end, false, requiresUnescaping);
 
     const nsAString& token2 = Substring(start.get(), tokenEnd.get());
 
     // element-name.begin
     if (token2.EqualsLiteral("begin")) {
-      result.mType = nsSMILTimeValueSpecParams::SYNCBASE;
+      result.mType = SMILTimeValueSpecParams::SYNCBASE;
       result.mSyncBegin = true;
       // element-name.end
     } else if (token2.EqualsLiteral("end")) {
-      result.mType = nsSMILTimeValueSpecParams::SYNCBASE;
+      result.mType = SMILTimeValueSpecParams::SYNCBASE;
       result.mSyncBegin = false;
       // element-name.repeat(digit+)
     } else if (StringBeginsWith(token2, REPEAT_PREFIX)) {
       start += REPEAT_PREFIX.Length();
       int32_t repeatValue;
       if (start == tokenEnd || *start == '+' || *start == '-' ||
           !SVGContentUtils::ParseInteger(start, tokenEnd, repeatValue)) {
         return false;
       }
       if (start == tokenEnd || *start != ')') {
         return false;
       }
-      result.mType = nsSMILTimeValueSpecParams::REPEAT;
+      result.mType = SMILTimeValueSpecParams::REPEAT;
       result.mRepeatIteration = repeatValue;
       // element-name.event-symbol
     } else {
       atom = ConvertTokenToAtom(token2, requiresUnescaping);
       if (atom == nullptr) {
         return false;
       }
-      result.mType = nsSMILTimeValueSpecParams::EVENT;
+      result.mType = SMILTimeValueSpecParams::EVENT;
       result.mEventSymbol = atom;
     }
   } else {
     // event-symbol
-    result.mType = nsSMILTimeValueSpecParams::EVENT;
+    result.mType = SMILTimeValueSpecParams::EVENT;
     result.mEventSymbol = atom;
   }
 
   // We've reached the end of the token, so we should now be either looking at
   // a '+', '-' (possibly with whitespace before it), or the end.
   if (!ParseOptionalOffset(tokenEnd, end, &result.mOffset) || tokenEnd != end) {
     return false;
   }
@@ -564,27 +564,27 @@ bool SMILParserUtils::ParseRepeatCount(c
   if (!SVGContentUtils::ParseNumber(spec, value) || value <= 0.0) {
     return false;
   }
   aResult = value;
   return true;
 }
 
 bool SMILParserUtils::ParseTimeValueSpecParams(
-    const nsAString& aSpec, nsSMILTimeValueSpecParams& aResult) {
+    const nsAString& aSpec, SMILTimeValueSpecParams& aResult) {
   const nsAString& spec = TrimWhitespace(aSpec);
 
   if (spec.EqualsLiteral("indefinite")) {
-    aResult.mType = nsSMILTimeValueSpecParams::INDEFINITE;
+    aResult.mType = SMILTimeValueSpecParams::INDEFINITE;
     return true;
   }
 
   // offset type
   if (ParseOffsetValue(spec, &aResult.mOffset)) {
-    aResult.mType = nsSMILTimeValueSpecParams::OFFSET;
+    aResult.mType = SMILTimeValueSpecParams::OFFSET;
     return true;
   }
 
   // wallclock type
   if (StringBeginsWith(spec, WALLCLOCK_PREFIX)) {
     return false;  // Wallclock times not implemented
   }
 
@@ -594,17 +594,17 @@ bool SMILParserUtils::ParseTimeValueSpec
     return false;  // accesskey is not supported
   }
 
   // event, syncbase, or repeat
   return ParseElementBaseTimeValueSpec(spec, aResult);
 }
 
 bool SMILParserUtils::ParseClockValue(const nsAString& aSpec,
-                                      nsSMILTimeValue* aResult) {
+                                      SMILTimeValue* aResult) {
   RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
   RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   return ::ParseClockValue(iter, end, aResult) && iter == end;
 }
 
 int32_t SMILParserUtils::CheckForNegativeNumber(const nsAString& aStr) {
   int32_t absValLocation = -1;
--- a/dom/smil/SMILParserUtils.h
+++ b/dom/smil/SMILParserUtils.h
@@ -6,23 +6,23 @@
 
 #ifndef NS_SMILPARSERUTILS_H_
 #define NS_SMILPARSERUTILS_H_
 
 #include "nsTArray.h"
 #include "nsStringFwd.h"
 
 class nsISMILAttr;
-class nsSMILTimeValue;
 class nsSMILValue;
-class nsSMILTimeValueSpecParams;
 
 namespace mozilla {
 class SMILKeySpline;
 class SMILRepeatCount;
+class SMILTimeValue;
+class SMILTimeValueSpecParams;
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 /**
  * Common parsing utilities for the SMIL module. There is little re-use here; it
  * simply serves to simplify other classes by moving parsing outside and to aid
  * unit testing.
@@ -55,28 +55,28 @@ class SMILParserUtils {
   // element's "values" list.
   static bool ParseValuesGeneric(const nsAString& aSpec,
                                  GenericValueParser& aParser);
 
   static bool ParseRepeatCount(const nsAString& aSpec,
                                SMILRepeatCount& aResult);
 
   static bool ParseTimeValueSpecParams(const nsAString& aSpec,
-                                       nsSMILTimeValueSpecParams& aResult);
+                                       SMILTimeValueSpecParams& aResult);
 
   /*
    * Parses a clock value as defined in the SMIL Animation specification.
    * If parsing succeeds the returned value will be a non-negative, definite
    * time value i.e. IsDefinite will return true.
    *
    * @param aSpec    The string containing a clock value, e.g. "10s"
    * @param aResult  The parsed result. [OUT]
    * @return true if parsing succeeded, otherwise false.
    */
-  static bool ParseClockValue(const nsAString& aSpec, nsSMILTimeValue* aResult);
+  static bool ParseClockValue(const nsAString& aSpec, SMILTimeValue* aResult);
 
   /*
    * This method checks whether the given string looks like a negative number.
    * Specifically, it checks whether the string looks matches the pattern
    * "[whitespace]*-[numeral].*" If the string matches this pattern, this
    * method returns the index of the first character after the '-' sign
    * (i.e. the index of the absolute value).  If not, this method returns -1.
    */
--- a/dom/smil/SMILRepeatCount.cpp
+++ b/dom/smil/SMILRepeatCount.cpp
@@ -7,9 +7,8 @@
 #include "SMILRepeatCount.h"
 
 namespace mozilla {
 
 /*static*/ const double SMILRepeatCount::kNotSet = -1.0;
 /*static*/ const double SMILRepeatCount::kIndefinite = -2.0;
 
 }  // namespace mozilla
-
--- a/dom/smil/SMILTimeContainer.cpp
+++ b/dom/smil/SMILTimeContainer.cpp
@@ -3,17 +3,17 @@
 /* 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 "SMILTimeContainer.h"
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/SMILTimedElement.h"
-#include "nsSMILTimeValue.h"
+#include "mozilla/SMILTimeValue.h"
 #include <algorithm>
 
 namespace mozilla {
 
 SMILTimeContainer::SMILTimeContainer()
     : mParent(nullptr),
       mCurrentTime(0L),
       mParentOffset(0L),
@@ -28,32 +28,32 @@ SMILTimeContainer::SMILTimeContainer()
 }
 
 SMILTimeContainer::~SMILTimeContainer() {
   if (mParent) {
     mParent->RemoveChild(*this);
   }
 }
 
-nsSMILTimeValue SMILTimeContainer::ContainerToParentTime(
+SMILTimeValue SMILTimeContainer::ContainerToParentTime(
     nsSMILTime aContainerTime) const {
   // If we're paused, then future times are indefinite
   if (IsPaused() && aContainerTime > mCurrentTime)
-    return nsSMILTimeValue::Indefinite();
+    return SMILTimeValue::Indefinite();
 
-  return nsSMILTimeValue(aContainerTime + mParentOffset);
+  return SMILTimeValue(aContainerTime + mParentOffset);
 }
 
-nsSMILTimeValue SMILTimeContainer::ParentToContainerTime(
+SMILTimeValue SMILTimeContainer::ParentToContainerTime(
     nsSMILTime aParentTime) const {
   // If we're paused, then any time after when we paused is indefinite
   if (IsPaused() && aParentTime > mPauseStart)
-    return nsSMILTimeValue::Indefinite();
+    return SMILTimeValue::Indefinite();
 
-  return nsSMILTimeValue(aParentTime - mParentOffset);
+  return SMILTimeValue(aParentTime - mParentOffset);
 }
 
 void SMILTimeContainer::Begin() {
   Resume(PAUSE_BEGIN);
   if (mPauseState) {
     mNeedsPauseSample = true;
   }
 
@@ -200,31 +200,31 @@ void SMILTimeContainer::ClearMilestones(
   MOZ_ASSERT(!mHoldingEntries);
   mMilestoneEntries.Clear();
 }
 
 bool SMILTimeContainer::GetNextMilestoneInParentTime(
     SMILMilestone& aNextMilestone) const {
   if (mMilestoneEntries.IsEmpty()) return false;
 
-  nsSMILTimeValue parentTime =
+  SMILTimeValue parentTime =
       ContainerToParentTime(mMilestoneEntries.Top().mMilestone.mTime);
   if (!parentTime.IsDefinite()) return false;
 
   aNextMilestone = SMILMilestone(parentTime.GetMillis(),
                                  mMilestoneEntries.Top().mMilestone.mIsEnd);
 
   return true;
 }
 
 bool SMILTimeContainer::PopMilestoneElementsAtMilestone(
     const SMILMilestone& aMilestone, AnimElemArray& aMatchedElements) {
   if (mMilestoneEntries.IsEmpty()) return false;
 
-  nsSMILTimeValue containerTime = ParentToContainerTime(aMilestone.mTime);
+  SMILTimeValue containerTime = ParentToContainerTime(aMilestone.mTime);
   if (!containerTime.IsDefinite()) return false;
 
   SMILMilestone containerMilestone(containerTime.GetMillis(),
                                    aMilestone.mIsEnd);
 
   MOZ_ASSERT(mMilestoneEntries.Top().mMilestone >= containerMilestone,
              "Trying to pop off earliest times but we have earlier ones that "
              "were overlooked");
--- a/dom/smil/SMILTimeContainer.h
+++ b/dom/smil/SMILTimeContainer.h
@@ -8,19 +8,19 @@
 #define NS_SMILTIMECONTAINER_H_
 
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/SMILMilestone.h"
 #include "nscore.h"
 #include "nsSMILTypes.h"
 #include "nsTPriorityQueue.h"
 
-class nsSMILTimeValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILTimeValue;
 
 //----------------------------------------------------------------------
 // SMILTimeContainer
 //
 // Common base class for a time base that can be paused, resumed, and sampled.
 //
 class SMILTimeContainer {
  public:
@@ -102,26 +102,26 @@ class SMILTimeContainer {
 
   /*
    * Convert container time to parent time.
    *
    * @param   aContainerTime The container time to convert.
    * @return  The equivalent parent time or indefinite if the container is
    *          paused and the time is in the future.
    */
-  nsSMILTimeValue ContainerToParentTime(nsSMILTime aContainerTime) const;
+  SMILTimeValue ContainerToParentTime(nsSMILTime aContainerTime) const;
 
   /*
    * Convert from parent time to container time.
    *
    * @param   aParentTime The parent time to convert.
    * @return  The equivalent container time or indefinite if the container is
    *          paused and aParentTime is after the time when the pause began.
    */
-  nsSMILTimeValue ParentToContainerTime(nsSMILTime aParentTime) const;
+  SMILTimeValue ParentToContainerTime(nsSMILTime aParentTime) const;
 
   /*
    * If the container is paused, causes the pause time to be updated to the
    * current parent time. This should be called before updating
    * cross-container dependencies that will call ContainerToParentTime in order
    * to provide more intuitive results.
    */
   void SyncPauseTime();
rename from dom/smil/nsSMILTimeValue.cpp
rename to dom/smil/SMILTimeValue.cpp
--- a/dom/smil/nsSMILTimeValue.cpp
+++ b/dom/smil/SMILTimeValue.cpp
@@ -1,27 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "nsSMILTimeValue.h"
+#include "SMILTimeValue.h"
 
-const nsSMILTime nsSMILTimeValue::kUnresolvedMillis =
+namespace mozilla {
+
+const nsSMILTime SMILTimeValue::kUnresolvedMillis =
     std::numeric_limits<nsSMILTime>::max();
 
 //----------------------------------------------------------------------
-// nsSMILTimeValue methods:
+// SMILTimeValue methods:
 
 static inline int8_t Cmp(int64_t aA, int64_t aB) {
   return aA == aB ? 0 : (aA > aB ? 1 : -1);
 }
 
-int8_t nsSMILTimeValue::CompareTo(const nsSMILTimeValue& aOther) const {
+int8_t SMILTimeValue::CompareTo(const SMILTimeValue& aOther) const {
   int8_t result;
 
   if (mState == STATE_DEFINITE) {
     result = (aOther.mState == STATE_DEFINITE)
                  ? Cmp(mMilliseconds, aOther.mMilliseconds)
                  : -1;
   } else if (mState == STATE_INDEFINITE) {
     if (aOther.mState == STATE_DEFINITE)
@@ -31,8 +33,10 @@ int8_t nsSMILTimeValue::CompareTo(const 
     else
       result = -1;
   } else {
     result = (aOther.mState != STATE_UNRESOLVED) ? 1 : 0;
   }
 
   return result;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILTimeValue.h
rename to dom/smil/SMILTimeValue.h
--- a/dom/smil/nsSMILTimeValue.h
+++ b/dom/smil/SMILTimeValue.h
@@ -5,68 +5,70 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILTIMEVALUE_H_
 #define NS_SMILTIMEVALUE_H_
 
 #include "nsSMILTypes.h"
 #include "nsDebug.h"
 
+namespace mozilla {
+
 /*----------------------------------------------------------------------
- * nsSMILTimeValue class
+ * SMILTimeValue class
  *
  * A tri-state time value.
  *
  * First a quick overview of the SMIL time data types:
  *
- * nsSMILTime          -- a timestamp in milliseconds.
- * nsSMILTimeValue     -- (this class) a timestamp that can take the additional
- *                        states 'indefinite' and 'unresolved'
- * nsSMILInstanceTime  -- an nsSMILTimeValue used for constructing intervals. It
- *                        contains additional fields to govern reset behavior
- *                        and track timing dependencies (e.g. syncbase timing).
- * SMILInterval        -- a pair of nsSMILInstanceTimes that defines a begin and
- *                        an end time for animation.
- * nsSMILTimeValueSpec -- a component of a begin or end attribute, such as the
- *                        '5s' or 'a.end+2m' in begin="5s; a.end+2m". Acts as
- *                        a broker between an SMILTimedElement and its
- *                        nsSMILInstanceTimes by generating new instance times
- *                        and handling changes to existing times.
+ * nsSMILTime        -- a timestamp in milliseconds.
+ * SMILTimeValue     -- (this class) a timestamp that can take the additional
+ *                      states 'indefinite' and 'unresolved'
+ * SMILInstanceTime  -- an SMILTimeValue used for constructing intervals. It
+ *                      contains additional fields to govern reset behavior
+ *                      and track timing dependencies (e.g. syncbase timing).
+ * SMILInterval      -- a pair of SMILInstanceTimes that defines a begin and
+ *                      an end time for animation.
+ * SMILTimeValueSpec -- a component of a begin or end attribute, such as the
+ *                      '5s' or 'a.end+2m' in begin="5s; a.end+2m". Acts as
+ *                      a broker between an SMILTimedElement and its
+ *                      SMILInstanceTimes by generating new instance times
+ *                      and handling changes to existing times.
  *
  * Objects of this class may be in one of three states:
  *
  * 1) The time is resolved and has a definite millisecond value
  * 2) The time is resolved and indefinite
  * 3) The time is unresolved
  *
  * In summary:
  *
- * State      | GetMillis       | IsDefinite | IsIndefinite | IsResolved
- * -----------+-----------------+------------+--------------+------------
- * Definite   | nsSMILTimeValue | true       | false        | true
- * -----------+-----------------+------------+--------------+------------
- * Indefinite | --              | false      | true         | true
- * -----------+-----------------+------------+--------------+------------
- * Unresolved | --              | false      | false        | false
+ * State      | GetMillis     | IsDefinite | IsIndefinite | IsResolved
+ * -----------+---------------+------------+--------------+------------
+ * Definite   | SMILTimeValue | true       | false        | true
+ * -----------+---------------+------------+--------------+------------
+ * Indefinite | --            | false      | true         | true
+ * -----------+---------------+------------+--------------+------------
+ * Unresolved | --            | false      | false        | false
  *
  */
 
-class nsSMILTimeValue {
+class SMILTimeValue {
  public:
   // Creates an unresolved time value
-  nsSMILTimeValue()
+  SMILTimeValue()
       : mMilliseconds(kUnresolvedMillis), mState(STATE_UNRESOLVED) {}
 
   // Creates a resolved time value
-  explicit nsSMILTimeValue(nsSMILTime aMillis)
+  explicit SMILTimeValue(nsSMILTime aMillis)
       : mMilliseconds(aMillis), mState(STATE_DEFINITE) {}
 
   // Named constructor to create an indefinite time value
-  static nsSMILTimeValue Indefinite() {
-    nsSMILTimeValue value;
+  static SMILTimeValue Indefinite() {
+    SMILTimeValue value;
     value.SetIndefinite();
     return value;
   }
 
   bool IsIndefinite() const { return mState == STATE_INDEFINITE; }
   void SetIndefinite() {
     mState = STATE_INDEFINITE;
     mMilliseconds = kUnresolvedMillis;
@@ -86,42 +88,44 @@ class nsSMILTimeValue {
     return mState == STATE_DEFINITE ? mMilliseconds : kUnresolvedMillis;
   }
 
   void SetMillis(nsSMILTime aMillis) {
     mState = STATE_DEFINITE;
     mMilliseconds = aMillis;
   }
 
-  int8_t CompareTo(const nsSMILTimeValue& aOther) const;
+  int8_t CompareTo(const SMILTimeValue& aOther) const;
 
-  bool operator==(const nsSMILTimeValue& aOther) const {
+  bool operator==(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) == 0;
   }
 
-  bool operator!=(const nsSMILTimeValue& aOther) const {
+  bool operator!=(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) != 0;
   }
 
-  bool operator<(const nsSMILTimeValue& aOther) const {
+  bool operator<(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) < 0;
   }
 
-  bool operator>(const nsSMILTimeValue& aOther) const {
+  bool operator>(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) > 0;
   }
 
-  bool operator<=(const nsSMILTimeValue& aOther) const {
+  bool operator<=(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) <= 0;
   }
 
-  bool operator>=(const nsSMILTimeValue& aOther) const {
+  bool operator>=(const SMILTimeValue& aOther) const {
     return CompareTo(aOther) >= 0;
   }
 
  private:
   static const nsSMILTime kUnresolvedMillis;
 
   nsSMILTime mMilliseconds;
   enum { STATE_DEFINITE, STATE_INDEFINITE, STATE_UNRESOLVED } mState;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILTIMEVALUE_H_
rename from dom/smil/nsSMILTimeValueSpec.cpp
rename to dom/smil/SMILTimeValueSpec.cpp
--- a/dom/smil/nsSMILTimeValueSpec.cpp
+++ b/dom/smil/SMILTimeValueSpec.cpp
@@ -1,254 +1,253 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "mozilla/EventListenerManager.h"
+#include "mozilla/SMILInstanceTime.h"
 #include "mozilla/SMILInterval.h"
 #include "mozilla/SMILParserUtils.h"
 #include "mozilla/SMILTimeContainer.h"
 #include "mozilla/SMILTimedElement.h"
+#include "mozilla/SMILTimeValueSpec.h"
+#include "mozilla/SMILTimeValue.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/dom/TimeEvent.h"
-#include "nsSMILTimeValueSpec.h"
-#include "nsSMILTimeValue.h"
-#include "nsSMILInstanceTime.h"
 #include "nsString.h"
 #include <limits>
 
-using namespace mozilla;
 using namespace mozilla::dom;
 
+namespace mozilla {
+
 //----------------------------------------------------------------------
 // Nested class: EventListener
 
-NS_IMPL_ISUPPORTS(nsSMILTimeValueSpec::EventListener, nsIDOMEventListener)
+NS_IMPL_ISUPPORTS(SMILTimeValueSpec::EventListener, nsIDOMEventListener)
 
 NS_IMETHODIMP
-nsSMILTimeValueSpec::EventListener::HandleEvent(Event* aEvent) {
+SMILTimeValueSpec::EventListener::HandleEvent(Event* aEvent) {
   if (mSpec) {
     mSpec->HandleEvent(aEvent);
   }
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSMILTimeValueSpec::nsSMILTimeValueSpec(SMILTimedElement& aOwner,
-                                         bool aIsBegin)
+SMILTimeValueSpec::SMILTimeValueSpec(SMILTimedElement& aOwner, bool aIsBegin)
     : mOwner(&aOwner), mIsBegin(aIsBegin), mReferencedElement(this) {}
 
-nsSMILTimeValueSpec::~nsSMILTimeValueSpec() {
+SMILTimeValueSpec::~SMILTimeValueSpec() {
   UnregisterFromReferencedElement(mReferencedElement.get());
   if (mEventListener) {
     mEventListener->Disconnect();
     mEventListener = nullptr;
   }
 }
 
-nsresult nsSMILTimeValueSpec::SetSpec(const nsAString& aStringSpec,
-                                      Element& aContextElement) {
-  nsSMILTimeValueSpecParams params;
+nsresult SMILTimeValueSpec::SetSpec(const nsAString& aStringSpec,
+                                    Element& aContextElement) {
+  SMILTimeValueSpecParams params;
 
   if (!SMILParserUtils::ParseTimeValueSpecParams(aStringSpec, params))
     return NS_ERROR_FAILURE;
 
   mParams = params;
 
   // According to SMIL 3.0:
   //   The special value "indefinite" does not yield an instance time in the
   //   begin list. It will, however yield a single instance with the value
   //   "indefinite" in an end list. This value is not removed by a reset.
-  if (mParams.mType == nsSMILTimeValueSpecParams::OFFSET ||
-      (!mIsBegin && mParams.mType == nsSMILTimeValueSpecParams::INDEFINITE)) {
-    mOwner->AddInstanceTime(new nsSMILInstanceTime(mParams.mOffset), mIsBegin);
+  if (mParams.mType == SMILTimeValueSpecParams::OFFSET ||
+      (!mIsBegin && mParams.mType == SMILTimeValueSpecParams::INDEFINITE)) {
+    mOwner->AddInstanceTime(new SMILInstanceTime(mParams.mOffset), mIsBegin);
   }
 
   // Fill in the event symbol to simplify handling later
-  if (mParams.mType == nsSMILTimeValueSpecParams::REPEAT) {
+  if (mParams.mType == SMILTimeValueSpecParams::REPEAT) {
     mParams.mEventSymbol = nsGkAtoms::repeatEvent;
   }
 
   ResolveReferences(aContextElement);
 
   return NS_OK;
 }
 
-void nsSMILTimeValueSpec::ResolveReferences(Element& aContextElement) {
-  if (mParams.mType != nsSMILTimeValueSpecParams::SYNCBASE && !IsEventBased()) {
+void SMILTimeValueSpec::ResolveReferences(Element& aContextElement) {
+  if (mParams.mType != SMILTimeValueSpecParams::SYNCBASE && !IsEventBased()) {
     return;
   }
 
   // If we're not bound to the document yet, don't worry, we'll get called again
   // when that happens
   if (!aContextElement.IsInComposedDoc()) return;
 
   // Hold ref to the old element so that it isn't destroyed in between resetting
   // the referenced element and using the pointer to update the referenced
   // element.
   RefPtr<Element> oldReferencedElement = mReferencedElement.get();
 
   if (mParams.mDependentElemID) {
     mReferencedElement.ResetWithID(aContextElement, mParams.mDependentElemID);
-  } else if (mParams.mType == nsSMILTimeValueSpecParams::EVENT) {
+  } else if (mParams.mType == SMILTimeValueSpecParams::EVENT) {
     Element* target = mOwner->GetTargetElement();
     mReferencedElement.ResetWithElement(target);
   } else {
     MOZ_ASSERT(false, "Syncbase or repeat spec without ID");
   }
   UpdateReferencedElement(oldReferencedElement, mReferencedElement.get());
 }
 
-bool nsSMILTimeValueSpec::IsEventBased() const {
-  return mParams.mType == nsSMILTimeValueSpecParams::EVENT ||
-         mParams.mType == nsSMILTimeValueSpecParams::REPEAT;
+bool SMILTimeValueSpec::IsEventBased() const {
+  return mParams.mType == SMILTimeValueSpecParams::EVENT ||
+         mParams.mType == SMILTimeValueSpecParams::REPEAT;
 }
 
-void nsSMILTimeValueSpec::HandleNewInterval(
+void SMILTimeValueSpec::HandleNewInterval(
     SMILInterval& aInterval, const SMILTimeContainer* aSrcContainer) {
-  const nsSMILInstanceTime& baseInstance =
+  const SMILInstanceTime& baseInstance =
       mParams.mSyncBegin ? *aInterval.Begin() : *aInterval.End();
-  nsSMILTimeValue newTime =
+  SMILTimeValue newTime =
       ConvertBetweenTimeContainers(baseInstance.Time(), aSrcContainer);
 
   // Apply offset
   if (!ApplyOffset(newTime)) {
     NS_WARNING("New time overflows nsSMILTime, ignoring");
     return;
   }
 
   // Create the instance time and register it with the interval
-  RefPtr<nsSMILInstanceTime> newInstance = new nsSMILInstanceTime(
-      newTime, nsSMILInstanceTime::SOURCE_SYNCBASE, this, &aInterval);
+  RefPtr<SMILInstanceTime> newInstance = new SMILInstanceTime(
+      newTime, SMILInstanceTime::SOURCE_SYNCBASE, this, &aInterval);
   mOwner->AddInstanceTime(newInstance, mIsBegin);
 }
 
-void nsSMILTimeValueSpec::HandleTargetElementChange(Element* aNewTarget) {
+void SMILTimeValueSpec::HandleTargetElementChange(Element* aNewTarget) {
   if (!IsEventBased() || mParams.mDependentElemID) return;
 
   mReferencedElement.ResetWithElement(aNewTarget);
 }
 
-void nsSMILTimeValueSpec::HandleChangedInstanceTime(
-    const nsSMILInstanceTime& aBaseTime, const SMILTimeContainer* aSrcContainer,
-    nsSMILInstanceTime& aInstanceTimeToUpdate, bool aObjectChanged) {
+void SMILTimeValueSpec::HandleChangedInstanceTime(
+    const SMILInstanceTime& aBaseTime, const SMILTimeContainer* aSrcContainer,
+    SMILInstanceTime& aInstanceTimeToUpdate, bool aObjectChanged) {
   // If the instance time is fixed (e.g. because it's being used as the begin
   // time of an active or postactive interval) we just ignore the change.
   if (aInstanceTimeToUpdate.IsFixedTime()) return;
 
-  nsSMILTimeValue updatedTime =
+  SMILTimeValue updatedTime =
       ConvertBetweenTimeContainers(aBaseTime.Time(), aSrcContainer);
 
   // Apply offset
   if (!ApplyOffset(updatedTime)) {
     NS_WARNING("Updated time overflows nsSMILTime, ignoring");
     return;
   }
 
   // The timed element that owns the instance time does the updating so it can
   // re-sort its array of instance times more efficiently
   if (aInstanceTimeToUpdate.Time() != updatedTime || aObjectChanged) {
     mOwner->UpdateInstanceTime(&aInstanceTimeToUpdate, updatedTime, mIsBegin);
   }
 }
 
-void nsSMILTimeValueSpec::HandleDeletedInstanceTime(
-    nsSMILInstanceTime& aInstanceTime) {
+void SMILTimeValueSpec::HandleDeletedInstanceTime(
+    SMILInstanceTime& aInstanceTime) {
   mOwner->RemoveInstanceTime(&aInstanceTime, mIsBegin);
 }
 
-bool nsSMILTimeValueSpec::DependsOnBegin() const { return mParams.mSyncBegin; }
+bool SMILTimeValueSpec::DependsOnBegin() const { return mParams.mSyncBegin; }
 
-void nsSMILTimeValueSpec::Traverse(
+void SMILTimeValueSpec::Traverse(
     nsCycleCollectionTraversalCallback* aCallback) {
   mReferencedElement.Traverse(aCallback);
 }
 
-void nsSMILTimeValueSpec::Unlink() {
+void SMILTimeValueSpec::Unlink() {
   UnregisterFromReferencedElement(mReferencedElement.get());
   mReferencedElement.Unlink();
 }
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
-void nsSMILTimeValueSpec::UpdateReferencedElement(Element* aFrom,
-                                                  Element* aTo) {
+void SMILTimeValueSpec::UpdateReferencedElement(Element* aFrom, Element* aTo) {
   if (aFrom == aTo) return;
 
   UnregisterFromReferencedElement(aFrom);
 
   switch (mParams.mType) {
-    case nsSMILTimeValueSpecParams::SYNCBASE: {
+    case SMILTimeValueSpecParams::SYNCBASE: {
       SMILTimedElement* to = GetTimedElement(aTo);
       if (to) {
         to->AddDependent(*this);
       }
     } break;
 
-    case nsSMILTimeValueSpecParams::EVENT:
-    case nsSMILTimeValueSpecParams::REPEAT:
+    case SMILTimeValueSpecParams::EVENT:
+    case SMILTimeValueSpecParams::REPEAT:
       RegisterEventListener(aTo);
       break;
 
     default:
       // not a referencing-type
       break;
   }
 }
 
-void nsSMILTimeValueSpec::UnregisterFromReferencedElement(Element* aElement) {
+void SMILTimeValueSpec::UnregisterFromReferencedElement(Element* aElement) {
   if (!aElement) return;
 
-  if (mParams.mType == nsSMILTimeValueSpecParams::SYNCBASE) {
+  if (mParams.mType == SMILTimeValueSpecParams::SYNCBASE) {
     SMILTimedElement* timedElement = GetTimedElement(aElement);
     if (timedElement) {
       timedElement->RemoveDependent(*this);
     }
     mOwner->RemoveInstanceTimesForCreator(this, mIsBegin);
   } else if (IsEventBased()) {
     UnregisterEventListener(aElement);
   }
 }
 
-SMILTimedElement* nsSMILTimeValueSpec::GetTimedElement(Element* aElement) {
+SMILTimedElement* SMILTimeValueSpec::GetTimedElement(Element* aElement) {
   return aElement && aElement->IsNodeOfType(nsINode::eANIMATION)
              ? &static_cast<SVGAnimationElement*>(aElement)->TimedElement()
              : nullptr;
 }
 
 // Indicates whether we're allowed to register an event-listener
 // when scripting is disabled.
-bool nsSMILTimeValueSpec::IsWhitelistedEvent() {
+bool SMILTimeValueSpec::IsWhitelistedEvent() {
   // The category of (SMIL-specific) "repeat(n)" events are allowed.
-  if (mParams.mType == nsSMILTimeValueSpecParams::REPEAT) {
+  if (mParams.mType == SMILTimeValueSpecParams::REPEAT) {
     return true;
   }
 
   // A specific list of other SMIL-related events are allowed, too.
-  if (mParams.mType == nsSMILTimeValueSpecParams::EVENT &&
+  if (mParams.mType == SMILTimeValueSpecParams::EVENT &&
       (mParams.mEventSymbol == nsGkAtoms::repeat ||
        mParams.mEventSymbol == nsGkAtoms::repeatEvent ||
        mParams.mEventSymbol == nsGkAtoms::beginEvent ||
        mParams.mEventSymbol == nsGkAtoms::endEvent)) {
     return true;
   }
 
   return false;
 }
 
-void nsSMILTimeValueSpec::RegisterEventListener(Element* aTarget) {
+void SMILTimeValueSpec::RegisterEventListener(Element* aTarget) {
   MOZ_ASSERT(IsEventBased(),
              "Attempting to register event-listener for unexpected "
-             "nsSMILTimeValueSpec type");
+             "SMILTimeValueSpec type");
   MOZ_ASSERT(mParams.mEventSymbol,
              "Attempting to register event-listener but there is no event "
              "name");
 
   if (!aTarget) return;
 
   // When script is disabled, only allow registration for whitelisted events.
   if (!aTarget->GetOwnerDocument()->IsScriptEnabled() &&
@@ -265,105 +264,107 @@ void nsSMILTimeValueSpec::RegisterEventL
     return;
   }
 
   elm->AddEventListenerByType(mEventListener,
                               nsDependentAtomString(mParams.mEventSymbol),
                               AllEventsAtSystemGroupBubble());
 }
 
-void nsSMILTimeValueSpec::UnregisterEventListener(Element* aTarget) {
+void SMILTimeValueSpec::UnregisterEventListener(Element* aTarget) {
   if (!aTarget || !mEventListener) {
     return;
   }
 
   EventListenerManager* elm = aTarget->GetOrCreateListenerManager();
   if (!elm) {
     return;
   }
 
   elm->RemoveEventListenerByType(mEventListener,
                                  nsDependentAtomString(mParams.mEventSymbol),
                                  AllEventsAtSystemGroupBubble());
 }
 
-void nsSMILTimeValueSpec::HandleEvent(Event* aEvent) {
+void SMILTimeValueSpec::HandleEvent(Event* aEvent) {
   MOZ_ASSERT(mEventListener, "Got event without an event listener");
-  MOZ_ASSERT(IsEventBased(), "Got event for non-event nsSMILTimeValueSpec");
+  MOZ_ASSERT(IsEventBased(), "Got event for non-event SMILTimeValueSpec");
   MOZ_ASSERT(aEvent, "No event supplied");
 
   // XXX In the long run we should get the time from the event itself which will
   // store the time in global document time which we'll need to convert to our
   // time container
   SMILTimeContainer* container = mOwner->GetTimeContainer();
   if (!container) return;
 
-  if (mParams.mType == nsSMILTimeValueSpecParams::REPEAT &&
+  if (mParams.mType == SMILTimeValueSpecParams::REPEAT &&
       !CheckRepeatEventDetail(aEvent)) {
     return;
   }
 
   nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
-  nsSMILTimeValue newTime(currentTime);
+  SMILTimeValue newTime(currentTime);
   if (!ApplyOffset(newTime)) {
     NS_WARNING("New time generated from event overflows nsSMILTime, ignoring");
     return;
   }
 
-  RefPtr<nsSMILInstanceTime> newInstance =
-      new nsSMILInstanceTime(newTime, nsSMILInstanceTime::SOURCE_EVENT);
+  RefPtr<SMILInstanceTime> newInstance =
+      new SMILInstanceTime(newTime, SMILInstanceTime::SOURCE_EVENT);
   mOwner->AddInstanceTime(newInstance, mIsBegin);
 }
 
-bool nsSMILTimeValueSpec::CheckRepeatEventDetail(Event* aEvent) {
+bool SMILTimeValueSpec::CheckRepeatEventDetail(Event* aEvent) {
   TimeEvent* timeEvent = aEvent->AsTimeEvent();
   if (!timeEvent) {
     NS_WARNING("Received a repeat event that was not a DOMTimeEvent");
     return false;
   }
 
   int32_t detail = timeEvent->Detail();
   return detail > 0 && (uint32_t)detail == mParams.mRepeatIteration;
 }
 
-nsSMILTimeValue nsSMILTimeValueSpec::ConvertBetweenTimeContainers(
-    const nsSMILTimeValue& aSrcTime, const SMILTimeContainer* aSrcContainer) {
+SMILTimeValue SMILTimeValueSpec::ConvertBetweenTimeContainers(
+    const SMILTimeValue& aSrcTime, const SMILTimeContainer* aSrcContainer) {
   // If the source time is either indefinite or unresolved the result is going
   // to be the same
   if (!aSrcTime.IsDefinite()) return aSrcTime;
 
   // Convert from source time container to our parent time container
   const SMILTimeContainer* dstContainer = mOwner->GetTimeContainer();
   if (dstContainer == aSrcContainer) return aSrcTime;
 
   // If one of the elements is not attached to a time container then we can't do
   // any meaningful conversion
-  if (!aSrcContainer || !dstContainer) return nsSMILTimeValue();  // unresolved
+  if (!aSrcContainer || !dstContainer) return SMILTimeValue();  // unresolved
 
-  nsSMILTimeValue docTime =
+  SMILTimeValue docTime =
       aSrcContainer->ContainerToParentTime(aSrcTime.GetMillis());
 
   if (docTime.IsIndefinite())
     // This will happen if the source container is paused and we have a future
     // time. Just return the indefinite time.
     return docTime;
 
   MOZ_ASSERT(docTime.IsDefinite(),
              "ContainerToParentTime gave us an unresolved or indefinite time");
 
   return dstContainer->ParentToContainerTime(docTime.GetMillis());
 }
 
-bool nsSMILTimeValueSpec::ApplyOffset(nsSMILTimeValue& aTime) const {
+bool SMILTimeValueSpec::ApplyOffset(SMILTimeValue& aTime) const {
   // indefinite + offset = indefinite. Likewise for unresolved times.
   if (!aTime.IsDefinite()) {
     return true;
   }
 
   double resultAsDouble =
       (double)aTime.GetMillis() + mParams.mOffset.GetMillis();
   if (resultAsDouble > std::numeric_limits<nsSMILTime>::max() ||
       resultAsDouble < std::numeric_limits<nsSMILTime>::min()) {
     return false;
   }
   aTime.SetMillis(aTime.GetMillis() + mParams.mOffset.GetMillis());
   return true;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILTimeValueSpec.h
rename to dom/smil/SMILTimeValueSpec.h
--- a/dom/smil/nsSMILTimeValueSpec.h
+++ b/dom/smil/SMILTimeValueSpec.h
@@ -3,141 +3,138 @@
 /* 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 NS_SMILTIMEVALUESPEC_H_
 #define NS_SMILTIMEVALUESPEC_H_
 
 #include "mozilla/Attributes.h"
+#include "mozilla/SMILTimeValueSpecParams.h"
 #include "mozilla/dom/IDTracker.h"
-#include "nsSMILTimeValueSpecParams.h"
 #include "nsStringFwd.h"
 #include "nsIDOMEventListener.h"
 
-class nsSMILTimeValue;
-class nsSMILInstanceTime;
+namespace mozilla {
 
-namespace mozilla {
+class EventListenerManager;
+class SMILInstanceTime;
 class SMILInterval;
 class SMILTimeContainer;
 class SMILTimedElement;
+class SMILTimeValue;
+
 namespace dom {
 class Event;
 }  // namespace dom
 
-class EventListenerManager;
-}  // namespace mozilla
-
 //----------------------------------------------------------------------
-// nsSMILTimeValueSpec class
+// SMILTimeValueSpec class
 //
 // An individual element of a 'begin' or 'end' attribute, e.g. '5s', 'a.end'.
 // This class handles the parsing of such specifications and performs the
 // necessary event handling (for event and repeat specifications)
 // and synchronisation (for syncbase specifications).
 //
 // For an overview of how this class is related to other SMIL time classes see
-// the documentation in nsSMILTimeValue.h
+// the documentation in SMILTimeValue.h
 
-class nsSMILTimeValueSpec {
+class SMILTimeValueSpec {
  public:
-  typedef mozilla::SMILInterval SMILInterval;
-  typedef mozilla::SMILTimeContainer SMILTimeContainer;
-  typedef mozilla::SMILTimedElement SMILTimedElement;
   typedef mozilla::dom::Element Element;
   typedef mozilla::dom::Event Event;
   typedef mozilla::dom::IDTracker IDTracker;
 
-  nsSMILTimeValueSpec(SMILTimedElement& aOwner, bool aIsBegin);
-  ~nsSMILTimeValueSpec();
+  SMILTimeValueSpec(SMILTimedElement& aOwner, bool aIsBegin);
+  ~SMILTimeValueSpec();
 
   nsresult SetSpec(const nsAString& aStringSpec, Element& aContextElement);
   void ResolveReferences(Element& aContextElement);
   bool IsEventBased() const;
 
   void HandleNewInterval(SMILInterval& aInterval,
                          const SMILTimeContainer* aSrcContainer);
   void HandleTargetElementChange(Element* aNewTarget);
 
-  // For created nsSMILInstanceTime objects
+  // For created SMILInstanceTime objects
   bool DependsOnBegin() const;
-  void HandleChangedInstanceTime(const nsSMILInstanceTime& aBaseTime,
+  void HandleChangedInstanceTime(const SMILInstanceTime& aBaseTime,
                                  const SMILTimeContainer* aSrcContainer,
-                                 nsSMILInstanceTime& aInstanceTimeToUpdate,
+                                 SMILInstanceTime& aInstanceTimeToUpdate,
                                  bool aObjectChanged);
-  void HandleDeletedInstanceTime(nsSMILInstanceTime& aInstanceTime);
+  void HandleDeletedInstanceTime(SMILInstanceTime& aInstanceTime);
 
   // Cycle-collection support
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
   void Unlink();
 
  protected:
   void UpdateReferencedElement(Element* aFrom, Element* aTo);
   void UnregisterFromReferencedElement(Element* aElement);
   SMILTimedElement* GetTimedElement(Element* aElement);
   bool IsWhitelistedEvent();
   void RegisterEventListener(Element* aElement);
   void UnregisterEventListener(Element* aElement);
   void HandleEvent(Event* aEvent);
   bool CheckRepeatEventDetail(Event* aEvent);
-  nsSMILTimeValue ConvertBetweenTimeContainers(
-      const nsSMILTimeValue& aSrcTime, const SMILTimeContainer* aSrcContainer);
-  bool ApplyOffset(nsSMILTimeValue& aTime) const;
+  SMILTimeValue ConvertBetweenTimeContainers(
+      const SMILTimeValue& aSrcTime, const SMILTimeContainer* aSrcContainer);
+  bool ApplyOffset(SMILTimeValue& aTime) const;
 
   SMILTimedElement* mOwner;
   bool mIsBegin;  // Indicates if *we* are a begin spec,
                   // not to be confused with
                   // mParams.mSyncBegin which indicates
                   // if we're synced with the begin of
                   // the target.
-  nsSMILTimeValueSpecParams mParams;
+  SMILTimeValueSpecParams mParams;
 
   /**
-   * If our nsSMILTimeValueSpec exists for a 'begin' or 'end' attribute with a
+   * If our SMILTimeValueSpec exists for a 'begin' or 'end' attribute with a
    * value that specifies a time that is relative to the animation of some
    * other element, it will create an instance of this class to reference and
-   * track that other element.  For example, if the nsSMILTimeValueSpec is for
+   * track that other element.  For example, if the SMILTimeValueSpec is for
    * end='a.end+2s', an instance of this class will be created to track the
    * element associated with the element ID "a".  This class will notify the
-   * nsSMILTimeValueSpec if the element that that ID identifies changes to a
+   * SMILTimeValueSpec if the element that that ID identifies changes to a
    * different element (or none).
    */
   class TimeReferenceTracker final : public IDTracker {
    public:
-    explicit TimeReferenceTracker(nsSMILTimeValueSpec* aOwner)
-        : mSpec(aOwner) {}
+    explicit TimeReferenceTracker(SMILTimeValueSpec* aOwner) : mSpec(aOwner) {}
     void ResetWithElement(Element* aTo) {
       RefPtr<Element> from = get();
       Unlink();
       ElementChanged(from, aTo);
     }
 
    protected:
     virtual void ElementChanged(Element* aFrom, Element* aTo) override {
       IDTracker::ElementChanged(aFrom, aTo);
       mSpec->UpdateReferencedElement(aFrom, aTo);
     }
     virtual bool IsPersistent() override { return true; }
 
    private:
-    nsSMILTimeValueSpec* mSpec;
+    SMILTimeValueSpec* mSpec;
   };
 
   TimeReferenceTracker mReferencedElement;
 
   class EventListener final : public nsIDOMEventListener {
     ~EventListener() {}
 
    public:
-    explicit EventListener(nsSMILTimeValueSpec* aOwner) : mSpec(aOwner) {}
+    explicit EventListener(SMILTimeValueSpec* aOwner) : mSpec(aOwner) {}
     void Disconnect() { mSpec = nullptr; }
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMEVENTLISTENER
 
    private:
-    nsSMILTimeValueSpec* mSpec;
+    SMILTimeValueSpec* mSpec;
   };
   RefPtr<EventListener> mEventListener;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILTIMEVALUESPEC_H_
rename from dom/smil/nsSMILTimeValueSpecParams.h
rename to dom/smil/SMILTimeValueSpecParams.h
--- a/dom/smil/nsSMILTimeValueSpecParams.h
+++ b/dom/smil/SMILTimeValueSpecParams.h
@@ -2,40 +2,42 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 NS_SMILTIMEVALUESPECPARAMS_H_
 #define NS_SMILTIMEVALUESPECPARAMS_H_
 
-#include "nsSMILTimeValue.h"
+#include "mozilla/SMILTimeValue.h"
 #include "nsAtom.h"
 
+namespace mozilla {
+
 //----------------------------------------------------------------------
-// nsSMILTimeValueSpecParams
+// SMILTimeValueSpecParams
 //
 // A simple data type for storing the result of parsing a single begin or end
 // value (e.g. the '5s' in begin="5s; indefinite; a.begin+2s").
 
-class nsSMILTimeValueSpecParams {
+class SMILTimeValueSpecParams {
  public:
-  nsSMILTimeValueSpecParams()
+  SMILTimeValueSpecParams()
       : mType(INDEFINITE), mSyncBegin(false), mRepeatIteration(0) {}
 
   // The type of value this specification describes
   enum { OFFSET, SYNCBASE, EVENT, REPEAT, WALLCLOCK, INDEFINITE } mType;
 
   // A clock value that is added to:
   // - type OFFSET: the document begin
   // - type SYNCBASE: the timebase's begin or end time
   // - type EVENT: the event time
   // - type REPEAT: the repeat time
   // It is not used for WALLCLOCK or INDEFINITE times
-  nsSMILTimeValue mOffset;
+  SMILTimeValue mOffset;
 
   // The base element that this specification refers to.
   // For SYNCBASE types, this is the timebase
   // For EVENT and REPEAT types, this is the eventbase
   RefPtr<nsAtom> mDependentElemID;
 
   // The event to respond to.
   // Only used for EVENT types.
@@ -46,9 +48,11 @@ class nsSMILTimeValueSpecParams {
   // Only used for SYNCBASE types.
   bool mSyncBegin;
 
   // The repeat iteration to respond to.
   // Only used for mType=REPEAT.
   uint32_t mRepeatIteration;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILTIMEVALUESPECPARAMS_H_
--- a/dom/smil/SMILTimedElement.cpp
+++ b/dom/smil/SMILTimedElement.cpp
@@ -6,24 +6,24 @@
 
 #include "SMILTimedElement.h"
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/SMILAnimationFunction.h"
+#include "mozilla/SMILInstanceTime.h"
 #include "mozilla/SMILParserUtils.h"
 #include "mozilla/SMILTimeContainer.h"
+#include "mozilla/SMILTimeValue.h"
+#include "mozilla/SMILTimeValueSpec.h"
 #include "mozilla/TaskCategory.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "nsAttrValueInlines.h"
-#include "nsSMILTimeValue.h"
-#include "nsSMILTimeValueSpec.h"
-#include "nsSMILInstanceTime.h"
 #include "nsGkAtoms.h"
 #include "nsReadableUtils.h"
 #include "nsMathUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIPresShell.h"
 #include "prdtoa.h"
 #include "plstr.h"
 #include "prtime.h"
@@ -42,28 +42,28 @@ namespace mozilla {
 // it a serial number. This allows us to sort the instance times in such a way
 // that where we have several equal instance times, the ones added later will
 // sort later. This means that when we call UpdateCurrentInterval during the
 // waiting state we won't unnecessarily change the begin instance.
 //
 // The serial number also means that every instance time has an unambiguous
 // position in the array so we can use RemoveElementSorted and the like.
 bool SMILTimedElement::InstanceTimeComparator::Equals(
-    const nsSMILInstanceTime* aElem1, const nsSMILInstanceTime* aElem2) const {
+    const SMILInstanceTime* aElem1, const SMILInstanceTime* aElem2) const {
   MOZ_ASSERT(aElem1 && aElem2, "Trying to compare null instance time pointers");
   MOZ_ASSERT(aElem1->Serial() && aElem2->Serial(),
              "Instance times have not been assigned serial numbers");
   MOZ_ASSERT(aElem1 == aElem2 || aElem1->Serial() != aElem2->Serial(),
              "Serial numbers are not unique");
 
   return aElem1->Serial() == aElem2->Serial();
 }
 
 bool SMILTimedElement::InstanceTimeComparator::LessThan(
-    const nsSMILInstanceTime* aElem1, const nsSMILInstanceTime* aElem2) const {
+    const SMILInstanceTime* aElem1, const SMILInstanceTime* aElem2) const {
   MOZ_ASSERT(aElem1 && aElem2, "Trying to compare null instance time pointers");
   MOZ_ASSERT(aElem1->Serial() && aElem2->Serial(),
              "Instance times have not been assigned serial numbers");
 
   int8_t cmp = aElem1->Time().CompareTo(aElem2->Time());
   return cmp == 0 ? aElem1->Serial() < aElem2->Serial() : cmp < 0;
 }
 
@@ -153,23 +153,23 @@ class MOZ_STACK_CLASS SMILTimedElement::
  private:
   SMILTimedElement& mTimedElement;
 };
 
 //----------------------------------------------------------------------
 // Templated helper functions
 
 // Selectively remove elements from an array of type
-// nsTArray<RefPtr<nsSMILInstanceTime> > with O(n) performance.
+// nsTArray<RefPtr<SMILInstanceTime> > with O(n) performance.
 template <class TestFunctor>
 void SMILTimedElement::RemoveInstanceTimes(InstanceTimeList& aArray,
                                            TestFunctor& aTest) {
   InstanceTimeList newArray;
   for (uint32_t i = 0; i < aArray.Length(); ++i) {
-    nsSMILInstanceTime* item = aArray[i].get();
+    SMILInstanceTime* item = aArray[i].get();
     if (aTest(item, i)) {
       // As per bugs 665334 and 669225 we should be careful not to remove the
       // instance time that corresponds to the previous interval's end time.
       //
       // Most functors supplied here fulfil this condition by checking if the
       // instance time is marked as "ShouldPreserve" and if so, not deleting it.
       //
       // However, when filtering instance times, we sometimes need to drop even
@@ -308,41 +308,41 @@ nsresult SMILTimedElement::EndElementAt(
 
   nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
   return AddInstanceTimeFromCurrentTime(currentTime, aOffsetSeconds, false);
 }
 
 //----------------------------------------------------------------------
 // nsSVGAnimationElement methods
 
-nsSMILTimeValue SMILTimedElement::GetStartTime() const {
+SMILTimeValue SMILTimedElement::GetStartTime() const {
   return mElementState == STATE_WAITING || mElementState == STATE_ACTIVE
              ? mCurrentInterval->Begin()->Time()
-             : nsSMILTimeValue();
+             : SMILTimeValue();
 }
 
 //----------------------------------------------------------------------
 // Hyperlinking support
 
-nsSMILTimeValue SMILTimedElement::GetHyperlinkTime() const {
-  nsSMILTimeValue hyperlinkTime;  // Default ctor creates unresolved time
+SMILTimeValue SMILTimedElement::GetHyperlinkTime() const {
+  SMILTimeValue hyperlinkTime;  // Default ctor creates unresolved time
 
   if (mElementState == STATE_ACTIVE) {
     hyperlinkTime = mCurrentInterval->Begin()->Time();
   } else if (!mBeginInstances.IsEmpty()) {
     hyperlinkTime = mBeginInstances[0]->Time();
   }
 
   return hyperlinkTime;
 }
 
 //----------------------------------------------------------------------
 // SMILTimedElement
 
-void SMILTimedElement::AddInstanceTime(nsSMILInstanceTime* aInstanceTime,
+void SMILTimedElement::AddInstanceTime(SMILInstanceTime* aInstanceTime,
                                        bool aIsBegin) {
   MOZ_ASSERT(aInstanceTime, "Attempting to add null instance time");
 
   // Event-sensitivity: If an element is not active (but the parent time
   // container is), then events are only handled for begin specifications.
   if (mElementState != STATE_ACTIVE && !aIsBegin &&
       aInstanceTime->IsDynamic()) {
     // No need to call Unlink here--dynamic instance times shouldn't be linked
@@ -350,32 +350,32 @@ void SMILTimedElement::AddInstanceTime(n
     MOZ_ASSERT(!aInstanceTime->GetBaseInterval(),
                "Dynamic instance time has a base interval--we probably need "
                "to unlink it if we're not going to use it");
     return;
   }
 
   aInstanceTime->SetSerial(++mInstanceSerialIndex);
   InstanceTimeList& instanceList = aIsBegin ? mBeginInstances : mEndInstances;
-  RefPtr<nsSMILInstanceTime>* inserted =
+  RefPtr<SMILInstanceTime>* inserted =
       instanceList.InsertElementSorted(aInstanceTime, InstanceTimeComparator());
   if (!inserted) {
     NS_WARNING("Insufficient memory to insert instance time");
     return;
   }
 
   UpdateCurrentInterval();
 }
 
-void SMILTimedElement::UpdateInstanceTime(nsSMILInstanceTime* aInstanceTime,
-                                          nsSMILTimeValue& aUpdatedTime,
+void SMILTimedElement::UpdateInstanceTime(SMILInstanceTime* aInstanceTime,
+                                          SMILTimeValue& aUpdatedTime,
                                           bool aIsBegin) {
   MOZ_ASSERT(aInstanceTime, "Attempting to update null instance time");
 
-  // The reason we update the time here and not in the nsSMILTimeValueSpec is
+  // The reason we update the time here and not in the SMILTimeValueSpec is
   // that it means we *could* re-sort more efficiently by doing a sorted remove
   // and insert but currently this doesn't seem to be necessary given how
   // infrequently we get these change notices.
   aInstanceTime->DependentUpdate(aUpdatedTime);
   InstanceTimeList& instanceList = aIsBegin ? mBeginInstances : mEndInstances;
   instanceList.Sort(InstanceTimeComparator());
 
   // Generally speaking, UpdateCurrentInterval makes changes to the current
@@ -391,17 +391,17 @@ void SMILTimedElement::UpdateInstanceTim
   // current interval when doing a Reset).
   bool changedCurrentInterval =
       mCurrentInterval && (mCurrentInterval->Begin() == aInstanceTime ||
                            mCurrentInterval->End() == aInstanceTime);
 
   UpdateCurrentInterval(changedCurrentInterval);
 }
 
-void SMILTimedElement::RemoveInstanceTime(nsSMILInstanceTime* aInstanceTime,
+void SMILTimedElement::RemoveInstanceTime(SMILInstanceTime* aInstanceTime,
                                           bool aIsBegin) {
   MOZ_ASSERT(aInstanceTime, "Attempting to remove null instance time");
 
   // If the instance time should be kept (because it is or was the fixed end
   // point of an interval) then just disassociate it from the creator.
   if (aInstanceTime->ShouldPreserve()) {
     aInstanceTime->Unlink();
     return;
@@ -413,39 +413,39 @@ void SMILTimedElement::RemoveInstanceTim
   MOZ_ASSERT(found, "Couldn't find instance time to delete");
 
   UpdateCurrentInterval();
 }
 
 namespace {
 class MOZ_STACK_CLASS RemoveByCreator {
  public:
-  explicit RemoveByCreator(const nsSMILTimeValueSpec* aCreator)
+  explicit RemoveByCreator(const SMILTimeValueSpec* aCreator)
       : mCreator(aCreator) {}
 
-  bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
+  bool operator()(SMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
     if (aInstanceTime->GetCreator() != mCreator) return false;
 
     // If the instance time should be kept (because it is or was the fixed end
     // point of an interval) then just disassociate it from the creator.
     if (aInstanceTime->ShouldPreserve()) {
       aInstanceTime->Unlink();
       return false;
     }
 
     return true;
   }
 
  private:
-  const nsSMILTimeValueSpec* mCreator;
+  const SMILTimeValueSpec* mCreator;
 };
 }  // namespace
 
 void SMILTimedElement::RemoveInstanceTimesForCreator(
-    const nsSMILTimeValueSpec* aCreator, bool aIsBegin) {
+    const SMILTimeValueSpec* aCreator, bool aIsBegin) {
   MOZ_ASSERT(aCreator, "Creator not set");
 
   InstanceTimeList& instances = aIsBegin ? mBeginInstances : mEndInstances;
   RemoveByCreator removeByCreator(aCreator);
   RemoveInstanceTimes(instances, removeByCreator);
 
   UpdateCurrentInterval();
 }
@@ -524,17 +524,17 @@ void SMILTimedElement::DoSampleAt(nsSMIL
     mSeekState = mElementState == STATE_ACTIVE ? SEEK_FORWARD_FROM_ACTIVE
                                                : SEEK_FORWARD_FROM_INACTIVE;
   } else if (mSeekState != SEEK_NOT_SEEKING &&
              !GetTimeContainer()->IsSeeking()) {
     finishedSeek = true;
   }
 
   bool stateChanged;
-  nsSMILTimeValue sampleTime(aContainerTime);
+  SMILTimeValue sampleTime(aContainerTime);
 
   do {
 #ifdef DEBUG
     // Check invariant
     if (mElementState == STATE_STARTUP || mElementState == STATE_POSTACTIVE) {
       MOZ_ASSERT(!mCurrentInterval,
                  "Shouldn't have current interval in startup or postactive "
                  "states");
@@ -623,17 +623,17 @@ void SMILTimedElement::DoSampleAt(nsSMIL
         } else if (mCurrentInterval->Begin()->Time() <= sampleTime) {
           MOZ_ASSERT(!didApplyEarlyEnd, "We got an early end, but didn't end");
           nsSMILTime beginTime = mCurrentInterval->Begin()->Time().GetMillis();
           nsSMILTime activeTime = aContainerTime - beginTime;
 
           // The 'min' attribute can cause the active interval to be longer than
           // the 'repeating interval'.
           // In that extended period we apply the fill mode.
-          if (GetRepeatDuration() <= nsSMILTimeValue(activeTime)) {
+          if (GetRepeatDuration() <= SMILTimeValue(activeTime)) {
             if (mClient && mClient->IsActive()) {
               mClient->Inactivate(mFillMode == FILL_FREEZE);
             }
             SampleFillValue();
           } else {
             SampleSimpleTime(activeTime);
 
             // We register our repeat times as milestones (except when we're
@@ -676,27 +676,27 @@ void SMILTimedElement::DoSampleAt(nsSMIL
   }
   RegisterMilestone();
 }
 
 void SMILTimedElement::HandleContainerTimeChange() {
   // In future we could possibly introduce a separate change notice for time
   // container changes and only notify those dependents who live in other time
   // containers. For now we don't bother because when we re-resolve the time in
-  // the nsSMILTimeValueSpec we'll check if anything has changed and if not, we
+  // the SMILTimeValueSpec we'll check if anything has changed and if not, we
   // won't go any further.
   if (mElementState == STATE_WAITING || mElementState == STATE_ACTIVE) {
     NotifyChangedInterval(mCurrentInterval.get(), false, false);
   }
 }
 
 namespace {
-bool RemoveNonDynamic(nsSMILInstanceTime* aInstanceTime) {
+bool RemoveNonDynamic(SMILInstanceTime* aInstanceTime) {
   // Generally dynamically-generated instance times (DOM calls, event-based
-  // times) are not associated with their creator nsSMILTimeValueSpec since
+  // times) are not associated with their creator SMILTimeValueSpec since
   // they may outlive them.
   MOZ_ASSERT(!aInstanceTime->IsDynamic() || !aInstanceTime->GetCreator(),
              "Dynamic instance time should be unlinked from its creator");
   return !aInstanceTime->IsDynamic() && !aInstanceTime->ShouldPreserve();
 }
 }  // namespace
 
 void SMILTimedElement::Rewind() {
@@ -724,34 +724,34 @@ void SMILTimedElement::Rewind() {
 
   ClearTimingState(RemoveNonDynamic);
   RebuildTimingState(RemoveNonDynamic);
 
   MOZ_ASSERT(!mCurrentInterval, "Current interval is set at end of rewind");
 }
 
 namespace {
-bool RemoveAll(nsSMILInstanceTime* aInstanceTime) { return true; }
+bool RemoveAll(SMILInstanceTime* aInstanceTime) { return true; }
 }  // namespace
 
 bool SMILTimedElement::SetIsDisabled(bool aIsDisabled) {
   if (mIsDisabled == aIsDisabled) return false;
 
   if (aIsDisabled) {
     mIsDisabled = true;
     ClearTimingState(RemoveAll);
   } else {
     RebuildTimingState(RemoveAll);
     mIsDisabled = false;
   }
   return true;
 }
 
 namespace {
-bool RemoveNonDOM(nsSMILInstanceTime* aInstanceTime) {
+bool RemoveNonDOM(SMILInstanceTime* aInstanceTime) {
   return !aInstanceTime->FromDOM() && !aInstanceTime->ShouldPreserve();
 }
 }  // namespace
 
 bool SMILTimedElement::SetAttr(nsAtom* aAttribute, const nsAString& aValue,
                                nsAttrValue& aResult, Element& aContextElement,
                                nsresult* aParseResult) {
   bool foundMatch = true;
@@ -843,17 +843,17 @@ void SMILTimedElement::UnsetEndSpec(Remo
   ClearSpecs(mEndSpecs, mEndInstances, aRemove);
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetSimpleDuration(const nsAString& aDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
-  nsSMILTimeValue duration;
+  SMILTimeValue duration;
   const nsAString& dur = SMILParserUtils::TrimWhitespace(aDurSpec);
 
   // SVG-specific: "For SVG's animation elements, if "media" is specified, the
   // attribute will be ignored." (SVG 1.1, section 19.2.6)
   if (dur.EqualsLiteral("media") || dur.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
     if (!SMILParserUtils::ParseClockValue(dur, &duration) ||
@@ -875,17 +875,17 @@ void SMILTimedElement::UnsetSimpleDurati
   mSimpleDur.SetIndefinite();
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetMin(const nsAString& aMinSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
-  nsSMILTimeValue duration;
+  SMILTimeValue duration;
   const nsAString& min = SMILParserUtils::TrimWhitespace(aMinSpec);
 
   if (min.EqualsLiteral("media")) {
     duration.SetMillis(0L);
   } else {
     if (!SMILParserUtils::ParseClockValue(min, &duration)) {
       mMin.SetMillis(0L);
       return NS_ERROR_FAILURE;
@@ -903,17 +903,17 @@ void SMILTimedElement::UnsetMin() {
   mMin.SetMillis(0L);
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetMax(const nsAString& aMaxSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
-  nsSMILTimeValue duration;
+  SMILTimeValue duration;
   const nsAString& max = SMILParserUtils::TrimWhitespace(aMaxSpec);
 
   if (max.EqualsLiteral("media") || max.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
     if (!SMILParserUtils::ParseClockValue(max, &duration) ||
         duration.GetMillis() == 0L) {
       mMax.SetIndefinite();
@@ -964,17 +964,17 @@ void SMILTimedElement::UnsetRepeatCount(
   mRepeatCount.Unset();
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetRepeatDur(const nsAString& aRepeatDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
-  nsSMILTimeValue duration;
+  SMILTimeValue duration;
 
   const nsAString& repeatDur = SMILParserUtils::TrimWhitespace(aRepeatDurSpec);
 
   if (repeatDur.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
     if (!SMILParserUtils::ParseClockValue(repeatDur, &duration)) {
       mRepeatDur.SetUnresolved();
@@ -1011,42 +1011,42 @@ nsresult SMILTimedElement::SetFillMode(c
 void SMILTimedElement::UnsetFillMode() {
   uint16_t previousFillMode = mFillMode;
   mFillMode = FILL_REMOVE;
   if (previousFillMode == FILL_FREEZE && HasClientInFillRange()) {
     mClient->Inactivate(false);
   }
 }
 
-void SMILTimedElement::AddDependent(nsSMILTimeValueSpec& aDependent) {
+void SMILTimedElement::AddDependent(SMILTimeValueSpec& aDependent) {
   // There's probably no harm in attempting to register a dependent
-  // nsSMILTimeValueSpec twice, but we're not expecting it to happen.
+  // SMILTimeValueSpec twice, but we're not expecting it to happen.
   MOZ_ASSERT(!mTimeDependents.GetEntry(&aDependent),
-             "nsSMILTimeValueSpec is already registered as a dependency");
+             "SMILTimeValueSpec is already registered as a dependency");
   mTimeDependents.PutEntry(&aDependent);
 
   // Add current interval. We could add historical intervals too but that would
   // cause unpredictable results since some intervals may have been filtered.
   // SMIL doesn't say what to do here so for simplicity and consistency we
   // simply add the current interval if there is one.
   //
   // It's not necessary to call SyncPauseTime since we're dealing with
   // historical instance times not newly added ones.
   if (mCurrentInterval) {
     aDependent.HandleNewInterval(*mCurrentInterval, GetTimeContainer());
   }
 }
 
-void SMILTimedElement::RemoveDependent(nsSMILTimeValueSpec& aDependent) {
+void SMILTimedElement::RemoveDependent(SMILTimeValueSpec& aDependent) {
   mTimeDependents.RemoveEntry(&aDependent);
 }
 
 bool SMILTimedElement::IsTimeDependent(const SMILTimedElement& aOther) const {
-  const nsSMILInstanceTime* thisBegin = GetEffectiveBeginInstance();
-  const nsSMILInstanceTime* otherBegin = aOther.GetEffectiveBeginInstance();
+  const SMILInstanceTime* thisBegin = GetEffectiveBeginInstance();
+  const SMILInstanceTime* otherBegin = aOther.GetEffectiveBeginInstance();
 
   if (!thisBegin || !otherBegin) return false;
 
   return thisBegin->IsDependentOn(*otherBegin);
 }
 
 void SMILTimedElement::BindToTree(Element& aContextElement) {
   // Reset previously registered milestone since we may be registering with
@@ -1091,44 +1091,44 @@ void SMILTimedElement::HandleTargetEleme
   for (uint32_t j = 0; j < count; ++j) {
     mEndSpecs[j]->HandleTargetElementChange(aNewTarget);
   }
 }
 
 void SMILTimedElement::Traverse(nsCycleCollectionTraversalCallback* aCallback) {
   uint32_t count = mBeginSpecs.Length();
   for (uint32_t i = 0; i < count; ++i) {
-    nsSMILTimeValueSpec* beginSpec = mBeginSpecs[i].get();
-    MOZ_ASSERT(beginSpec, "null nsSMILTimeValueSpec in list of begin specs");
+    SMILTimeValueSpec* beginSpec = mBeginSpecs[i].get();
+    MOZ_ASSERT(beginSpec, "null SMILTimeValueSpec in list of begin specs");
     beginSpec->Traverse(aCallback);
   }
 
   count = mEndSpecs.Length();
   for (uint32_t j = 0; j < count; ++j) {
-    nsSMILTimeValueSpec* endSpec = mEndSpecs[j].get();
-    MOZ_ASSERT(endSpec, "null nsSMILTimeValueSpec in list of end specs");
+    SMILTimeValueSpec* endSpec = mEndSpecs[j].get();
+    MOZ_ASSERT(endSpec, "null SMILTimeValueSpec in list of end specs");
     endSpec->Traverse(aCallback);
   }
 }
 
 void SMILTimedElement::Unlink() {
   AutoIntervalUpdateBatcher updateBatcher(*this);
 
   // Remove dependencies on other elements
   uint32_t count = mBeginSpecs.Length();
   for (uint32_t i = 0; i < count; ++i) {
-    nsSMILTimeValueSpec* beginSpec = mBeginSpecs[i].get();
-    MOZ_ASSERT(beginSpec, "null nsSMILTimeValueSpec in list of begin specs");
+    SMILTimeValueSpec* beginSpec = mBeginSpecs[i].get();
+    MOZ_ASSERT(beginSpec, "null SMILTimeValueSpec in list of begin specs");
     beginSpec->Unlink();
   }
 
   count = mEndSpecs.Length();
   for (uint32_t j = 0; j < count; ++j) {
-    nsSMILTimeValueSpec* endSpec = mEndSpecs[j].get();
-    MOZ_ASSERT(endSpec, "null nsSMILTimeValueSpec in list of end specs");
+    SMILTimeValueSpec* endSpec = mEndSpecs[j].get();
+    MOZ_ASSERT(endSpec, "null SMILTimeValueSpec in list of end specs");
     endSpec->Unlink();
   }
 
   ClearIntervals();
 
   // Make sure we don't notify other elements of new intervals
   mTimeDependents.Clear();
 }
@@ -1149,17 +1149,17 @@ nsresult SMILTimedElement::SetBeginOrEnd
 
   nsCharSeparatedTokenizer tokenizer(aSpec, ';');
   if (!tokenizer.hasMoreTokens()) {  // Empty list
     return NS_ERROR_FAILURE;
   }
 
   bool hadFailure = false;
   while (tokenizer.hasMoreTokens()) {
-    auto spec = MakeUnique<nsSMILTimeValueSpec>(*this, aIsBegin);
+    auto spec = MakeUnique<SMILTimeValueSpec>(*this, aIsBegin);
     nsresult rv = spec->SetSpec(tokenizer.nextToken(), aContextElement);
     if (NS_SUCCEEDED(rv)) {
       timeSpecsList.AppendElement(std::move(spec));
     } else {
       hadFailure = true;
     }
   }
 
@@ -1174,17 +1174,17 @@ namespace {
 // Adaptor functor for RemoveInstanceTimes that allows us to use function
 // pointers instead.
 // Without this we'd have to either templatize ClearSpecs and all its callers
 // or pass bool flags around to specify which removal function to use here.
 class MOZ_STACK_CLASS RemoveByFunction {
  public:
   explicit RemoveByFunction(SMILTimedElement::RemovalTestFunction aFunction)
       : mFunction(aFunction) {}
-  bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
+  bool operator()(SMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
     return mFunction(aInstanceTime);
   }
 
  private:
   SMILTimedElement::RemovalTestFunction mFunction;
 };
 }  // namespace
 
@@ -1211,61 +1211,61 @@ void SMILTimedElement::ClearIntervals() 
 
   // Remove old intervals
   for (int32_t i = mOldIntervals.Length() - 1; i >= 0; --i) {
     mOldIntervals[i]->Unlink();
   }
   mOldIntervals.Clear();
 }
 
-bool SMILTimedElement::ApplyEarlyEnd(const nsSMILTimeValue& aSampleTime) {
+bool SMILTimedElement::ApplyEarlyEnd(const SMILTimeValue& aSampleTime) {
   // This should only be called within DoSampleAt as a helper function
   MOZ_ASSERT(mElementState == STATE_ACTIVE,
              "Unexpected state to try to apply an early end");
 
   bool updated = false;
 
   // Only apply an early end if we're not already ending.
   if (mCurrentInterval->End()->Time() > aSampleTime) {
-    nsSMILInstanceTime* earlyEnd = CheckForEarlyEnd(aSampleTime);
+    SMILInstanceTime* earlyEnd = CheckForEarlyEnd(aSampleTime);
     if (earlyEnd) {
       if (earlyEnd->IsDependent()) {
         // Generate a new instance time for the early end since the
         // existing instance time is part of some dependency chain that we
         // don't want to participate in.
-        RefPtr<nsSMILInstanceTime> newEarlyEnd =
-            new nsSMILInstanceTime(earlyEnd->Time());
+        RefPtr<SMILInstanceTime> newEarlyEnd =
+            new SMILInstanceTime(earlyEnd->Time());
         mCurrentInterval->SetEnd(*newEarlyEnd);
       } else {
         mCurrentInterval->SetEnd(*earlyEnd);
       }
       updated = true;
     }
   }
   return updated;
 }
 
 namespace {
 class MOZ_STACK_CLASS RemoveReset {
  public:
-  explicit RemoveReset(const nsSMILInstanceTime* aCurrentIntervalBegin)
+  explicit RemoveReset(const SMILInstanceTime* aCurrentIntervalBegin)
       : mCurrentIntervalBegin(aCurrentIntervalBegin) {}
-  bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
+  bool operator()(SMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
     // SMIL 3.0 section 5.4.3, 'Resetting element state':
     //   Any instance times associated with past Event-values, Repeat-values,
     //   Accesskey-values or added via DOM method calls are removed from the
     //   dependent begin and end instance times lists. In effect, all events
     //   and DOM methods calls in the past are cleared. This does not apply to
     //   an instance time that defines the begin of the current interval.
     return aInstanceTime->IsDynamic() && !aInstanceTime->ShouldPreserve() &&
            (!mCurrentIntervalBegin || aInstanceTime != mCurrentIntervalBegin);
   }
 
  private:
-  const nsSMILInstanceTime* mCurrentIntervalBegin;
+  const SMILInstanceTime* mCurrentIntervalBegin;
 };
 }  // namespace
 
 void SMILTimedElement::Reset() {
   RemoveReset resetBegin(mCurrentInterval ? mCurrentInterval->Begin()
                                           : nullptr);
   RemoveInstanceTimes(mBeginInstances, resetBegin);
 
@@ -1350,22 +1350,22 @@ void SMILTimedElement::DoPostSeek() {
       break;
   }
 
   mSeekState = SEEK_NOT_SEEKING;
 }
 
 void SMILTimedElement::UnpreserveInstanceTimes(InstanceTimeList& aList) {
   const SMILInterval* prevInterval = GetPreviousInterval();
-  const nsSMILInstanceTime* cutoff =
+  const SMILInstanceTime* cutoff =
       mCurrentInterval ? mCurrentInterval->Begin()
                        : prevInterval ? prevInterval->Begin() : nullptr;
   uint32_t count = aList.Length();
   for (uint32_t i = 0; i < count; ++i) {
-    nsSMILInstanceTime* instance = aList[i].get();
+    SMILInstanceTime* instance = aList[i].get();
     if (!cutoff || cutoff->Time().CompareTo(instance->Time()) < 0) {
       instance->UnmarkShouldPreserve();
     }
   }
 }
 
 void SMILTimedElement::FilterHistory() {
   // We should filter the intervals first, since instance times still used in an
@@ -1420,43 +1420,43 @@ void SMILTimedElement::FilterIntervals()
   }
   mOldIntervals.Clear();
   mOldIntervals.SwapElements(filteredList);
 }
 
 namespace {
 class MOZ_STACK_CLASS RemoveFiltered {
  public:
-  explicit RemoveFiltered(nsSMILTimeValue aCutoff) : mCutoff(aCutoff) {}
-  bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
+  explicit RemoveFiltered(SMILTimeValue aCutoff) : mCutoff(aCutoff) {}
+  bool operator()(SMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
     // We can filter instance times that:
     // a) Precede the end point of the previous interval; AND
     // b) Are NOT syncbase times that might be updated to a time after the end
     //    point of the previous interval; AND
     // c) Are NOT fixed end points in any remaining interval.
     return aInstanceTime->Time() < mCutoff && aInstanceTime->IsFixedTime() &&
            !aInstanceTime->ShouldPreserve();
   }
 
  private:
-  nsSMILTimeValue mCutoff;
+  SMILTimeValue mCutoff;
 };
 
 class MOZ_STACK_CLASS RemoveBelowThreshold {
  public:
   RemoveBelowThreshold(uint32_t aThreshold,
-                       nsTArray<const nsSMILInstanceTime*>& aTimesToKeep)
+                       nsTArray<const SMILInstanceTime*>& aTimesToKeep)
       : mThreshold(aThreshold), mTimesToKeep(aTimesToKeep) {}
-  bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t aIndex) {
+  bool operator()(SMILInstanceTime* aInstanceTime, uint32_t aIndex) {
     return aIndex < mThreshold && !mTimesToKeep.Contains(aInstanceTime);
   }
 
  private:
   uint32_t mThreshold;
-  nsTArray<const nsSMILInstanceTime*>& mTimesToKeep;
+  nsTArray<const SMILInstanceTime*>& mTimesToKeep;
 };
 }  // namespace
 
 void SMILTimedElement::FilterInstanceTimes(InstanceTimeList& aList) {
   if (GetPreviousInterval()) {
     RemoveFiltered removeFiltered(GetPreviousInterval()->End()->Time());
     RemoveInstanceTimes(aList, removeFiltered);
   }
@@ -1468,17 +1468,17 @@ void SMILTimedElement::FilterInstanceTim
   // may prevent some events from being generated). Therefore we introduce
   // a hard cutoff at which point we just drop the oldest instance times.
   if (aList.Length() > sMaxNumInstanceTimes) {
     uint32_t threshold = aList.Length() - sMaxNumInstanceTimes;
     // There are a few instance times we should keep though, notably:
     // - the current interval begin time,
     // - the previous interval end time (see note in RemoveInstanceTimes)
     // - the first interval begin time (see note in FilterIntervals)
-    nsTArray<const nsSMILInstanceTime*> timesToKeep;
+    nsTArray<const SMILInstanceTime*> timesToKeep;
     if (mCurrentInterval) {
       timesToKeep.AppendElement(mCurrentInterval->Begin());
     }
     const SMILInterval* prevInterval = GetPreviousInterval();
     if (prevInterval) {
       timesToKeep.AppendElement(prevInterval->End());
     }
     if (!mOldIntervals.IsEmpty()) {
@@ -1490,51 +1490,52 @@ void SMILTimedElement::FilterInstanceTim
 }
 
 //
 // This method is based on the pseudocode given in the SMILANIM spec.
 //
 // See:
 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#Timing-BeginEnd-LC-Start
 //
-bool SMILTimedElement::GetNextInterval(
-    const SMILInterval* aPrevInterval, const SMILInterval* aReplacedInterval,
-    const nsSMILInstanceTime* aFixedBeginTime, SMILInterval& aResult) const {
+bool SMILTimedElement::GetNextInterval(const SMILInterval* aPrevInterval,
+                                       const SMILInterval* aReplacedInterval,
+                                       const SMILInstanceTime* aFixedBeginTime,
+                                       SMILInterval& aResult) const {
   MOZ_ASSERT(!aFixedBeginTime || aFixedBeginTime->Time().IsDefinite(),
              "Unresolved or indefinite begin time given for interval start");
-  static const nsSMILTimeValue zeroTime(0L);
+  static const SMILTimeValue zeroTime(0L);
 
   if (mRestartMode == RESTART_NEVER && aPrevInterval) return false;
 
   // Calc starting point
-  nsSMILTimeValue beginAfter;
+  SMILTimeValue beginAfter;
   bool prevIntervalWasZeroDur = false;
   if (aPrevInterval) {
     beginAfter = aPrevInterval->End()->Time();
     prevIntervalWasZeroDur =
         aPrevInterval->End()->Time() == aPrevInterval->Begin()->Time();
   } else {
     beginAfter.SetMillis(INT64_MIN);
   }
 
-  RefPtr<nsSMILInstanceTime> tempBegin;
-  RefPtr<nsSMILInstanceTime> tempEnd;
+  RefPtr<SMILInstanceTime> tempBegin;
+  RefPtr<SMILInstanceTime> tempEnd;
 
   while (true) {
     // Calculate begin time
     if (aFixedBeginTime) {
       if (aFixedBeginTime->Time() < beginAfter) {
         return false;
       }
       // our ref-counting is not const-correct
-      tempBegin = const_cast<nsSMILInstanceTime*>(aFixedBeginTime);
+      tempBegin = const_cast<SMILInstanceTime*>(aFixedBeginTime);
     } else if ((!mAnimationElement ||
                 !mAnimationElement->HasAttr(nsGkAtoms::begin)) &&
                beginAfter <= zeroTime) {
-      tempBegin = new nsSMILInstanceTime(nsSMILTimeValue(0));
+      tempBegin = new SMILInstanceTime(SMILTimeValue(0));
     } else {
       int32_t beginPos = 0;
       do {
         tempBegin =
             GetNextGreaterOrEqual(mBeginInstances, beginAfter, beginPos);
         if (!tempBegin || !tempBegin->Time().IsDefinite()) {
           return false;
         }
@@ -1599,22 +1600,21 @@ bool SMILTimedElement::GetNextInterval(
             (aReplacedInterval &&
              AreEndTimesDependentOn(aReplacedInterval->End()));
 
         if (!openEndedIntervalOk) {
           return false;  // Bad interval
         }
       }
 
-      nsSMILTimeValue intervalEnd =
-          tempEnd ? tempEnd->Time() : nsSMILTimeValue();
-      nsSMILTimeValue activeEnd = CalcActiveEnd(tempBegin->Time(), intervalEnd);
+      SMILTimeValue intervalEnd = tempEnd ? tempEnd->Time() : SMILTimeValue();
+      SMILTimeValue activeEnd = CalcActiveEnd(tempBegin->Time(), intervalEnd);
 
       if (!tempEnd || intervalEnd != activeEnd) {
-        tempEnd = new nsSMILInstanceTime(activeEnd);
+        tempEnd = new SMILInstanceTime(activeEnd);
       }
     }
     MOZ_ASSERT(tempEnd, "Failed to get end point for next interval");
 
     // When we choose the interval endpoints, we don't allow coincident
     // zero-duration intervals, so if we arrive here and we have a zero-duration
     // interval starting at the same point as a previous zero-duration interval,
     // then it must be because we've applied constraints to the active duration.
@@ -1644,49 +1644,49 @@ bool SMILTimedElement::GetNextInterval(
 
     beginAfter = tempEnd->Time();
   }
   MOZ_ASSERT_UNREACHABLE("Hmm... we really shouldn't be here");
 
   return false;
 }
 
-nsSMILInstanceTime* SMILTimedElement::GetNextGreater(
-    const InstanceTimeList& aList, const nsSMILTimeValue& aBase,
+SMILInstanceTime* SMILTimedElement::GetNextGreater(
+    const InstanceTimeList& aList, const SMILTimeValue& aBase,
     int32_t& aPosition) const {
-  nsSMILInstanceTime* result = nullptr;
+  SMILInstanceTime* result = nullptr;
   while ((result = GetNextGreaterOrEqual(aList, aBase, aPosition)) &&
          result->Time() == aBase) {
   }
   return result;
 }
 
-nsSMILInstanceTime* SMILTimedElement::GetNextGreaterOrEqual(
-    const InstanceTimeList& aList, const nsSMILTimeValue& aBase,
+SMILInstanceTime* SMILTimedElement::GetNextGreaterOrEqual(
+    const InstanceTimeList& aList, const SMILTimeValue& aBase,
     int32_t& aPosition) const {
-  nsSMILInstanceTime* result = nullptr;
+  SMILInstanceTime* result = nullptr;
   int32_t count = aList.Length();
 
   for (; aPosition < count && !result; ++aPosition) {
-    nsSMILInstanceTime* val = aList[aPosition].get();
+    SMILInstanceTime* val = aList[aPosition].get();
     MOZ_ASSERT(val, "NULL instance time in list");
     if (val->Time() >= aBase) {
       result = val;
     }
   }
 
   return result;
 }
 
 /**
  * @see SMILANIM 3.3.4
  */
-nsSMILTimeValue SMILTimedElement::CalcActiveEnd(
-    const nsSMILTimeValue& aBegin, const nsSMILTimeValue& aEnd) const {
-  nsSMILTimeValue result;
+SMILTimeValue SMILTimedElement::CalcActiveEnd(const SMILTimeValue& aBegin,
+                                              const SMILTimeValue& aEnd) const {
+  SMILTimeValue result;
 
   MOZ_ASSERT(mSimpleDur.IsResolved(),
              "Unresolved simple duration in CalcActiveEnd");
   MOZ_ASSERT(aBegin.IsDefinite(),
              "Indefinite or unresolved begin time in CalcActiveEnd");
 
   result = GetRepeatDuration();
 
@@ -1705,52 +1705,52 @@ nsSMILTimeValue SMILTimedElement::CalcAc
   if (result.IsDefinite()) {
     nsSMILTime activeEnd = result.GetMillis() + aBegin.GetMillis();
     result.SetMillis(activeEnd);
   }
 
   return result;
 }
 
-nsSMILTimeValue SMILTimedElement::GetRepeatDuration() const {
-  nsSMILTimeValue multipliedDuration;
+SMILTimeValue SMILTimedElement::GetRepeatDuration() const {
+  SMILTimeValue multipliedDuration;
   if (mRepeatCount.IsDefinite() && mSimpleDur.IsDefinite()) {
     if (mRepeatCount * double(mSimpleDur.GetMillis()) <=
         std::numeric_limits<nsSMILTime>::max()) {
       multipliedDuration.SetMillis(
           nsSMILTime(mRepeatCount * mSimpleDur.GetMillis()));
     }
   } else {
     multipliedDuration.SetIndefinite();
   }
 
-  nsSMILTimeValue repeatDuration;
+  SMILTimeValue repeatDuration;
 
   if (mRepeatDur.IsResolved()) {
     repeatDuration = std::min(multipliedDuration, mRepeatDur);
   } else if (mRepeatCount.IsSet()) {
     repeatDuration = multipliedDuration;
   } else {
     repeatDuration = mSimpleDur;
   }
 
   return repeatDuration;
 }
 
-nsSMILTimeValue SMILTimedElement::ApplyMinAndMax(
-    const nsSMILTimeValue& aDuration) const {
+SMILTimeValue SMILTimedElement::ApplyMinAndMax(
+    const SMILTimeValue& aDuration) const {
   if (!aDuration.IsResolved()) {
     return aDuration;
   }
 
   if (mMax < mMin) {
     return aDuration;
   }
 
-  nsSMILTimeValue result;
+  SMILTimeValue result;
 
   if (aDuration > mMax) {
     result = mMax;
   } else if (aDuration < mMin) {
     result = mMin;
   } else {
     result = aDuration;
   }
@@ -1786,24 +1786,24 @@ nsSMILTime SMILTimedElement::ActiveTimeT
 // moment. In particular, this paragraph from section 3.6.8:
 //
 // 'If restart  is set to "always", then the current interval will end early if
 // there is an instance time in the begin list that is before (i.e. earlier
 // than) the defined end for the current interval. Ending in this manner will
 // also send a changed time notice to all time dependents for the current
 // interval end.'
 //
-nsSMILInstanceTime* SMILTimedElement::CheckForEarlyEnd(
-    const nsSMILTimeValue& aContainerTime) const {
+SMILInstanceTime* SMILTimedElement::CheckForEarlyEnd(
+    const SMILTimeValue& aContainerTime) const {
   MOZ_ASSERT(mCurrentInterval,
              "Checking for an early end but the current interval is not set");
   if (mRestartMode != RESTART_ALWAYS) return nullptr;
 
   int32_t position = 0;
-  nsSMILInstanceTime* nextBegin = GetNextGreater(
+  SMILInstanceTime* nextBegin = GetNextGreater(
       mBeginInstances, mCurrentInterval->Begin()->Time(), position);
 
   if (nextBegin && nextBegin->Time() > mCurrentInterval->Begin()->Time() &&
       nextBegin->Time() < mCurrentInterval->End()->Time() &&
       nextBegin->Time() <= aContainerTime) {
     return nextBegin;
   }
 
@@ -1852,17 +1852,17 @@ void SMILTimedElement::UpdateCurrentInte
   AutoRestore<uint8_t> depthRestorer(mUpdateIntervalRecursionDepth);
   if (++mUpdateIntervalRecursionDepth > sMaxUpdateIntervalRecursionDepth) {
     MOZ_ASSERT(false,
                "Update current interval recursion depth exceeded threshold");
     return;
   }
 
   // If the interval is active the begin time is fixed.
-  const nsSMILInstanceTime* beginTime =
+  const SMILInstanceTime* beginTime =
       mElementState == STATE_ACTIVE ? mCurrentInterval->Begin() : nullptr;
   SMILInterval updatedInterval;
   if (GetNextInterval(GetPreviousInterval(), mCurrentInterval.get(), beginTime,
                       updatedInterval)) {
     if (mElementState == STATE_POSTACTIVE) {
       MOZ_ASSERT(!mCurrentInterval,
                  "In postactive state but the interval has been set");
       mCurrentInterval = MakeUnique<SMILInterval>(updatedInterval);
@@ -1939,17 +1939,17 @@ void SMILTimedElement::SampleFillValue()
                "previous interval is not resolved and fixed");
 
     activeTime = prevInterval->End()->Time().GetMillis() -
                  prevInterval->Begin()->Time().GetMillis();
 
     // If the interval's repeat duration was shorter than its active duration,
     // use the end of the repeat duration to determine the frozen animation's
     // state.
-    nsSMILTimeValue repeatDuration = GetRepeatDuration();
+    SMILTimeValue repeatDuration = GetRepeatDuration();
     if (repeatDuration.IsDefinite()) {
       activeTime = std::min(repeatDuration.GetMillis(), activeTime);
     }
   } else {
     MOZ_ASSERT(
         mElementState == STATE_ACTIVE,
         "Attempting to sample fill value when we're in an unexpected state "
         "(probably STATE_STARTUP)");
@@ -1975,20 +1975,20 @@ void SMILTimedElement::SampleFillValue()
 nsresult SMILTimedElement::AddInstanceTimeFromCurrentTime(
     nsSMILTime aCurrentTime, double aOffsetSeconds, bool aIsBegin) {
   double offset = NS_round(aOffsetSeconds * PR_MSEC_PER_SEC);
 
   // Check we won't overflow the range of nsSMILTime
   if (aCurrentTime + offset > std::numeric_limits<nsSMILTime>::max())
     return NS_ERROR_ILLEGAL_VALUE;
 
-  nsSMILTimeValue timeVal(aCurrentTime + int64_t(offset));
+  SMILTimeValue timeVal(aCurrentTime + int64_t(offset));
 
-  RefPtr<nsSMILInstanceTime> instanceTime =
-      new nsSMILInstanceTime(timeVal, nsSMILInstanceTime::SOURCE_DOM);
+  RefPtr<SMILInstanceTime> instanceTime =
+      new SMILInstanceTime(timeVal, SMILInstanceTime::SOURCE_DOM);
 
   AddInstanceTime(instanceTime, aIsBegin);
 
   return NS_OK;
 }
 
 void SMILTimedElement::RegisterMilestone() {
   SMILTimeContainer* container = GetTimeContainer();
@@ -2037,31 +2037,31 @@ bool SMILTimedElement::GetNextMilestone(
       MOZ_ASSERT(mCurrentInterval,
                  "In waiting state but the current interval has not been set");
       aNextMilestone.mIsEnd = false;
       aNextMilestone.mTime = mCurrentInterval->Begin()->Time().GetMillis();
       return true;
 
     case STATE_ACTIVE: {
       // Work out what comes next: the interval end or the next repeat iteration
-      nsSMILTimeValue nextRepeat;
+      SMILTimeValue nextRepeat;
       if (mSeekState == SEEK_NOT_SEEKING && mSimpleDur.IsDefinite()) {
         nsSMILTime nextRepeatActiveTime =
             (mCurrentRepeatIteration + 1) * mSimpleDur.GetMillis();
         // Check that the repeat fits within the repeat duration
-        if (nsSMILTimeValue(nextRepeatActiveTime) < GetRepeatDuration()) {
+        if (SMILTimeValue(nextRepeatActiveTime) < GetRepeatDuration()) {
           nextRepeat.SetMillis(mCurrentInterval->Begin()->Time().GetMillis() +
                                nextRepeatActiveTime);
         }
       }
-      nsSMILTimeValue nextMilestone =
+      SMILTimeValue nextMilestone =
           std::min(mCurrentInterval->End()->Time(), nextRepeat);
 
       // Check for an early end before that time
-      nsSMILInstanceTime* earlyEnd = CheckForEarlyEnd(nextMilestone);
+      SMILInstanceTime* earlyEnd = CheckForEarlyEnd(nextMilestone);
       if (earlyEnd) {
         aNextMilestone.mIsEnd = true;
         aNextMilestone.mTime = earlyEnd->Time().GetMillis();
         return true;
       }
 
       // Apply the previously calculated milestone
       if (nextMilestone.IsDefinite()) {
@@ -2093,17 +2093,17 @@ void SMILTimedElement::NotifyNewInterval
     SMILInterval* interval = mCurrentInterval.get();
     // It's possible that in notifying one new time dependent of a new interval
     // that a chain reaction is triggered which results in the original
     // interval disappearing. If that's the case we can skip sending further
     // notifications.
     if (!interval) {
       break;
     }
-    nsSMILTimeValueSpec* spec = iter.Get()->GetKey();
+    SMILTimeValueSpec* spec = iter.Get()->GetKey();
     spec->HandleNewInterval(*interval, container);
   }
 }
 
 void SMILTimedElement::NotifyChangedInterval(SMILInterval* aInterval,
                                              bool aBeginObjectChanged,
                                              bool aEndObjectChanged) {
   MOZ_ASSERT(aInterval, "Null interval for change notification");
@@ -2128,17 +2128,17 @@ void SMILTimedElement::NotifyChangedInte
 void SMILTimedElement::FireTimeEventAsync(EventMessage aMsg, int32_t aDetail) {
   if (!mAnimationElement) return;
 
   nsCOMPtr<nsIRunnable> event =
       new AsyncTimeEventRunner(mAnimationElement, aMsg, aDetail);
   mAnimationElement->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget());
 }
 
-const nsSMILInstanceTime* SMILTimedElement::GetEffectiveBeginInstance() const {
+const SMILInstanceTime* SMILTimedElement::GetEffectiveBeginInstance() const {
   switch (mElementState) {
     case STATE_STARTUP:
       return nullptr;
 
     case STATE_ACTIVE:
       return mCurrentInterval->Begin();
 
     case STATE_WAITING:
@@ -2165,17 +2165,17 @@ bool SMILTimedElement::HasClientInFillRa
 bool SMILTimedElement::EndHasEventConditions() const {
   for (uint32_t i = 0; i < mEndSpecs.Length(); ++i) {
     if (mEndSpecs[i]->IsEventBased()) return true;
   }
   return false;
 }
 
 bool SMILTimedElement::AreEndTimesDependentOn(
-    const nsSMILInstanceTime* aBase) const {
+    const SMILInstanceTime* aBase) const {
   if (mEndInstances.IsEmpty()) return false;
 
   for (uint32_t i = 0; i < mEndInstances.Length(); ++i) {
     if (mEndInstances[i]->GetBaseTime() != aBase) {
       return false;
     }
   }
   return true;
--- a/dom/smil/SMILTimedElement.h
+++ b/dom/smil/SMILTimedElement.h
@@ -5,34 +5,36 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILTIMEDELEMENT_H_
 #define NS_SMILTIMEDELEMENT_H_
 
 #include "mozilla/EventForwards.h"
 #include "mozilla/Move.h"
 #include "mozilla/SMILMilestone.h"
+#include "mozilla/SMILInstanceTime.h"
 #include "mozilla/SMILInterval.h"
 #include "mozilla/SMILRepeatCount.h"
+#include "mozilla/SMILTimeValueSpec.h"
 #include "mozilla/UniquePtr.h"
-#include "nsSMILInstanceTime.h"
-#include "nsSMILTimeValueSpec.h"
 #include "nsSMILTypes.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "nsAutoPtr.h"
 #include "nsAttrValue.h"
 
-class nsSMILTimeValue;
 class nsAtom;
 
 namespace mozilla {
+
 class SMILAnimationFunction;
 class SMILTimeContainer;
+class SMILTimeValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 //----------------------------------------------------------------------
 // SMILTimedElement
 
 class SMILTimedElement {
@@ -92,24 +94,24 @@ class SMILTimedElement {
    * According to SVG 1.1 SE this returns
    *
    *   the begin time, in seconds, for this animation element's current
    *   interval, if it exists, regardless of whether the interval has begun yet.
    *
    * @return the start time as defined above in milliseconds or an unresolved
    * time if there is no current interval.
    */
-  nsSMILTimeValue GetStartTime() const;
+  SMILTimeValue GetStartTime() const;
 
   /**
    * Returns the simple duration of this element.
    *
    * @return the simple duration in milliseconds or INDEFINITE.
    */
-  nsSMILTimeValue GetSimpleDuration() const { return mSimpleDur; }
+  SMILTimeValue GetSimpleDuration() const { return mSimpleDur; }
 
   /**
    * Methods for supporting hyperlinking
    */
 
   /**
    * Internal SMIL methods
    */
@@ -122,68 +124,68 @@ class SMILTimedElement {
    *   http://www.w3.org/TR/smil-animation/#HyperlinkSemantics
    *
    * It is very similar to GetStartTime() with the exception that when the
    * element is not active, the begin time of the *first* interval is returned.
    *
    * @return the time to seek the documen to in milliseconds or an unresolved
    * time if there is no resolved interval.
    */
-  nsSMILTimeValue GetHyperlinkTime() const;
+  SMILTimeValue GetHyperlinkTime() const;
 
   /**
    * Adds an instance time object this element's list of instance times.
    * These instance times are used when creating intervals.
    *
-   * This method is typically called by an nsSMILTimeValueSpec.
+   * This method is typically called by an SMILTimeValueSpec.
    *
    * @param aInstanceTime   The time to add, expressed in container time.
    * @param aIsBegin        true if the time to be added represents a begin
    *                        time or false if it represents an end time.
    */
-  void AddInstanceTime(nsSMILInstanceTime* aInstanceTime, bool aIsBegin);
+  void AddInstanceTime(SMILInstanceTime* aInstanceTime, bool aIsBegin);
 
   /**
    * Requests this element update the given instance time.
    *
-   * This method is typically called by a child nsSMILTimeValueSpec.
+   * This method is typically called by a child SMILTimeValueSpec.
    *
    * @param aInstanceTime   The instance time to update.
    * @param aUpdatedTime    The time to update aInstanceTime with.
    * @param aDependentTime  The instance time upon which aInstanceTime should be
    *                        based.
    * @param aIsBegin        true if the time to be updated represents a begin
    *                        instance time or false if it represents an end
    *                        instance time.
    */
-  void UpdateInstanceTime(nsSMILInstanceTime* aInstanceTime,
-                          nsSMILTimeValue& aUpdatedTime, bool aIsBegin);
+  void UpdateInstanceTime(SMILInstanceTime* aInstanceTime,
+                          SMILTimeValue& aUpdatedTime, bool aIsBegin);
 
   /**
    * Removes an instance time object from this element's list of instance times.
    *
-   * This method is typically called by a child nsSMILTimeValueSpec.
+   * This method is typically called by a child SMILTimeValueSpec.
    *
    * @param aInstanceTime   The instance time to remove.
    * @param aIsBegin        true if the time to be removed represents a begin
    *                        time or false if it represents an end time.
    */
-  void RemoveInstanceTime(nsSMILInstanceTime* aInstanceTime, bool aIsBegin);
+  void RemoveInstanceTime(SMILInstanceTime* aInstanceTime, bool aIsBegin);
 
   /**
    * Removes all the instance times associated with the given
-   * nsSMILTimeValueSpec object. Used when an ID assignment changes and hence
+   * SMILTimeValueSpec object. Used when an ID assignment changes and hence
    * all the previously associated instance times become invalid.
    *
-   * @param aSpec    The nsSMILTimeValueSpec object whose created
-   *                 nsSMILInstanceTime's should be removed.
+   * @param aSpec    The SMILTimeValueSpec object whose created
+   *                 SMILInstanceTime's should be removed.
    * @param aIsBegin true if the times to be removed represent begin
    *                 times or false if they are end times.
    */
-  void RemoveInstanceTimesForCreator(const nsSMILTimeValueSpec* aSpec,
+  void RemoveInstanceTimesForCreator(const SMILTimeValueSpec* aSpec,
                                      bool aIsBegin);
 
   /**
    * Sets the object that will be called by this timed element each time it is
    * sampled.
    *
    * In Schmitz's model it is possible to associate several time clients with
    * a timed element but for now we only allow one.
@@ -282,30 +284,30 @@ class SMILTimedElement {
    * otherwise.
    */
   bool UnsetAttr(nsAtom* aAttribute);
 
   /**
    * Adds a syncbase dependency to the list of dependents that will be notified
    * when this timed element creates, deletes, or updates its current interval.
    *
-   * @param aDependent  The nsSMILTimeValueSpec object to notify. A raw pointer
+   * @param aDependent  The SMILTimeValueSpec object to notify. A raw pointer
    *                    to this object will be stored. Therefore it is necessary
    *                    for the object to be explicitly unregistered (with
    *                    RemoveDependent) when it is destroyed.
    */
-  void AddDependent(nsSMILTimeValueSpec& aDependent);
+  void AddDependent(SMILTimeValueSpec& aDependent);
 
   /**
    * Removes a syncbase dependency from the list of dependents that are notified
    * when the current interval is modified.
    *
-   * @param aDependent  The nsSMILTimeValueSpec object to unregister.
+   * @param aDependent  The SMILTimeValueSpec object to unregister.
    */
-  void RemoveDependent(nsSMILTimeValueSpec& aDependent);
+  void RemoveDependent(SMILTimeValueSpec& aDependent);
 
   /**
    * Determines if this timed element is dependent on the given timed element's
    * begin time for the interval currently in effect. Whilst the element is in
    * the active state this is the current interval and in the postactive or
    * waiting state this is the previous interval if one exists. In all other
    * cases the element is not considered a time dependent of any other element.
    *
@@ -337,33 +339,33 @@ class SMILTimedElement {
    * references to other elements can be broken.
    */
   void DissolveReferences() { Unlink(); }
 
   // Cycle collection
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
   void Unlink();
 
-  typedef bool (*RemovalTestFunction)(nsSMILInstanceTime* aInstance);
+  typedef bool (*RemovalTestFunction)(SMILInstanceTime* aInstance);
 
  protected:
   // Typedefs
-  typedef nsTArray<UniquePtr<nsSMILTimeValueSpec>> TimeValueSpecList;
-  typedef nsTArray<RefPtr<nsSMILInstanceTime>> InstanceTimeList;
+  typedef nsTArray<UniquePtr<SMILTimeValueSpec>> TimeValueSpecList;
+  typedef nsTArray<RefPtr<SMILInstanceTime>> InstanceTimeList;
   typedef nsTArray<UniquePtr<SMILInterval>> IntervalList;
-  typedef nsPtrHashKey<nsSMILTimeValueSpec> TimeValueSpecPtrKey;
+  typedef nsPtrHashKey<SMILTimeValueSpec> TimeValueSpecPtrKey;
   typedef nsTHashtable<TimeValueSpecPtrKey> TimeValueSpecHashSet;
 
   // Helper classes
   class InstanceTimeComparator {
    public:
-    bool Equals(const nsSMILInstanceTime* aElem1,
-                const nsSMILInstanceTime* aElem2) const;
-    bool LessThan(const nsSMILInstanceTime* aElem1,
-                  const nsSMILInstanceTime* aElem2) const;
+    bool Equals(const SMILInstanceTime* aElem1,
+                const SMILInstanceTime* aElem2) const;
+    bool LessThan(const SMILInstanceTime* aElem1,
+                  const SMILInstanceTime* aElem2) const;
   };
 
   // Templated helper functions
   template <class TestFunctor>
   void RemoveInstanceTimes(InstanceTimeList& aArray, TestFunctor& aTest);
 
   //
   // Implementation helpers
@@ -407,17 +409,17 @@ class SMILTimedElement {
    *
    * @param aSampleTime The current sample time. Early ends should only be
    *                    applied at the last possible moment (i.e. if they are at
    *                    or before the current sample time) and only if the
    *                    current interval is not already ending.
    * @return true if the end time of the current interval was updated,
    *         false otherwise.
    */
-  bool ApplyEarlyEnd(const nsSMILTimeValue& aSampleTime);
+  bool ApplyEarlyEnd(const SMILTimeValue& aSampleTime);
 
   /**
    * Clears certain state in response to the element restarting.
    *
    * This state is described in SMIL 3.0, section 5.4.3, Resetting element state
    */
   void Reset();
 
@@ -461,17 +463,17 @@ class SMILTimedElement {
    * Helper function to iterate through this element's accumulated timing
    * information (specifically old SMILIntervals and nsSMILTimeInstanceTimes)
    * and discard items that are no longer needed or exceed some threshold of
    * accumulated state.
    */
   void FilterHistory();
 
   // Helper functions for FilterHistory to clear old SMILIntervals and
-  // nsSMILInstanceTimes respectively.
+  // SMILInstanceTimes respectively.
   void FilterIntervals();
   void FilterInstanceTimes(InstanceTimeList& aList);
 
   /**
    * Calculates the next acceptable interval for this element after the
    * specified interval, or, if no previous interval is specified, it will be
    * the first interval with an end time after t=0.
    *
@@ -489,32 +491,31 @@ class SMILTimedElement {
    *                        the ACTIVE state. May be nullptr.
    * @param[out] aResult    The next interval. Will be unchanged if no suitable
    *                        interval was found (in which case false will be
    *                        returned).
    * @return  true if a suitable interval was found, false otherwise.
    */
   bool GetNextInterval(const SMILInterval* aPrevInterval,
                        const SMILInterval* aReplacedInterval,
-                       const nsSMILInstanceTime* aFixedBeginTime,
+                       const SMILInstanceTime* aFixedBeginTime,
                        SMILInterval& aResult) const;
-  nsSMILInstanceTime* GetNextGreater(const InstanceTimeList& aList,
-                                     const nsSMILTimeValue& aBase,
-                                     int32_t& aPosition) const;
-  nsSMILInstanceTime* GetNextGreaterOrEqual(const InstanceTimeList& aList,
-                                            const nsSMILTimeValue& aBase,
-                                            int32_t& aPosition) const;
-  nsSMILTimeValue CalcActiveEnd(const nsSMILTimeValue& aBegin,
-                                const nsSMILTimeValue& aEnd) const;
-  nsSMILTimeValue GetRepeatDuration() const;
-  nsSMILTimeValue ApplyMinAndMax(const nsSMILTimeValue& aDuration) const;
+  SMILInstanceTime* GetNextGreater(const InstanceTimeList& aList,
+                                   const SMILTimeValue& aBase,
+                                   int32_t& aPosition) const;
+  SMILInstanceTime* GetNextGreaterOrEqual(const InstanceTimeList& aList,
+                                          const SMILTimeValue& aBase,
+                                          int32_t& aPosition) const;
+  SMILTimeValue CalcActiveEnd(const SMILTimeValue& aBegin,
+                              const SMILTimeValue& aEnd) const;
+  SMILTimeValue GetRepeatDuration() const;
+  SMILTimeValue ApplyMinAndMax(const SMILTimeValue& aDuration) const;
   nsSMILTime ActiveTimeToSimpleTime(nsSMILTime aActiveTime,
                                     uint32_t& aRepeatIteration);
-  nsSMILInstanceTime* CheckForEarlyEnd(
-      const nsSMILTimeValue& aContainerTime) const;
+  SMILInstanceTime* CheckForEarlyEnd(const SMILTimeValue& aContainerTime) const;
   void UpdateCurrentInterval(bool aForceChangeNotice = false);
   void SampleSimpleTime(nsSMILTime aActiveTime);
   void SampleFillValue();
   nsresult AddInstanceTimeFromCurrentTime(nsSMILTime aCurrentTime,
                                           double aOffsetSeconds, bool aIsBegin);
   void RegisterMilestone();
   bool GetNextMilestone(SMILMilestone& aNextMilestone) const;
 
@@ -524,22 +525,22 @@ class SMILTimedElement {
   //      a consistent state to receive callbacks, and
   // (ii) after calling these methods we must assume that the state of the
   //      element may have changed.
   void NotifyNewInterval();
   void NotifyChangedInterval(SMILInterval* aInterval, bool aBeginObjectChanged,
                              bool aEndObjectChanged);
 
   void FireTimeEventAsync(EventMessage aMsg, int32_t aDetail);
-  const nsSMILInstanceTime* GetEffectiveBeginInstance() const;
+  const SMILInstanceTime* GetEffectiveBeginInstance() const;
   const SMILInterval* GetPreviousInterval() const;
   bool HasPlayed() const { return !mOldIntervals.IsEmpty(); }
   bool HasClientInFillRange() const;
   bool EndHasEventConditions() const;
-  bool AreEndTimesDependentOn(const nsSMILInstanceTime* aBase) const;
+  bool AreEndTimesDependentOn(const SMILInstanceTime* aBase) const;
 
   // Reset the current interval by first passing ownership to a temporary
   // variable so that if Unlink() results in us receiving a callback,
   // mCurrentInterval will be nullptr and we will be in a consistent state.
   void ResetCurrentInterval() {
     if (mCurrentInterval) {
       // Transfer ownership to temp var. (This sets mCurrentInterval to null.)
       auto interval = std::move(mCurrentInterval);
@@ -550,23 +551,23 @@ class SMILTimedElement {
   //
   // Members
   //
   mozilla::dom::SVGAnimationElement* mAnimationElement;  // [weak] won't outlive
                                                          // owner
   TimeValueSpecList mBeginSpecs;                         // [strong]
   TimeValueSpecList mEndSpecs;                           // [strong]
 
-  nsSMILTimeValue mSimpleDur;
+  SMILTimeValue mSimpleDur;
 
   SMILRepeatCount mRepeatCount;
-  nsSMILTimeValue mRepeatDur;
+  SMILTimeValue mRepeatDur;
 
-  nsSMILTimeValue mMin;
-  nsSMILTimeValue mMax;
+  SMILTimeValue mMin;
+  SMILTimeValue mMax;
 
   enum nsSMILFillMode : uint8_t { FILL_REMOVE, FILL_FREEZE };
   nsSMILFillMode mFillMode;
   static const nsAttrValue::EnumTable sFillModeTable[];
 
   enum nsSMILRestartMode : uint8_t {
     RESTART_ALWAYS,
     RESTART_WHENNOTACTIVE,
@@ -587,17 +588,17 @@ class SMILTimedElement {
   static const SMILMilestone sMaxMilestone;
   static const uint8_t sMaxNumIntervals;
   static const uint8_t sMaxNumInstanceTimes;
 
   // Set of dependent time value specs to be notified when establishing a new
   // current interval. Change notifications and delete notifications are handled
   // by the interval.
   //
-  // [weak] The nsSMILTimeValueSpec objects register themselves and unregister
+  // [weak] The SMILTimeValueSpec objects register themselves and unregister
   // on destruction. Likewise, we notify them when we are destroyed.
   TimeValueSpecHashSet mTimeDependents;
 
   /**
    * The state of the element in its life-cycle. These states are based on the
    * element life-cycle described in SMILANIM 3.6.8
    */
   enum nsSMILElementState {
--- a/dom/smil/moz.build
+++ b/dom/smil/moz.build
@@ -6,69 +6,69 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "SVG")
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 
 EXPORTS += [
     'nsISMILAttr.h',
-    'nsSMILInstanceTime.h',
-    'nsSMILTimeValue.h',
-    'nsSMILTimeValueSpec.h',
-    'nsSMILTimeValueSpecParams.h',
     'nsSMILTypes.h',
     'nsSMILValue.h',
 ]
 
 EXPORTS.mozilla += [
     'SMILAnimationController.h',
     'SMILAnimationFunction.h',
     'SMILCompositorTable.h',
     'SMILCSSValueType.h',
+    'SMILInstanceTime.h',
     'SMILInterval.h',
     'SMILKeySpline.h',
     'SMILMilestone.h',
     'SMILNullType.h',
     'SMILParserUtils.h',
     'SMILRepeatCount.h',
     'SMILSetAnimationFunction.h',
     'SMILTargetIdentifier.h',
     'SMILTimeContainer.h',
     'SMILTimedElement.h',
+    'SMILTimeValue.h',
+    'SMILTimeValueSpec.h',
+    'SMILTimeValueSpecParams.h',
     'SMILType.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'TimeEvent.h',
 ]
 
 UNIFIED_SOURCES += [
-    'nsSMILInstanceTime.cpp',
-    'nsSMILTimeValue.cpp',
-    'nsSMILTimeValueSpec.cpp',
     'nsSMILValue.cpp',
     'SMILAnimationController.cpp',
     'SMILAnimationFunction.cpp',
     'SMILBoolType.cpp',
     'SMILCompositor.cpp',
     'SMILCSSProperty.cpp',
     'SMILCSSValueType.cpp',
     'SMILEnumType.cpp',
     'SMILFloatType.cpp',
+    'SMILInstanceTime.cpp',
     'SMILIntegerType.cpp',
     'SMILInterval.cpp',
     'SMILKeySpline.cpp',
     'SMILNullType.cpp',
     'SMILParserUtils.cpp',
     'SMILRepeatCount.cpp',
     'SMILSetAnimationFunction.cpp',
     'SMILStringType.cpp',
     'SMILTimeContainer.cpp',
     'SMILTimedElement.cpp',
+    'SMILTimeValue.cpp',
+    'SMILTimeValueSpec.cpp',
     'TimeEvent.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/svg',
     '/layout/base',
     '/layout/style',
--- a/dom/smil/nsSMILTypes.h
+++ b/dom/smil/nsSMILTypes.h
@@ -14,13 +14,13 @@
 // A time may represent:
 //
 //   simple time -- offset within the simple duration
 //   active time -- offset within the active duration
 //   document time -- offset since the document begin
 //   wallclock time -- "real" time -- offset since the epoch
 //
 // For an overview of how this class is related to other SMIL time classes see
-// the documentstation in nsSMILTimeValue.h
+// the documentation in SMILTimeValue.h
 //
 typedef int64_t nsSMILTime;
 
 #endif  // NS_SMILTYPES_H_
--- a/dom/svg/SVGAnimationElement.cpp
+++ b/dom/svg/SVGAnimationElement.cpp
@@ -93,17 +93,17 @@ SVGElement* SVGAnimationElement::GetTarg
 
   return (target && target->IsSVGElement()) ? static_cast<SVGElement*>(target)
                                             : nullptr;
 }
 
 float SVGAnimationElement::GetStartTime(ErrorResult& rv) {
   FlushAnimations();
 
-  nsSMILTimeValue startTime = mTimedElement.GetStartTime();
+  SMILTimeValue startTime = mTimedElement.GetStartTime();
   if (!startTime.IsDefinite()) {
     rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return 0.f;
   }
 
   return float(double(startTime.GetMillis()) / PR_MSEC_PER_SEC);
 }
 
@@ -116,17 +116,17 @@ float SVGAnimationElement::GetCurrentTim
   }
 
   return 0.0f;
 }
 
 float SVGAnimationElement::GetSimpleDuration(ErrorResult& rv) {
   // Not necessary to call FlushAnimations() for this
 
-  nsSMILTimeValue simpleDur = mTimedElement.GetSimpleDuration();
+  SMILTimeValue simpleDur = mTimedElement.GetSimpleDuration();
   if (!simpleDur.IsDefinite()) {
     rv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
     return 0.f;
   }
 
   return float(double(simpleDur.GetMillis()) / PR_MSEC_PER_SEC);
 }
 
@@ -292,17 +292,17 @@ bool SVGAnimationElement::IsNodeOfType(u
 // SVG utility methods
 
 void SVGAnimationElement::ActivateByHyperlink() {
   FlushAnimations();
 
   // The behavior for when the target is an animation element is defined in
   // SMIL Animation:
   //   http://www.w3.org/TR/smil-animation/#HyperlinkSemantics
-  nsSMILTimeValue seekTime = mTimedElement.GetHyperlinkTime();
+  SMILTimeValue seekTime = mTimedElement.GetHyperlinkTime();
   if (seekTime.IsDefinite()) {
     SMILTimeContainer* timeContainer = GetTimeContainer();
     if (timeContainer) {
       timeContainer->SetCurrentTime(seekTime.GetMillis());
       AnimationNeedsResample();
       // As with SVGSVGElement::SetCurrentTime, we need to trigger
       // a synchronous sample now.
       FlushAnimations();