Bug 1516980 - Move nsSMILCompositor and nsSMILTimedElement to the mozilla namespace r=bbirtles
authorlongsonr <longsonr@gmail.com>
Tue, 01 Jan 2019 09:16:21 +0000
changeset 509337 c8faeeccdb0eb21465e878d98b766fcf194e517d
parent 509335 389460801c5c8d365eb498467c0efc245634be12
child 509338 9264db4a86077ae257815435c887303cb1230d86
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbirtles
bugs1516980
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 1516980 - Move nsSMILCompositor and nsSMILTimedElement to the mozilla namespace r=bbirtles
dom/smil/SMILAnimationController.cpp
dom/smil/SMILAnimationController.h
dom/smil/SMILAnimationFunction.cpp
dom/smil/SMILAnimationFunction.h
dom/smil/SMILCompositor.cpp
dom/smil/SMILCompositor.h
dom/smil/SMILCompositorTable.h
dom/smil/SMILTimedElement.cpp
dom/smil/SMILTimedElement.h
dom/smil/moz.build
dom/smil/nsSMILCompositor.cpp
dom/smil/nsSMILCompositor.h
dom/smil/nsSMILCompositorTable.h
dom/smil/nsSMILInstanceTime.h
dom/smil/nsSMILMilestone.h
dom/smil/nsSMILTargetIdentifier.h
dom/smil/nsSMILTimeContainer.cpp
dom/smil/nsSMILTimeValue.h
dom/smil/nsSMILTimeValueSpec.cpp
dom/smil/nsSMILTimeValueSpec.h
dom/smil/nsSMILTimedElement.cpp
dom/smil/nsSMILTimedElement.h
dom/svg/SVGAnimationElement.cpp
dom/svg/SVGAnimationElement.h
--- a/dom/smil/SMILAnimationController.cpp
+++ b/dom/smil/SMILAnimationController.cpp
@@ -5,27 +5,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/SMILAnimationController.h"
 
 #include <algorithm>
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/RestyleManager.h"
+#include "mozilla/SMILTimedElement.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "nsContentUtils.h"
 #include "nsCSSProps.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsIPresShellInlines.h"
 #include "nsITimer.h"
-#include "nsSMILCompositor.h"
+#include "SMILCompositor.h"
 #include "nsSMILCSSProperty.h"
-#include "nsSMILTimedElement.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 //----------------------------------------------------------------------
 // SMILAnimationController implementation
 
@@ -194,17 +194,17 @@ void SMILAnimationController::OnPageHide
 //----------------------------------------------------------------------
 // Cycle-collection support
 
 void SMILAnimationController::Traverse(
     nsCycleCollectionTraversalCallback* aCallback) {
   // Traverse last compositor table
   if (mLastCompositorTable) {
     for (auto iter = mLastCompositorTable->Iter(); !iter.Done(); iter.Next()) {
-      nsSMILCompositor* compositor = iter.Get();
+      SMILCompositor* compositor = iter.Get();
       compositor->Traverse(aCallback);
     }
   }
 }
 
 void SMILAnimationController::Unlink() { mLastCompositorTable = nullptr; }
 
 //----------------------------------------------------------------------
@@ -339,18 +339,18 @@ void SMILAnimationController::DoSample(b
   // store it until the next sample. This lets us find out which elements were
   // animated in sample 'n-1' but not in sample 'n' (and hence need to have
   // their animation effects removed in sample 'n').
   //
   // Parts (i) and (ii) are not functionally related but we combine them here to
   // save iterating over the animation elements twice.
 
   // Create the compositor table
-  nsAutoPtr<nsSMILCompositorTable> currentCompositorTable(
-      new nsSMILCompositorTable(0));
+  nsAutoPtr<SMILCompositorTable> currentCompositorTable(
+      new SMILCompositorTable(0));
   nsTArray<RefPtr<SVGAnimationElement>> animElems(
       mAnimationElementTable.Count());
 
   for (auto iter = mAnimationElementTable.Iter(); !iter.Done(); iter.Next()) {
     SVGAnimationElement* animElem = iter.Get()->GetKey();
     SampleTimedElement(animElem, &activeContainers);
     AddAnimationToCompositorTable(animElem, currentCompositorTable,
                                   isStyleFlushNeeded);
@@ -360,18 +360,18 @@ void SMILAnimationController::DoSample(b
 
   // STEP 4: Compare previous sample's compositors against this sample's.
   // (Transfer cached base values across, & remove animation effects from
   // no-longer-animated targets.)
   if (mLastCompositorTable) {
     // * Transfer over cached base values, from last sample's compositors
     for (auto iter = currentCompositorTable->Iter(); !iter.Done();
          iter.Next()) {
-      nsSMILCompositor* compositor = iter.Get();
-      nsSMILCompositor* lastCompositor =
+      SMILCompositor* compositor = iter.Get();
+      SMILCompositor* lastCompositor =
           mLastCompositorTable->GetEntry(compositor->GetKey());
 
       if (lastCompositor) {
         compositor->StealCachedBaseValue(lastCompositor);
       }
     }
 
     // * For each compositor in current sample's hash table, remove entry from
@@ -557,42 +557,42 @@ void SMILAnimationController::DoMileston
   nsSMILTime containerTime = timeContainer->GetCurrentTimeAsSMILTime();
 
   MOZ_ASSERT(!timeContainer->IsSeeking(),
              "Doing a regular sample but the time container is still seeking");
   aElement->TimedElement().SampleAt(containerTime);
 }
 
 /*static*/ void SMILAnimationController::AddAnimationToCompositorTable(
-    SVGAnimationElement* aElement, nsSMILCompositorTable* aCompositorTable,
+    SVGAnimationElement* aElement, SMILCompositorTable* aCompositorTable,
     bool& aStyleFlushNeeded) {
   // Add a compositor to the hash table if there's not already one there
   nsSMILTargetIdentifier key;
   if (!GetTargetIdentifierForAnimation(aElement, key))
     // Something's wrong/missing about animation's target; skip this animation
     return;
 
   SMILAnimationFunction& func = aElement->AnimationFunction();
 
   // Only add active animation functions. If there are no active animations
   // targeting an attribute, no compositor will be created and any previously
   // applied animations will be cleared.
   if (func.IsActiveOrFrozen()) {
     // Look up the compositor for our target, & add our animation function
     // to its list of animation functions.
-    nsSMILCompositor* result = aCompositorTable->PutEntry(key);
+    SMILCompositor* result = aCompositorTable->PutEntry(key);
     result->AddAnimationFunction(&func);
 
   } else if (func.HasChanged()) {
     // Look up the compositor for our target, and force it to skip the
     // "nothing's changed so don't bother compositing" optimization for this
     // sample. |func| is inactive, but it's probably *newly* inactive (since
     // it's got HasChanged() == true), so we need to make sure to recompose
     // its target.
-    nsSMILCompositor* result = aCompositorTable->PutEntry(key);
+    SMILCompositor* result = aCompositorTable->PutEntry(key);
     result->ToggleForceCompositing();
 
     // We've now made sure that |func|'s inactivity will be reflected as of
     // this sample. We need to clear its HasChanged() flag so that it won't
     // trigger this same clause in future samples (until it changes again).
     func.ClearHasChanged();
   }
   aStyleFlushNeeded |= func.ValueNeedsReparsingEverySample();
--- a/dom/smil/SMILAnimationController.h
+++ b/dom/smil/SMILAnimationController.h
@@ -3,24 +3,24 @@
 /* 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_SMILANIMATIONCONTROLLER_H_
 #define NS_SMILANIMATIONCONTROLLER_H_
 
 #include "mozilla/Attributes.h"
+#include "mozilla/SMILCompositorTable.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsITimer.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "nsSMILTimeContainer.h"
-#include "nsSMILCompositorTable.h"
 #include "nsSMILMilestone.h"
 #include "nsRefreshDriver.h"
 
 struct nsSMILTargetIdentifier;
 class nsIDocument;
 
 namespace mozilla {
 namespace dom {
@@ -138,17 +138,17 @@ class SMILAnimationController final : pu
 
   void DoMilestoneSamples();
 
   static void SampleTimedElement(mozilla::dom::SVGAnimationElement* aElement,
                                  TimeContainerHashtable* aActiveContainers);
 
   static void AddAnimationToCompositorTable(
       mozilla::dom::SVGAnimationElement* aElement,
-      nsSMILCompositorTable* aCompositorTable, bool& aStyleFlushNeeded);
+      SMILCompositorTable* aCompositorTable, bool& aStyleFlushNeeded);
 
   static bool GetTargetIdentifierForAnimation(
       mozilla::dom::SVGAnimationElement* aAnimElem,
       nsSMILTargetIdentifier& aResult);
 
   // Methods for adding/removing time containers
   virtual nsresult AddChild(nsSMILTimeContainer& aChild) override;
   virtual void RemoveChild(nsSMILTimeContainer& aChild) override;
@@ -198,14 +198,14 @@ class SMILAnimationController final : pu
   // Store raw ptr to mDocument.  It owns the controller, so controller
   // shouldn't outlive it
   nsIDocument* mDocument;
 
   // Contains compositors used in our last sample.  We keep this around
   // so we can detect when an element/attribute used to be animated,
   // but isn't anymore for some reason. (e.g. if its <animate> element is
   // removed or retargeted)
-  nsAutoPtr<nsSMILCompositorTable> mLastCompositorTable;
+  nsAutoPtr<SMILCompositorTable> mLastCompositorTable;
 };
 
 }  // namespace mozilla
 
 #endif  // NS_SMILANIMATIONCONTROLLER_H_
--- a/dom/smil/SMILAnimationFunction.cpp
+++ b/dom/smil/SMILAnimationFunction.cpp
@@ -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/. */
 
 #include "SMILAnimationFunction.h"
 
 #include "mozilla/dom/SVGAnimationElement.h"
+#include "mozilla/SMILTimedElement.h"
 #include "mozilla/Move.h"
 #include "nsISMILAttr.h"
 #include "SMILCSSValueType.h"
 #include "nsSMILParserUtils.h"
 #include "SMILNullType.h"
-#include "nsSMILTimedElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsIContent.h"
 #include "nsContentUtils.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
@@ -250,19 +250,18 @@ int8_t SMILAnimationFunction::CompareTo(
   if (IsActiveOrFrozen() && !aOther->IsActiveOrFrozen()) return 1;
 
   // Sort based on begin time
   if (mBeginTime != aOther->GetBeginTime())
     return mBeginTime > aOther->GetBeginTime() ? 1 : -1;
 
   // Next sort based on syncbase dependencies: the dependent element sorts after
   // its syncbase
-  const nsSMILTimedElement& thisTimedElement =
-      mAnimationElement->TimedElement();
-  const nsSMILTimedElement& otherTimedElement =
+  const SMILTimedElement& thisTimedElement = mAnimationElement->TimedElement();
+  const SMILTimedElement& otherTimedElement =
       aOther->mAnimationElement->TimedElement();
   if (thisTimedElement.IsTimeDependent(otherTimedElement)) return 1;
   if (otherTimedElement.IsTimeDependent(thisTimedElement)) return -1;
 
   // Animations that appear later in the document sort after those earlier in
   // the document
   MOZ_ASSERT(mAnimationElement != aOther->mAnimationElement,
              "Two animations cannot have the same animation content element!");
--- a/dom/smil/SMILAnimationFunction.h
+++ b/dom/smil/SMILAnimationFunction.h
@@ -205,17 +205,17 @@ class SMILAnimationFunction {
     MOZ_ASSERT(!IsActiveOrFrozen(),
                "clearing mHasChanged flag for active animation");
     mHasChanged = false;
   }
 
   /**
    * Updates the cached record of our animation target, and returns a boolean
    * that indicates whether the target has changed since the last call to this
-   * function. (This lets nsSMILCompositor check whether its animation
+   * function. (This lets SMILCompositor check whether its animation
    * functions have changed value or target since the last sample.  If none of
    * them have, then the compositor doesn't need to do anything.)
    *
    * @param aNewTarget A nsSMILTargetIdentifier representing the animation
    *                   target of this function for this sample.
    * @return  true if |aNewTarget| is different from the old cached value;
    *          otherwise, false.
    */
rename from dom/smil/nsSMILCompositor.cpp
rename to dom/smil/SMILCompositor.cpp
--- a/dom/smil/nsSMILCompositor.cpp
+++ b/dom/smil/SMILCompositor.cpp
@@ -1,51 +1,53 @@
 /* -*- 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 "nsSMILCompositor.h"
+#include "SMILCompositor.h"
 
 #include "nsComputedDOMStyle.h"
 #include "nsCSSProps.h"
 #include "nsHashKeys.h"
 #include "nsSMILCSSProperty.h"
 
+namespace mozilla {
+
 // PLDHashEntryHdr methods
-bool nsSMILCompositor::KeyEquals(KeyTypePointer aKey) const {
+bool SMILCompositor::KeyEquals(KeyTypePointer aKey) const {
   return aKey && aKey->Equals(mKey);
 }
 
-/*static*/ PLDHashNumber nsSMILCompositor::HashKey(KeyTypePointer aKey) {
+/*static*/ PLDHashNumber SMILCompositor::HashKey(KeyTypePointer aKey) {
   // Combine the 3 values into one numeric value, which will be hashed.
   // NOTE: We right-shift one of the pointers by 2 to get some randomness in
   // its 2 lowest-order bits. (Those shifted-off bits will always be 0 since
   // our pointers will be word-aligned.)
   return (NS_PTR_TO_UINT32(aKey->mElement.get()) >> 2) +
          NS_PTR_TO_UINT32(aKey->mAttributeName.get());
 }
 
 // Cycle-collection support
-void nsSMILCompositor::Traverse(nsCycleCollectionTraversalCallback* aCallback) {
+void SMILCompositor::Traverse(nsCycleCollectionTraversalCallback* aCallback) {
   if (!mKey.mElement) return;
 
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*aCallback, "Compositor mKey.mElement");
   aCallback->NoteXPCOMChild(mKey.mElement);
 }
 
 // Other methods
-void nsSMILCompositor::AddAnimationFunction(SMILAnimationFunction* aFunc) {
+void SMILCompositor::AddAnimationFunction(SMILAnimationFunction* aFunc) {
   if (aFunc) {
     mAnimationFunctions.AppendElement(aFunc);
   }
 }
 
-void nsSMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates) {
+void SMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates) {
   if (!mKey.mElement) return;
 
   // If we might need to resolve base styles, grab a suitable ComputedStyle
   // for initializing our nsISMILAttr with.
   RefPtr<ComputedStyle> baseComputedStyle;
   if (MightNeedBaseStyle()) {
     baseComputedStyle = nsComputedDOMStyle::GetUnanimatedComputedStyleNoFlush(
         mKey.mElement, nullptr);
@@ -54,17 +56,17 @@ void nsSMILCompositor::ComposeAttribute(
   // FIRST: Get the nsISMILAttr (to grab base value from, and to eventually
   // give animated value to)
   UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(baseComputedStyle);
   if (!smilAttr) {
     // Target attribute not found (or, out of memory)
     return;
   }
   if (mAnimationFunctions.IsEmpty()) {
-    // No active animation functions. (We can still have a nsSMILCompositor in
+    // No active animation functions. (We can still have a SMILCompositor in
     // that case if an animation function has *just* become inactive)
     smilAttr->ClearAnimValue();
     // Removing the animation effect may require a style update.
     aMightHavePendingStyleUpdates = true;
     return;
   }
 
   // SECOND: Sort the animationFunctions, to prepare for compositing.
@@ -99,43 +101,43 @@ void nsSMILCompositor::ComposeAttribute(
 
   // SIXTH: Set the animated value to the final composited result.
   nsresult rv = smilAttr->SetAnimValue(sandwichResultValue);
   if (NS_FAILED(rv)) {
     NS_WARNING("nsISMILAttr::SetAnimValue failed");
   }
 }
 
-void nsSMILCompositor::ClearAnimationEffects() {
+void SMILCompositor::ClearAnimationEffects() {
   if (!mKey.mElement || !mKey.mAttributeName) return;
 
   UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(nullptr);
   if (!smilAttr) {
     // Target attribute not found (or, out of memory)
     return;
   }
   smilAttr->ClearAnimValue();
 }
 
 // Protected Helper Functions
 // --------------------------
-UniquePtr<nsISMILAttr> nsSMILCompositor::CreateSMILAttr(
+UniquePtr<nsISMILAttr> SMILCompositor::CreateSMILAttr(
     ComputedStyle* aBaseComputedStyle) {
   nsCSSPropertyID propID = GetCSSPropertyToAnimate();
 
   if (propID != eCSSProperty_UNKNOWN) {
     return MakeUnique<nsSMILCSSProperty>(propID, mKey.mElement.get(),
                                          aBaseComputedStyle);
   }
 
   return mKey.mElement->GetAnimatedAttr(mKey.mAttributeNamespaceID,
                                         mKey.mAttributeName);
 }
 
-nsCSSPropertyID nsSMILCompositor::GetCSSPropertyToAnimate() const {
+nsCSSPropertyID SMILCompositor::GetCSSPropertyToAnimate() const {
   if (mKey.mAttributeNamespaceID != kNameSpaceID_None) {
     return eCSSProperty_UNKNOWN;
   }
 
   nsCSSPropertyID propID =
       nsCSSProps::LookupProperty(nsDependentAtomString(mKey.mAttributeName));
 
   if (!nsSMILCSSProperty::IsPropertyAnimatable(propID)) {
@@ -157,33 +159,33 @@ nsCSSPropertyID nsSMILCompositor::GetCSS
       mKey.mElement->GetNameSpaceID() == kNameSpaceID_SVG &&
       !mKey.mElement->IsAttributeMapped(mKey.mAttributeName)) {
     return eCSSProperty_UNKNOWN;
   }
 
   return propID;
 }
 
-bool nsSMILCompositor::MightNeedBaseStyle() const {
+bool SMILCompositor::MightNeedBaseStyle() const {
   if (GetCSSPropertyToAnimate() == eCSSProperty_UNKNOWN) {
     return false;
   }
 
   // We should return true if at least one animation function might build on
   // the base value.
   for (const SMILAnimationFunction* func : mAnimationFunctions) {
     if (!func->WillReplace()) {
       return true;
     }
   }
 
   return false;
 }
 
-uint32_t nsSMILCompositor::GetFirstFuncToAffectSandwich() {
+uint32_t SMILCompositor::GetFirstFuncToAffectSandwich() {
   // For performance reasons, we throttle most animations on elements in
   // display:none subtrees. (We can't throttle animations that target the
   // "display" property itself, though -- if we did, display:none elements
   // could never be dynamically displayed via animations.)
   // To determine whether we're in a display:none subtree, we will check the
   // element's primary frame since element in display:none subtree doesn't have
   // a primary frame. Before this process, we will construct frame when we
   // append an element to subtree. So we will not need to worry about pending
@@ -217,15 +219,17 @@ uint32_t nsSMILCompositor::GetFirstFuncT
   if (mForceCompositing) {
     for (uint32_t j = i; j > 0; --j) {
       mAnimationFunctions[j - 1]->SetWasSkipped();
     }
   }
   return i;
 }
 
-void nsSMILCompositor::UpdateCachedBaseValue(const nsSMILValue& aBaseValue) {
+void SMILCompositor::UpdateCachedBaseValue(const nsSMILValue& aBaseValue) {
   if (mCachedBaseValue != aBaseValue) {
     // Base value has changed since last sample.
     mCachedBaseValue = aBaseValue;
     mForceCompositing = true;
   }
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILCompositor.h
rename to dom/smil/SMILCompositor.h
--- a/dom/smil/nsSMILCompositor.h
+++ b/dom/smil/SMILCompositor.h
@@ -4,54 +4,56 @@
  * 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_SMILCOMPOSITOR_H_
 #define NS_SMILCOMPOSITOR_H_
 
 #include "mozilla/Move.h"
 #include "mozilla/UniquePtr.h"
+#include "mozilla/SMILAnimationFunction.h"
+#include "mozilla/SMILCompositorTable.h"
 #include "nsTHashtable.h"
 #include "nsString.h"
-#include "SMILAnimationFunction.h"
 #include "nsSMILTargetIdentifier.h"
-#include "nsSMILCompositorTable.h"
 #include "PLDHashTable.h"
 
+namespace mozilla {
+
 //----------------------------------------------------------------------
-// nsSMILCompositor
+// SMILCompositor
 //
 // Performs the composition of the animation sandwich by combining the results
 // of a series animation functions according to the rules of SMIL composition
 // including prioritising animations.
 
-class nsSMILCompositor : public PLDHashEntryHdr {
+class SMILCompositor : public PLDHashEntryHdr {
  public:
   typedef nsSMILTargetIdentifier KeyType;
   typedef const KeyType& KeyTypeRef;
   typedef const KeyType* KeyTypePointer;
 
-  explicit nsSMILCompositor(KeyTypePointer aKey)
+  explicit SMILCompositor(KeyTypePointer aKey)
       : mKey(*aKey), mForceCompositing(false) {}
-  nsSMILCompositor(nsSMILCompositor&& toMove)
+  SMILCompositor(SMILCompositor&& toMove)
       : PLDHashEntryHdr(std::move(toMove)),
         mKey(std::move(toMove.mKey)),
         mAnimationFunctions(std::move(toMove.mAnimationFunctions)),
         mForceCompositing(false) {}
-  ~nsSMILCompositor() {}
+  ~SMILCompositor() {}
 
   // PLDHashEntryHdr methods
   KeyTypeRef GetKey() const { return mKey; }
   bool KeyEquals(KeyTypePointer aKey) const;
   static KeyTypePointer KeyToPointer(KeyTypeRef aKey) { return &aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey);
   enum { ALLOW_MEMMOVE = false };
 
   // Adds the given animation function to this Compositor's list of functions
-  void AddAnimationFunction(mozilla::SMILAnimationFunction* aFunc);
+  void AddAnimationFunction(SMILAnimationFunction* aFunc);
 
   // Composes the attribute's current value with the list of animation
   // functions, and assigns the resulting value to this compositor's target
   // attribute. If a change is made that might produce style updates,
   // aMightHavePendingStyleUpdates is set to true. Otherwise it is not modified.
   void ComposeAttribute(bool& aMightHavePendingStyleUpdates);
 
   // Clears animation effects on my target attribute
@@ -60,27 +62,26 @@ class nsSMILCompositor : public PLDHashE
   // Cycle-collection support
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
 
   // Toggles a bit that will force us to composite (bypassing early-return
   // optimizations) when we hit ComposeAttribute.
   void ToggleForceCompositing() { mForceCompositing = true; }
 
   // Transfers |aOther|'s mCachedBaseValue to |this|
-  void StealCachedBaseValue(nsSMILCompositor* aOther) {
+  void StealCachedBaseValue(SMILCompositor* aOther) {
     mCachedBaseValue = std::move(aOther->mCachedBaseValue);
   }
 
  private:
   // Create a nsISMILAttr for my target, on the heap.
   //
   // @param aBaseComputedStyle  An optional ComputedStyle which, if set, will be
   //                           used when fetching the base style.
-  mozilla::UniquePtr<nsISMILAttr> CreateSMILAttr(
-      mozilla::ComputedStyle* aBaseComputedStyle);
+  UniquePtr<nsISMILAttr> CreateSMILAttr(ComputedStyle* aBaseComputedStyle);
 
   // Returns the CSS property this compositor should animate, or
   // eCSSProperty_UNKNOWN if this compositor does not animate a CSS property.
   nsCSSPropertyID GetCSSPropertyToAnimate() const;
 
   // Returns true if we might need to refer to base styles (i.e. we are
   // targeting a CSS property and have one or more animation functions that
   // don't just replace the underlying value).
@@ -99,24 +100,26 @@ class nsSMILCompositor : public PLDHashE
   // If the passed-in base value differs from our cached base value, this
   // method updates the cached value (and toggles the 'mForceCompositing' flag)
   void UpdateCachedBaseValue(const nsSMILValue& aBaseValue);
 
   // The hash key (tuple of element and attributeName)
   KeyType mKey;
 
   // Hash Value: List of animation functions that animate the specified attr
-  nsTArray<mozilla::SMILAnimationFunction*> mAnimationFunctions;
+  nsTArray<SMILAnimationFunction*> mAnimationFunctions;
 
   // Member data for detecting when we need to force-recompose
   // ---------------------------------------------------------
   // Flag for tracking whether we need to compose. Initialized to false, but
   // gets flipped to true if we detect that something has changed.
   bool mForceCompositing;
 
   // Cached base value, so we can detect & force-recompose when it changes
   // from one sample to the next. (SMILAnimationController moves this
   // forward from the previous sample's compositor by calling
   // StealCachedBaseValue.)
   nsSMILValue mCachedBaseValue;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILCOMPOSITOR_H_
rename from dom/smil/nsSMILCompositorTable.h
rename to dom/smil/SMILCompositorTable.h
--- a/dom/smil/nsSMILCompositorTable.h
+++ b/dom/smil/SMILCompositorTable.h
@@ -5,19 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILCOMPOSITORTABLE_H_
 #define NS_SMILCOMPOSITORTABLE_H_
 
 #include "nsTHashtable.h"
 
 //----------------------------------------------------------------------
-// nsSMILCompositorTable : A hashmap of nsSMILCompositors
+// SMILCompositorTable : A hashmap of SMILCompositors
 //
 // This is just a forward-declaration because it is included in
 // SMILAnimationController which is used in nsIDocument. We don't want to
-// expose all of nsSMILCompositor or otherwise any changes to it will mean the
+// expose all of SMILCompositor or otherwise any changes to it will mean the
 // whole world will need to be rebuilt.
 
-class nsSMILCompositor;
-typedef nsTHashtable<nsSMILCompositor> nsSMILCompositorTable;
+namespace mozilla {
+
+class SMILCompositor;
+
+typedef nsTHashtable<SMILCompositor> SMILCompositorTable;
+
+}  // namespace mozilla
 
 #endif  // NS_SMILCOMPOSITORTABLE_H_
rename from dom/smil/nsSMILTimedElement.cpp
rename to dom/smil/SMILTimedElement.cpp
--- a/dom/smil/nsSMILTimedElement.cpp
+++ b/dom/smil/SMILTimedElement.cpp
@@ -1,67 +1,68 @@
 /* -*- 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/DebugOnly.h"
+#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/TaskCategory.h"
 #include "mozilla/dom/SVGAnimationElement.h"
-#include "mozilla/TaskCategory.h"
-#include "nsSMILTimedElement.h"
 #include "nsAttrValueInlines.h"
-#include "SMILAnimationFunction.h"
 #include "nsSMILTimeValue.h"
 #include "nsSMILTimeValueSpec.h"
 #include "nsSMILInstanceTime.h"
 #include "nsSMILParserUtils.h"
 #include "nsSMILTimeContainer.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"
 #include "nsString.h"
-#include "mozilla/AutoRestore.h"
 #include "nsCharSeparatedTokenizer.h"
 #include <algorithm>
 
-using namespace mozilla;
 using namespace mozilla::dom;
 
+namespace mozilla {
+
 //----------------------------------------------------------------------
 // Helper class: InstanceTimeComparator
 
 // Upon inserting an instance time into one of our instance time lists we assign
 // 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 nsSMILTimedElement::InstanceTimeComparator::Equals(
+bool SMILTimedElement::InstanceTimeComparator::Equals(
     const nsSMILInstanceTime* aElem1, const nsSMILInstanceTime* 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 nsSMILTimedElement::InstanceTimeComparator::LessThan(
+bool SMILTimedElement::InstanceTimeComparator::LessThan(
     const nsSMILInstanceTime* aElem1, const nsSMILInstanceTime* 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;
 }
@@ -97,25 +98,25 @@ class AsyncTimeEventRunner : public Runn
   }
 };
 }  // namespace
 
 //----------------------------------------------------------------------
 // Helper class: AutoIntervalUpdateBatcher
 
 // Stack-based helper class to set the mDeferIntervalUpdates flag on an
-// nsSMILTimedElement and perform the UpdateCurrentInterval when the object is
+// SMILTimedElement and perform the UpdateCurrentInterval when the object is
 // destroyed.
 //
 // If several of these objects are allocated on the stack, the update will not
-// be performed until the last object for a given nsSMILTimedElement is
+// be performed until the last object for a given SMILTimedElement is
 // destroyed.
-class MOZ_STACK_CLASS nsSMILTimedElement::AutoIntervalUpdateBatcher {
+class MOZ_STACK_CLASS SMILTimedElement::AutoIntervalUpdateBatcher {
  public:
-  explicit AutoIntervalUpdateBatcher(nsSMILTimedElement& aTimedElement)
+  explicit AutoIntervalUpdateBatcher(SMILTimedElement& aTimedElement)
       : mTimedElement(aTimedElement),
         mDidSetFlag(!aTimedElement.mDeferIntervalUpdates) {
     mTimedElement.mDeferIntervalUpdates = true;
   }
 
   ~AutoIntervalUpdateBatcher() {
     if (!mDidSetFlag) return;
 
@@ -123,49 +124,49 @@ class MOZ_STACK_CLASS nsSMILTimedElement
 
     if (mTimedElement.mDoDeferredUpdate) {
       mTimedElement.mDoDeferredUpdate = false;
       mTimedElement.UpdateCurrentInterval();
     }
   }
 
  private:
-  nsSMILTimedElement& mTimedElement;
+  SMILTimedElement& mTimedElement;
   bool mDidSetFlag;
 };
 
 //----------------------------------------------------------------------
 // Helper class: AutoIntervalUpdater
 
 // Stack-based helper class to call UpdateCurrentInterval when it is destroyed
 // which helps avoid bugs where we forget to call UpdateCurrentInterval in the
 // case of early returns (e.g. due to parse errors).
 //
 // This can be safely used in conjunction with AutoIntervalUpdateBatcher; any
 // calls to UpdateCurrentInterval made by this class will simply be deferred if
 // there is an AutoIntervalUpdateBatcher on the stack.
-class MOZ_STACK_CLASS nsSMILTimedElement::AutoIntervalUpdater {
+class MOZ_STACK_CLASS SMILTimedElement::AutoIntervalUpdater {
  public:
-  explicit AutoIntervalUpdater(nsSMILTimedElement& aTimedElement)
+  explicit AutoIntervalUpdater(SMILTimedElement& aTimedElement)
       : mTimedElement(aTimedElement) {}
 
   ~AutoIntervalUpdater() { mTimedElement.UpdateCurrentInterval(); }
 
  private:
-  nsSMILTimedElement& mTimedElement;
+  SMILTimedElement& mTimedElement;
 };
 
 //----------------------------------------------------------------------
 // Templated helper functions
 
 // Selectively remove elements from an array of type
 // nsTArray<RefPtr<nsSMILInstanceTime> > with O(n) performance.
 template <class TestFunctor>
-void nsSMILTimedElement::RemoveInstanceTimes(InstanceTimeList& aArray,
-                                             TestFunctor& aTest) {
+void SMILTimedElement::RemoveInstanceTimes(InstanceTimeList& aArray,
+                                           TestFunctor& aTest) {
   InstanceTimeList newArray;
   for (uint32_t i = 0; i < aArray.Length(); ++i) {
     nsSMILInstanceTime* 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
@@ -183,42 +184,42 @@ void nsSMILTimedElement::RemoveInstanceT
   }
   aArray.Clear();
   aArray.SwapElements(newArray);
 }
 
 //----------------------------------------------------------------------
 // Static members
 
-const nsAttrValue::EnumTable nsSMILTimedElement::sFillModeTable[] = {
+const nsAttrValue::EnumTable SMILTimedElement::sFillModeTable[] = {
     {"remove", FILL_REMOVE}, {"freeze", FILL_FREEZE}, {nullptr, 0}};
 
-const nsAttrValue::EnumTable nsSMILTimedElement::sRestartModeTable[] = {
+const nsAttrValue::EnumTable SMILTimedElement::sRestartModeTable[] = {
     {"always", RESTART_ALWAYS},
     {"whenNotActive", RESTART_WHENNOTACTIVE},
     {"never", RESTART_NEVER},
     {nullptr, 0}};
 
-const nsSMILMilestone nsSMILTimedElement::sMaxMilestone(
+const nsSMILMilestone SMILTimedElement::sMaxMilestone(
     std::numeric_limits<nsSMILTime>::max(), false);
 
 // The thresholds at which point we start filtering intervals and instance times
 // indiscriminately.
 // See FilterIntervals and FilterInstanceTimes.
-const uint8_t nsSMILTimedElement::sMaxNumIntervals = 20;
-const uint8_t nsSMILTimedElement::sMaxNumInstanceTimes = 100;
+const uint8_t SMILTimedElement::sMaxNumIntervals = 20;
+const uint8_t SMILTimedElement::sMaxNumInstanceTimes = 100;
 
 // Detect if we arrive in some sort of undetected recursive syncbase dependency
 // relationship
-const uint8_t nsSMILTimedElement::sMaxUpdateIntervalRecursionDepth = 20;
+const uint8_t SMILTimedElement::sMaxUpdateIntervalRecursionDepth = 20;
 
 //----------------------------------------------------------------------
 // Ctor, dtor
 
-nsSMILTimedElement::nsSMILTimedElement()
+SMILTimedElement::SMILTimedElement()
     : mAnimationElement(nullptr),
       mFillMode(FILL_REMOVE),
       mRestartMode(RESTART_ALWAYS),
       mInstanceSerialIndex(0),
       mClient(nullptr),
       mCurrentInterval(nullptr),
       mCurrentRepeatIteration(0),
       mPrevRegisteredMilestone(sMaxMilestone),
@@ -229,17 +230,17 @@ nsSMILTimedElement::nsSMILTimedElement()
       mIsDisabled(false),
       mDeleteCount(0),
       mUpdateIntervalRecursionDepth(0) {
   mSimpleDur.SetIndefinite();
   mMin.SetMillis(0L);
   mMax.SetIndefinite();
 }
 
-nsSMILTimedElement::~nsSMILTimedElement() {
+SMILTimedElement::~SMILTimedElement() {
   // Unlink all instance times from dependent intervals
   for (uint32_t i = 0; i < mBeginInstances.Length(); ++i) {
     mBeginInstances[i]->Unlink();
   }
   mBeginInstances.Clear();
   for (uint32_t i = 0; i < mEndInstances.Length(); ++i) {
     mEndInstances[i]->Unlink();
   }
@@ -251,33 +252,33 @@ nsSMILTimedElement::~nsSMILTimedElement(
   ClearIntervals();
 
   // The following assertions are important in their own right (for checking
   // correct behavior) but also because AutoIntervalUpdateBatcher holds pointers
   // to class so if they fail there's the possibility we might have dangling
   // pointers.
   MOZ_ASSERT(!mDeferIntervalUpdates,
              "Interval updates should no longer be blocked when an "
-             "nsSMILTimedElement disappears");
+             "SMILTimedElement disappears");
   MOZ_ASSERT(!mDoDeferredUpdate,
              "There should no longer be any pending updates when an "
-             "nsSMILTimedElement disappears");
+             "SMILTimedElement disappears");
 }
 
-void nsSMILTimedElement::SetAnimationElement(SVGAnimationElement* aElement) {
+void SMILTimedElement::SetAnimationElement(SVGAnimationElement* aElement) {
   MOZ_ASSERT(aElement, "NULL owner element");
   MOZ_ASSERT(!mAnimationElement, "Re-setting owner");
   mAnimationElement = aElement;
 }
 
-nsSMILTimeContainer* nsSMILTimedElement::GetTimeContainer() {
+nsSMILTimeContainer* SMILTimedElement::GetTimeContainer() {
   return mAnimationElement ? mAnimationElement->GetTimeContainer() : nullptr;
 }
 
-dom::Element* nsSMILTimedElement::GetTargetElement() {
+dom::Element* SMILTimedElement::GetTargetElement() {
   return mAnimationElement ? mAnimationElement->GetTargetElementContent()
                            : nullptr;
 }
 
 //----------------------------------------------------------------------
 // ElementTimeControl methods
 //
 // The definition of the ElementTimeControl interface differs between SMIL
@@ -288,61 +289,61 @@ dom::Element* nsSMILTimedElement::GetTar
 //
 // This inconsistency has now been addressed by an erratum in SVG 1.1:
 //
 // http://www.w3.org/2003/01/REC-SVG11-20030114-errata#elementtimecontrol-interface
 //
 // which favours the definition in SMIL, i.e. instance times are just added
 // without first checking the restart mode.
 
-nsresult nsSMILTimedElement::BeginElementAt(double aOffsetSeconds) {
+nsresult SMILTimedElement::BeginElementAt(double aOffsetSeconds) {
   nsSMILTimeContainer* container = GetTimeContainer();
   if (!container) return NS_ERROR_FAILURE;
 
   nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
   return AddInstanceTimeFromCurrentTime(currentTime, aOffsetSeconds, true);
 }
 
-nsresult nsSMILTimedElement::EndElementAt(double aOffsetSeconds) {
+nsresult SMILTimedElement::EndElementAt(double aOffsetSeconds) {
   nsSMILTimeContainer* container = GetTimeContainer();
   if (!container) return NS_ERROR_FAILURE;
 
   nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
   return AddInstanceTimeFromCurrentTime(currentTime, aOffsetSeconds, false);
 }
 
 //----------------------------------------------------------------------
 // nsSVGAnimationElement methods
 
-nsSMILTimeValue nsSMILTimedElement::GetStartTime() const {
+nsSMILTimeValue SMILTimedElement::GetStartTime() const {
   return mElementState == STATE_WAITING || mElementState == STATE_ACTIVE
              ? mCurrentInterval->Begin()->Time()
              : nsSMILTimeValue();
 }
 
 //----------------------------------------------------------------------
 // Hyperlinking support
 
-nsSMILTimeValue nsSMILTimedElement::GetHyperlinkTime() const {
+nsSMILTimeValue SMILTimedElement::GetHyperlinkTime() const {
   nsSMILTimeValue hyperlinkTime;  // Default ctor creates unresolved time
 
   if (mElementState == STATE_ACTIVE) {
     hyperlinkTime = mCurrentInterval->Begin()->Time();
   } else if (!mBeginInstances.IsEmpty()) {
     hyperlinkTime = mBeginInstances[0]->Time();
   }
 
   return hyperlinkTime;
 }
 
 //----------------------------------------------------------------------
-// nsSMILTimedElement
+// SMILTimedElement
 
-void nsSMILTimedElement::AddInstanceTime(nsSMILInstanceTime* aInstanceTime,
-                                         bool aIsBegin) {
+void SMILTimedElement::AddInstanceTime(nsSMILInstanceTime* 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
     // to anything that's going to miss them
@@ -359,19 +360,19 @@ void nsSMILTimedElement::AddInstanceTime
   if (!inserted) {
     NS_WARNING("Insufficient memory to insert instance time");
     return;
   }
 
   UpdateCurrentInterval();
 }
 
-void nsSMILTimedElement::UpdateInstanceTime(nsSMILInstanceTime* aInstanceTime,
-                                            nsSMILTimeValue& aUpdatedTime,
-                                            bool aIsBegin) {
+void SMILTimedElement::UpdateInstanceTime(nsSMILInstanceTime* aInstanceTime,
+                                          nsSMILTimeValue& 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
   // 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;
@@ -390,18 +391,18 @@ void nsSMILTimedElement::UpdateInstanceT
   // current interval when doing a Reset).
   bool changedCurrentInterval =
       mCurrentInterval && (mCurrentInterval->Begin() == aInstanceTime ||
                            mCurrentInterval->End() == aInstanceTime);
 
   UpdateCurrentInterval(changedCurrentInterval);
 }
 
-void nsSMILTimedElement::RemoveInstanceTime(nsSMILInstanceTime* aInstanceTime,
-                                            bool aIsBegin) {
+void SMILTimedElement::RemoveInstanceTime(nsSMILInstanceTime* 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;
   }
@@ -433,46 +434,46 @@ class MOZ_STACK_CLASS RemoveByCreator {
     return true;
   }
 
  private:
   const nsSMILTimeValueSpec* mCreator;
 };
 }  // namespace
 
-void nsSMILTimedElement::RemoveInstanceTimesForCreator(
+void SMILTimedElement::RemoveInstanceTimesForCreator(
     const nsSMILTimeValueSpec* aCreator, bool aIsBegin) {
   MOZ_ASSERT(aCreator, "Creator not set");
 
   InstanceTimeList& instances = aIsBegin ? mBeginInstances : mEndInstances;
   RemoveByCreator removeByCreator(aCreator);
   RemoveInstanceTimes(instances, removeByCreator);
 
   UpdateCurrentInterval();
 }
 
-void nsSMILTimedElement::SetTimeClient(SMILAnimationFunction* aClient) {
+void SMILTimedElement::SetTimeClient(SMILAnimationFunction* aClient) {
   //
   // No need to check for nullptr. A nullptr parameter simply means to remove
   // the previous client which we do by setting to nullptr anyway.
   //
 
   mClient = aClient;
 }
 
-void nsSMILTimedElement::SampleAt(nsSMILTime aContainerTime) {
+void SMILTimedElement::SampleAt(nsSMILTime aContainerTime) {
   if (mIsDisabled) return;
 
   // Milestones are cleared before a sample
   mPrevRegisteredMilestone = sMaxMilestone;
 
   DoSampleAt(aContainerTime, false);
 }
 
-void nsSMILTimedElement::SampleEndAt(nsSMILTime aContainerTime) {
+void SMILTimedElement::SampleEndAt(nsSMILTime aContainerTime) {
   if (mIsDisabled) return;
 
   // Milestones are cleared before a sample
   mPrevRegisteredMilestone = sMaxMilestone;
 
   // If the current interval changes, we don't bother trying to remove any old
   // milestones we'd registered. So it's possible to get a call here to end an
   // interval at a time that no longer reflects the end of the current interval.
@@ -486,17 +487,17 @@ void nsSMILTimedElement::SampleEndAt(nsS
     DoSampleAt(aContainerTime, true);  // End sample
   } else {
     // Even if this was an unnecessary milestone sample we want to be sure that
     // our next real milestone is registered.
     RegisterMilestone();
   }
 }
 
-void nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) {
+void SMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) {
   MOZ_ASSERT(mAnimationElement,
              "Got sample before being registered with an animation element");
   MOZ_ASSERT(GetTimeContainer(),
              "Got sample without being registered with a time container");
 
   // This could probably happen if we later implement externalResourcesRequired
   // (bug 277955) and whilst waiting for those resources (and the animation to
   // start) we transfer a node from another document fragment that has already
@@ -671,17 +672,17 @@ void nsSMILTimedElement::DoSampleAt(nsSM
                                           mElementState != STATE_POSTACTIVE)));
 
   if (finishedSeek) {
     DoPostSeek();
   }
   RegisterMilestone();
 }
 
-void nsSMILTimedElement::HandleContainerTimeChange() {
+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
   // won't go any further.
   if (mElementState == STATE_WAITING || mElementState == STATE_ACTIVE) {
     NotifyChangedInterval(mCurrentInterval.get(), false, false);
   }
@@ -693,17 +694,17 @@ bool RemoveNonDynamic(nsSMILInstanceTime
   // times) are not associated with their creator nsSMILTimeValueSpec 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 nsSMILTimedElement::Rewind() {
+void SMILTimedElement::Rewind() {
   MOZ_ASSERT(mAnimationElement,
              "Got rewind request before being attached to an animation "
              "element");
 
   // It's possible to get a rewind request whilst we're already in the middle of
   // a backwards seek. This can happen when we're performing tree surgery and
   // seeking containers at the same time because we can end up requesting
   // a local rewind on an element after binding it to a new container and then
@@ -726,17 +727,17 @@ void nsSMILTimedElement::Rewind() {
 
   MOZ_ASSERT(!mCurrentInterval, "Current interval is set at end of rewind");
 }
 
 namespace {
 bool RemoveAll(nsSMILInstanceTime* aInstanceTime) { return true; }
 }  // namespace
 
-bool nsSMILTimedElement::SetIsDisabled(bool aIsDisabled) {
+bool SMILTimedElement::SetIsDisabled(bool aIsDisabled) {
   if (mIsDisabled == aIsDisabled) return false;
 
   if (aIsDisabled) {
     mIsDisabled = true;
     ClearTimingState(RemoveAll);
   } else {
     RebuildTimingState(RemoveAll);
     mIsDisabled = false;
@@ -745,19 +746,19 @@ bool nsSMILTimedElement::SetIsDisabled(b
 }
 
 namespace {
 bool RemoveNonDOM(nsSMILInstanceTime* aInstanceTime) {
   return !aInstanceTime->FromDOM() && !aInstanceTime->ShouldPreserve();
 }
 }  // namespace
 
-bool nsSMILTimedElement::SetAttr(nsAtom* aAttribute, const nsAString& aValue,
-                                 nsAttrValue& aResult, Element& aContextElement,
-                                 nsresult* aParseResult) {
+bool SMILTimedElement::SetAttr(nsAtom* aAttribute, const nsAString& aValue,
+                               nsAttrValue& aResult, Element& aContextElement,
+                               nsresult* aParseResult) {
   bool foundMatch = true;
   nsresult parseResult = NS_OK;
 
   if (aAttribute == nsGkAtoms::begin) {
     parseResult = SetBeginSpec(aValue, aContextElement, RemoveNonDOM);
   } else if (aAttribute == nsGkAtoms::dur) {
     parseResult = SetSimpleDuration(aValue);
   } else if (aAttribute == nsGkAtoms::end) {
@@ -783,17 +784,17 @@ bool nsSMILTimedElement::SetAttr(nsAtom*
     if (aParseResult) {
       *aParseResult = parseResult;
     }
   }
 
   return foundMatch;
 }
 
-bool nsSMILTimedElement::UnsetAttr(nsAtom* aAttribute) {
+bool SMILTimedElement::UnsetAttr(nsAtom* aAttribute) {
   bool foundMatch = true;
 
   if (aAttribute == nsGkAtoms::begin) {
     UnsetBeginSpec(RemoveNonDOM);
   } else if (aAttribute == nsGkAtoms::dur) {
     UnsetSimpleDuration();
   } else if (aAttribute == nsGkAtoms::end) {
     UnsetEndSpec(RemoveNonDOM);
@@ -814,41 +815,41 @@ bool nsSMILTimedElement::UnsetAttr(nsAto
   }
 
   return foundMatch;
 }
 
 //----------------------------------------------------------------------
 // Setters and unsetters
 
-nsresult nsSMILTimedElement::SetBeginSpec(const nsAString& aBeginSpec,
-                                          Element& aContextElement,
-                                          RemovalTestFunction aRemove) {
+nsresult SMILTimedElement::SetBeginSpec(const nsAString& aBeginSpec,
+                                        Element& aContextElement,
+                                        RemovalTestFunction aRemove) {
   return SetBeginOrEndSpec(aBeginSpec, aContextElement, true /*isBegin*/,
                            aRemove);
 }
 
-void nsSMILTimedElement::UnsetBeginSpec(RemovalTestFunction aRemove) {
+void SMILTimedElement::UnsetBeginSpec(RemovalTestFunction aRemove) {
   ClearSpecs(mBeginSpecs, mBeginInstances, aRemove);
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetEndSpec(const nsAString& aEndSpec,
-                                        Element& aContextElement,
-                                        RemovalTestFunction aRemove) {
+nsresult SMILTimedElement::SetEndSpec(const nsAString& aEndSpec,
+                                      Element& aContextElement,
+                                      RemovalTestFunction aRemove) {
   return SetBeginOrEndSpec(aEndSpec, aContextElement, false /*!isBegin*/,
                            aRemove);
 }
 
-void nsSMILTimedElement::UnsetEndSpec(RemovalTestFunction aRemove) {
+void SMILTimedElement::UnsetEndSpec(RemovalTestFunction aRemove) {
   ClearSpecs(mEndSpecs, mEndInstances, aRemove);
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetSimpleDuration(const nsAString& aDurSpec) {
+nsresult SMILTimedElement::SetSimpleDuration(const nsAString& aDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
   const nsAString& dur = nsSMILParserUtils::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)
@@ -865,22 +866,22 @@ nsresult nsSMILTimedElement::SetSimpleDu
   // duration to resolved or will return false.
   MOZ_ASSERT(duration.IsResolved(), "Setting unresolved simple duration");
 
   mSimpleDur = duration;
 
   return NS_OK;
 }
 
-void nsSMILTimedElement::UnsetSimpleDuration() {
+void SMILTimedElement::UnsetSimpleDuration() {
   mSimpleDur.SetIndefinite();
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetMin(const nsAString& aMinSpec) {
+nsresult SMILTimedElement::SetMin(const nsAString& aMinSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
   const nsAString& min = nsSMILParserUtils::TrimWhitespace(aMinSpec);
 
   if (min.EqualsLiteral("media")) {
     duration.SetMillis(0L);
@@ -893,22 +894,22 @@ nsresult nsSMILTimedElement::SetMin(cons
 
   MOZ_ASSERT(duration.GetMillis() >= 0L, "Invalid duration");
 
   mMin = duration;
 
   return NS_OK;
 }
 
-void nsSMILTimedElement::UnsetMin() {
+void SMILTimedElement::UnsetMin() {
   mMin.SetMillis(0L);
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetMax(const nsAString& aMaxSpec) {
+nsresult SMILTimedElement::SetMax(const nsAString& aMaxSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
   const nsAString& max = nsSMILParserUtils::TrimWhitespace(aMaxSpec);
 
   if (max.EqualsLiteral("media") || max.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
@@ -921,55 +922,55 @@ nsresult nsSMILTimedElement::SetMax(cons
     MOZ_ASSERT(duration.GetMillis() > 0L, "Invalid duration");
   }
 
   mMax = duration;
 
   return NS_OK;
 }
 
-void nsSMILTimedElement::UnsetMax() {
+void SMILTimedElement::UnsetMax() {
   mMax.SetIndefinite();
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetRestart(const nsAString& aRestartSpec) {
+nsresult SMILTimedElement::SetRestart(const nsAString& aRestartSpec) {
   nsAttrValue temp;
   bool parseResult = temp.ParseEnumValue(aRestartSpec, sRestartModeTable, true);
   mRestartMode =
       parseResult ? nsSMILRestartMode(temp.GetEnumValue()) : RESTART_ALWAYS;
   UpdateCurrentInterval();
   return parseResult ? NS_OK : NS_ERROR_FAILURE;
 }
 
-void nsSMILTimedElement::UnsetRestart() {
+void SMILTimedElement::UnsetRestart() {
   mRestartMode = RESTART_ALWAYS;
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetRepeatCount(const nsAString& aRepeatCountSpec) {
+nsresult SMILTimedElement::SetRepeatCount(const nsAString& aRepeatCountSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILRepeatCount newRepeatCount;
 
   if (nsSMILParserUtils::ParseRepeatCount(aRepeatCountSpec, newRepeatCount)) {
     mRepeatCount = newRepeatCount;
     return NS_OK;
   }
   mRepeatCount.Unset();
   return NS_ERROR_FAILURE;
 }
 
-void nsSMILTimedElement::UnsetRepeatCount() {
+void SMILTimedElement::UnsetRepeatCount() {
   mRepeatCount.Unset();
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetRepeatDur(const nsAString& aRepeatDurSpec) {
+nsresult SMILTimedElement::SetRepeatDur(const nsAString& aRepeatDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
 
   const nsAString& repeatDur =
       nsSMILParserUtils::TrimWhitespace(aRepeatDurSpec);
 
@@ -982,46 +983,46 @@ nsresult nsSMILTimedElement::SetRepeatDu
     }
   }
 
   mRepeatDur = duration;
 
   return NS_OK;
 }
 
-void nsSMILTimedElement::UnsetRepeatDur() {
+void SMILTimedElement::UnsetRepeatDur() {
   mRepeatDur.SetUnresolved();
   UpdateCurrentInterval();
 }
 
-nsresult nsSMILTimedElement::SetFillMode(const nsAString& aFillModeSpec) {
+nsresult SMILTimedElement::SetFillMode(const nsAString& aFillModeSpec) {
   uint16_t previousFillMode = mFillMode;
 
   nsAttrValue temp;
   bool parseResult = temp.ParseEnumValue(aFillModeSpec, sFillModeTable, true);
   mFillMode = parseResult ? nsSMILFillMode(temp.GetEnumValue()) : FILL_REMOVE;
 
   // Update fill mode of client
   if (mFillMode != previousFillMode && HasClientInFillRange()) {
     mClient->Inactivate(mFillMode == FILL_FREEZE);
     SampleFillValue();
   }
 
   return parseResult ? NS_OK : NS_ERROR_FAILURE;
 }
 
-void nsSMILTimedElement::UnsetFillMode() {
+void SMILTimedElement::UnsetFillMode() {
   uint16_t previousFillMode = mFillMode;
   mFillMode = FILL_REMOVE;
   if (previousFillMode == FILL_FREEZE && HasClientInFillRange()) {
     mClient->Inactivate(false);
   }
 }
 
-void nsSMILTimedElement::AddDependent(nsSMILTimeValueSpec& aDependent) {
+void SMILTimedElement::AddDependent(nsSMILTimeValueSpec& aDependent) {
   // There's probably no harm in attempting to register a dependent
   // nsSMILTimeValueSpec twice, but we're not expecting it to happen.
   MOZ_ASSERT(!mTimeDependents.GetEntry(&aDependent),
              "nsSMILTimeValueSpec 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.
@@ -1030,31 +1031,30 @@ void nsSMILTimedElement::AddDependent(ns
   //
   // 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 nsSMILTimedElement::RemoveDependent(nsSMILTimeValueSpec& aDependent) {
+void SMILTimedElement::RemoveDependent(nsSMILTimeValueSpec& aDependent) {
   mTimeDependents.RemoveEntry(&aDependent);
 }
 
-bool nsSMILTimedElement::IsTimeDependent(
-    const nsSMILTimedElement& aOther) const {
+bool SMILTimedElement::IsTimeDependent(const SMILTimedElement& aOther) const {
   const nsSMILInstanceTime* thisBegin = GetEffectiveBeginInstance();
   const nsSMILInstanceTime* otherBegin = aOther.GetEffectiveBeginInstance();
 
   if (!thisBegin || !otherBegin) return false;
 
   return thisBegin->IsDependentOn(*otherBegin);
 }
 
-void nsSMILTimedElement::BindToTree(Element& aContextElement) {
+void SMILTimedElement::BindToTree(Element& aContextElement) {
   // Reset previously registered milestone since we may be registering with
   // a different time container now.
   mPrevRegisteredMilestone = sMaxMilestone;
 
   // If we were already active then clear all our timing information and start
   // afresh
   if (mElementState != STATE_STARTUP) {
     mSeekState = SEEK_NOT_SEEKING;
@@ -1075,48 +1075,47 @@ void nsSMILTimedElement::BindToTree(Elem
     for (uint32_t j = 0; j < count; ++j) {
       mEndSpecs[j]->ResolveReferences(aContextElement);
     }
   }
 
   RegisterMilestone();
 }
 
-void nsSMILTimedElement::HandleTargetElementChange(Element* aNewTarget) {
+void SMILTimedElement::HandleTargetElementChange(Element* aNewTarget) {
   AutoIntervalUpdateBatcher updateBatcher(*this);
 
   uint32_t count = mBeginSpecs.Length();
   for (uint32_t i = 0; i < count; ++i) {
     mBeginSpecs[i]->HandleTargetElementChange(aNewTarget);
   }
 
   count = mEndSpecs.Length();
   for (uint32_t j = 0; j < count; ++j) {
     mEndSpecs[j]->HandleTargetElementChange(aNewTarget);
   }
 }
 
-void nsSMILTimedElement::Traverse(
-    nsCycleCollectionTraversalCallback* aCallback) {
+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");
     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");
     endSpec->Traverse(aCallback);
   }
 }
 
-void nsSMILTimedElement::Unlink() {
+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");
     beginSpec->Unlink();
@@ -1133,20 +1132,20 @@ void nsSMILTimedElement::Unlink() {
 
   // Make sure we don't notify other elements of new intervals
   mTimeDependents.Clear();
 }
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
-nsresult nsSMILTimedElement::SetBeginOrEndSpec(const nsAString& aSpec,
-                                               Element& aContextElement,
-                                               bool aIsBegin,
-                                               RemovalTestFunction aRemove) {
+nsresult SMILTimedElement::SetBeginOrEndSpec(const nsAString& aSpec,
+                                             Element& aContextElement,
+                                             bool aIsBegin,
+                                             RemovalTestFunction aRemove) {
   TimeValueSpecList& timeSpecsList = aIsBegin ? mBeginSpecs : mEndSpecs;
   InstanceTimeList& instances = aIsBegin ? mBeginInstances : mEndInstances;
 
   ClearSpecs(timeSpecsList, instances, aRemove);
 
   AutoIntervalUpdateBatcher updateBatcher(*this);
 
   nsCharSeparatedTokenizer tokenizer(aSpec, ';');
@@ -1174,56 +1173,56 @@ nsresult nsSMILTimedElement::SetBeginOrE
 
 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(nsSMILTimedElement::RemovalTestFunction aFunction)
+  explicit RemoveByFunction(SMILTimedElement::RemovalTestFunction aFunction)
       : mFunction(aFunction) {}
   bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) {
     return mFunction(aInstanceTime);
   }
 
  private:
-  nsSMILTimedElement::RemovalTestFunction mFunction;
+  SMILTimedElement::RemovalTestFunction mFunction;
 };
 }  // namespace
 
-void nsSMILTimedElement::ClearSpecs(TimeValueSpecList& aSpecs,
-                                    InstanceTimeList& aInstances,
-                                    RemovalTestFunction aRemove) {
+void SMILTimedElement::ClearSpecs(TimeValueSpecList& aSpecs,
+                                  InstanceTimeList& aInstances,
+                                  RemovalTestFunction aRemove) {
   AutoIntervalUpdateBatcher updateBatcher(*this);
 
   for (uint32_t i = 0; i < aSpecs.Length(); ++i) {
     aSpecs[i]->Unlink();
   }
   aSpecs.Clear();
 
   RemoveByFunction removeByFunction(aRemove);
   RemoveInstanceTimes(aInstances, removeByFunction);
 }
 
-void nsSMILTimedElement::ClearIntervals() {
+void SMILTimedElement::ClearIntervals() {
   if (mElementState != STATE_STARTUP) {
     mElementState = STATE_POSTACTIVE;
   }
   mCurrentRepeatIteration = 0;
   ResetCurrentInterval();
 
   // Remove old intervals
   for (int32_t i = mOldIntervals.Length() - 1; i >= 0; --i) {
     mOldIntervals[i]->Unlink();
   }
   mOldIntervals.Clear();
 }
 
-bool nsSMILTimedElement::ApplyEarlyEnd(const nsSMILTimeValue& aSampleTime) {
+bool SMILTimedElement::ApplyEarlyEnd(const nsSMILTimeValue& 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) {
@@ -1261,38 +1260,38 @@ class MOZ_STACK_CLASS RemoveReset {
            (!mCurrentIntervalBegin || aInstanceTime != mCurrentIntervalBegin);
   }
 
  private:
   const nsSMILInstanceTime* mCurrentIntervalBegin;
 };
 }  // namespace
 
-void nsSMILTimedElement::Reset() {
+void SMILTimedElement::Reset() {
   RemoveReset resetBegin(mCurrentInterval ? mCurrentInterval->Begin()
                                           : nullptr);
   RemoveInstanceTimes(mBeginInstances, resetBegin);
 
   RemoveReset resetEnd(nullptr);
   RemoveInstanceTimes(mEndInstances, resetEnd);
 }
 
-void nsSMILTimedElement::ClearTimingState(RemovalTestFunction aRemove) {
+void SMILTimedElement::ClearTimingState(RemovalTestFunction aRemove) {
   mElementState = STATE_STARTUP;
   ClearIntervals();
 
   UnsetBeginSpec(aRemove);
   UnsetEndSpec(aRemove);
 
   if (mClient) {
     mClient->Inactivate(false);
   }
 }
 
-void nsSMILTimedElement::RebuildTimingState(RemovalTestFunction aRemove) {
+void SMILTimedElement::RebuildTimingState(RemovalTestFunction aRemove) {
   MOZ_ASSERT(mAnimationElement,
              "Attempting to enable a timed element not attached to an "
              "animation element");
   MOZ_ASSERT(mElementState == STATE_STARTUP,
              "Rebuilding timing state from non-startup state");
 
   if (mAnimationElement->HasAttr(nsGkAtoms::begin)) {
     nsAutoString attValue;
@@ -1305,17 +1304,17 @@ void nsSMILTimedElement::RebuildTimingSt
     mAnimationElement->GetAttr(nsGkAtoms::end, attValue);
     SetEndSpec(attValue, *mAnimationElement, aRemove);
   }
 
   mPrevRegisteredMilestone = sMaxMilestone;
   RegisterMilestone();
 }
 
-void nsSMILTimedElement::DoPostSeek() {
+void SMILTimedElement::DoPostSeek() {
   // Finish backwards seek
   if (mSeekState == SEEK_BACKWARD_FROM_INACTIVE ||
       mSeekState == SEEK_BACKWARD_FROM_ACTIVE) {
     // Previously some dynamic instance times may have been marked to be
     // preserved because they were endpoints of an historic interval (which may
     // or may not have been filtered). Now that we've finished a seek we should
     // clear that flag for those instance times whose intervals are no longer
     // historic.
@@ -1350,39 +1349,39 @@ void nsSMILTimedElement::DoPostSeek() {
     case SEEK_NOT_SEEKING:
       /* Do nothing */
       break;
   }
 
   mSeekState = SEEK_NOT_SEEKING;
 }
 
-void nsSMILTimedElement::UnpreserveInstanceTimes(InstanceTimeList& aList) {
+void SMILTimedElement::UnpreserveInstanceTimes(InstanceTimeList& aList) {
   const nsSMILInterval* prevInterval = GetPreviousInterval();
   const nsSMILInstanceTime* 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();
     if (!cutoff || cutoff->Time().CompareTo(instance->Time()) < 0) {
       instance->UnmarkShouldPreserve();
     }
   }
 }
 
-void nsSMILTimedElement::FilterHistory() {
+void SMILTimedElement::FilterHistory() {
   // We should filter the intervals first, since instance times still used in an
   // interval won't be filtered.
   FilterIntervals();
   FilterInstanceTimes(mBeginInstances);
   FilterInstanceTimes(mEndInstances);
 }
 
-void nsSMILTimedElement::FilterIntervals() {
+void SMILTimedElement::FilterIntervals() {
   // We can filter old intervals that:
   //
   // a) are not the previous interval; AND
   // b) are not in the middle of a dependency chain; AND
   // c) are not the first interval
   //
   // Condition (a) is necessary since the previous interval is used for applying
   // fill effects and updating the current interval.
@@ -1452,17 +1451,17 @@ class MOZ_STACK_CLASS RemoveBelowThresho
   }
 
  private:
   uint32_t mThreshold;
   nsTArray<const nsSMILInstanceTime*>& mTimesToKeep;
 };
 }  // namespace
 
-void nsSMILTimedElement::FilterInstanceTimes(InstanceTimeList& aList) {
+void SMILTimedElement::FilterInstanceTimes(InstanceTimeList& aList) {
   if (GetPreviousInterval()) {
     RemoveFiltered removeFiltered(GetPreviousInterval()->End()->Time());
     RemoveInstanceTimes(aList, removeFiltered);
   }
 
   // As with intervals it is possible to create a document that, even despite
   // our most aggressive filtering, will generate instance times indefinitely
   // (e.g. cyclic dependencies with TimeEvents---we can't filter such times as
@@ -1492,17 +1491,17 @@ void nsSMILTimedElement::FilterInstanceT
 }
 
 //
 // 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 nsSMILTimedElement::GetNextInterval(
+bool SMILTimedElement::GetNextInterval(
     const nsSMILInterval* aPrevInterval,
     const nsSMILInterval* aReplacedInterval,
     const nsSMILInstanceTime* aFixedBeginTime, nsSMILInterval& aResult) const {
   MOZ_ASSERT(!aFixedBeginTime || aFixedBeginTime->Time().IsDefinite(),
              "Unresolved or indefinite begin time given for interval start");
   static const nsSMILTimeValue zeroTime(0L);
 
   if (mRestartMode == RESTART_NEVER && aPrevInterval) return false;
@@ -1647,27 +1646,27 @@ bool nsSMILTimedElement::GetNextInterval
 
     beginAfter = tempEnd->Time();
   }
   MOZ_ASSERT_UNREACHABLE("Hmm... we really shouldn't be here");
 
   return false;
 }
 
-nsSMILInstanceTime* nsSMILTimedElement::GetNextGreater(
+nsSMILInstanceTime* SMILTimedElement::GetNextGreater(
     const InstanceTimeList& aList, const nsSMILTimeValue& aBase,
     int32_t& aPosition) const {
   nsSMILInstanceTime* result = nullptr;
   while ((result = GetNextGreaterOrEqual(aList, aBase, aPosition)) &&
          result->Time() == aBase) {
   }
   return result;
 }
 
-nsSMILInstanceTime* nsSMILTimedElement::GetNextGreaterOrEqual(
+nsSMILInstanceTime* SMILTimedElement::GetNextGreaterOrEqual(
     const InstanceTimeList& aList, const nsSMILTimeValue& aBase,
     int32_t& aPosition) const {
   nsSMILInstanceTime* result = nullptr;
   int32_t count = aList.Length();
 
   for (; aPosition < count && !result; ++aPosition) {
     nsSMILInstanceTime* val = aList[aPosition].get();
     MOZ_ASSERT(val, "NULL instance time in list");
@@ -1677,17 +1676,17 @@ nsSMILInstanceTime* nsSMILTimedElement::
   }
 
   return result;
 }
 
 /**
  * @see SMILANIM 3.3.4
  */
-nsSMILTimeValue nsSMILTimedElement::CalcActiveEnd(
+nsSMILTimeValue SMILTimedElement::CalcActiveEnd(
     const nsSMILTimeValue& aBegin, const nsSMILTimeValue& aEnd) const {
   nsSMILTimeValue result;
 
   MOZ_ASSERT(mSimpleDur.IsResolved(),
              "Unresolved simple duration in CalcActiveEnd");
   MOZ_ASSERT(aBegin.IsDefinite(),
              "Indefinite or unresolved begin time in CalcActiveEnd");
 
@@ -1708,17 +1707,17 @@ nsSMILTimeValue nsSMILTimedElement::Calc
   if (result.IsDefinite()) {
     nsSMILTime activeEnd = result.GetMillis() + aBegin.GetMillis();
     result.SetMillis(activeEnd);
   }
 
   return result;
 }
 
-nsSMILTimeValue nsSMILTimedElement::GetRepeatDuration() const {
+nsSMILTimeValue SMILTimedElement::GetRepeatDuration() const {
   nsSMILTimeValue multipliedDuration;
   if (mRepeatCount.IsDefinite() && mSimpleDur.IsDefinite()) {
     if (mRepeatCount * double(mSimpleDur.GetMillis()) <=
         std::numeric_limits<nsSMILTime>::max()) {
       multipliedDuration.SetMillis(
           nsSMILTime(mRepeatCount * mSimpleDur.GetMillis()));
     }
   } else {
@@ -1733,17 +1732,17 @@ nsSMILTimeValue nsSMILTimedElement::GetR
     repeatDuration = multipliedDuration;
   } else {
     repeatDuration = mSimpleDur;
   }
 
   return repeatDuration;
 }
 
-nsSMILTimeValue nsSMILTimedElement::ApplyMinAndMax(
+nsSMILTimeValue SMILTimedElement::ApplyMinAndMax(
     const nsSMILTimeValue& aDuration) const {
   if (!aDuration.IsResolved()) {
     return aDuration;
   }
 
   if (mMax < mMin) {
     return aDuration;
   }
@@ -1756,17 +1755,17 @@ nsSMILTimeValue nsSMILTimedElement::Appl
     result = mMin;
   } else {
     result = aDuration;
   }
 
   return result;
 }
 
-nsSMILTime nsSMILTimedElement::ActiveTimeToSimpleTime(
+nsSMILTime SMILTimedElement::ActiveTimeToSimpleTime(
     nsSMILTime aActiveTime, uint32_t& aRepeatIteration) {
   nsSMILTime result;
 
   MOZ_ASSERT(mSimpleDur.IsResolved(),
              "Unresolved simple duration in ActiveTimeToSimpleTime");
   MOZ_ASSERT(aActiveTime >= 0, "Expecting non-negative active time");
   // Note that a negative aActiveTime will give us a negative value for
   // aRepeatIteration, which is bad because aRepeatIteration is unsigned
@@ -1789,17 +1788,17 @@ nsSMILTime nsSMILTimedElement::ActiveTim
 // 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* nsSMILTimedElement::CheckForEarlyEnd(
+nsSMILInstanceTime* SMILTimedElement::CheckForEarlyEnd(
     const nsSMILTimeValue& 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(
       mBeginInstances, mCurrentInterval->Begin()->Time(), position);
@@ -1808,17 +1807,17 @@ nsSMILInstanceTime* nsSMILTimedElement::
       nextBegin->Time() < mCurrentInterval->End()->Time() &&
       nextBegin->Time() <= aContainerTime) {
     return nextBegin;
   }
 
   return nullptr;
 }
 
-void nsSMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice) {
+void SMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice) {
   // Check if updates are currently blocked (batched)
   if (mDeferIntervalUpdates) {
     mDoDeferredUpdate = true;
     return;
   }
 
   // We adopt the convention of not resolving intervals until the first
   // sample. Otherwise, every time each attribute is set we'll re-resolve the
@@ -1912,26 +1911,26 @@ void nsSMILTimedElement::UpdateCurrentIn
       AutoRestore<uint8_t> deleteCountRestorer(mDeleteCount);
       ++mDeleteCount;
       mElementState = STATE_POSTACTIVE;
       ResetCurrentInterval();
     }
   }
 }
 
-void nsSMILTimedElement::SampleSimpleTime(nsSMILTime aActiveTime) {
+void SMILTimedElement::SampleSimpleTime(nsSMILTime aActiveTime) {
   if (mClient) {
     uint32_t repeatIteration;
     nsSMILTime simpleTime =
         ActiveTimeToSimpleTime(aActiveTime, repeatIteration);
     mClient->SampleAt(simpleTime, mSimpleDur, repeatIteration);
   }
 }
 
-void nsSMILTimedElement::SampleFillValue() {
+void SMILTimedElement::SampleFillValue() {
   if (mFillMode != FILL_FREEZE || !mClient) return;
 
   nsSMILTime activeTime;
 
   if (mElementState == STATE_WAITING || mElementState == STATE_POSTACTIVE) {
     const nsSMILInterval* prevInterval = GetPreviousInterval();
     MOZ_ASSERT(prevInterval,
                "Attempting to sample fill value but there is no previous "
@@ -1970,17 +1969,17 @@ void nsSMILTimedElement::SampleFillValue
 
   if (simpleTime == 0L && repeatIteration) {
     mClient->SampleLastValue(--repeatIteration);
   } else {
     mClient->SampleAt(simpleTime, mSimpleDur, repeatIteration);
   }
 }
 
-nsresult nsSMILTimedElement::AddInstanceTimeFromCurrentTime(
+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));
@@ -1988,17 +1987,17 @@ nsresult nsSMILTimedElement::AddInstance
   RefPtr<nsSMILInstanceTime> instanceTime =
       new nsSMILInstanceTime(timeVal, nsSMILInstanceTime::SOURCE_DOM);
 
   AddInstanceTime(instanceTime, aIsBegin);
 
   return NS_OK;
 }
 
-void nsSMILTimedElement::RegisterMilestone() {
+void SMILTimedElement::RegisterMilestone() {
   nsSMILTimeContainer* container = GetTimeContainer();
   if (!container) return;
   MOZ_ASSERT(mAnimationElement,
              "Got a time container without an owning animation element");
 
   nsSMILMilestone nextMilestone;
   if (!GetNextMilestone(nextMilestone)) return;
 
@@ -2007,18 +2006,17 @@ void nsSMILTimedElement::RegisterMilesto
   // out redundant milestones we do some rudimentary filtering here. It's not
   // perfect, but unnecessary samples are fairly cheap.
   if (nextMilestone >= mPrevRegisteredMilestone) return;
 
   container->AddMilestone(nextMilestone, *mAnimationElement);
   mPrevRegisteredMilestone = nextMilestone;
 }
 
-bool nsSMILTimedElement::GetNextMilestone(
-    nsSMILMilestone& aNextMilestone) const {
+bool SMILTimedElement::GetNextMilestone(nsSMILMilestone& aNextMilestone) const {
   // Return the next key moment in our lifetime.
   //
   // XXX It may be possible in future to optimise this so that we only register
   // for milestones if:
   // a) We have time dependents, or
   // b) We are dependent on events or syncbase relationships, or
   // c) There are registered listeners for our events
   //
@@ -2078,17 +2076,17 @@ bool nsSMILTimedElement::GetNextMileston
     }
 
     case STATE_POSTACTIVE:
       return false;
   }
   MOZ_CRASH("Invalid element state");
 }
 
-void nsSMILTimedElement::NotifyNewInterval() {
+void SMILTimedElement::NotifyNewInterval() {
   MOZ_ASSERT(mCurrentInterval,
              "Attempting to notify dependents of a new interval but the "
              "interval is not set");
 
   nsSMILTimeContainer* container = GetTimeContainer();
   if (container) {
     container->SyncPauseTime();
   }
@@ -2102,19 +2100,19 @@ void nsSMILTimedElement::NotifyNewInterv
     if (!interval) {
       break;
     }
     nsSMILTimeValueSpec* spec = iter.Get()->GetKey();
     spec->HandleNewInterval(*interval, container);
   }
 }
 
-void nsSMILTimedElement::NotifyChangedInterval(nsSMILInterval* aInterval,
-                                               bool aBeginObjectChanged,
-                                               bool aEndObjectChanged) {
+void SMILTimedElement::NotifyChangedInterval(nsSMILInterval* aInterval,
+                                             bool aBeginObjectChanged,
+                                             bool aEndObjectChanged) {
   MOZ_ASSERT(aInterval, "Null interval for change notification");
 
   nsSMILTimeContainer* container = GetTimeContainer();
   if (container) {
     container->SyncPauseTime();
   }
 
   // Copy the instance times list since notifying the instance times can result
@@ -2124,65 +2122,65 @@ void nsSMILTimedElement::NotifyChangedIn
   aInterval->GetDependentTimes(times);
 
   for (uint32_t i = 0; i < times.Length(); ++i) {
     times[i]->HandleChangedInterval(container, aBeginObjectChanged,
                                     aEndObjectChanged);
   }
 }
 
-void nsSMILTimedElement::FireTimeEventAsync(EventMessage aMsg,
-                                            int32_t aDetail) {
+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* nsSMILTimedElement::GetEffectiveBeginInstance()
-    const {
+const nsSMILInstanceTime* SMILTimedElement::GetEffectiveBeginInstance() const {
   switch (mElementState) {
     case STATE_STARTUP:
       return nullptr;
 
     case STATE_ACTIVE:
       return mCurrentInterval->Begin();
 
     case STATE_WAITING:
     case STATE_POSTACTIVE: {
       const nsSMILInterval* prevInterval = GetPreviousInterval();
       return prevInterval ? prevInterval->Begin() : nullptr;
     }
   }
   MOZ_CRASH("Invalid element state");
 }
 
-const nsSMILInterval* nsSMILTimedElement::GetPreviousInterval() const {
+const nsSMILInterval* SMILTimedElement::GetPreviousInterval() const {
   return mOldIntervals.IsEmpty()
              ? nullptr
              : mOldIntervals[mOldIntervals.Length() - 1].get();
 }
 
-bool nsSMILTimedElement::HasClientInFillRange() const {
+bool SMILTimedElement::HasClientInFillRange() const {
   // Returns true if we have a client that is in the range where it will fill
   return mClient && ((mElementState != STATE_ACTIVE && HasPlayed()) ||
                      (mElementState == STATE_ACTIVE && !mClient->IsActive()));
 }
 
-bool nsSMILTimedElement::EndHasEventConditions() const {
+bool SMILTimedElement::EndHasEventConditions() const {
   for (uint32_t i = 0; i < mEndSpecs.Length(); ++i) {
     if (mEndSpecs[i]->IsEventBased()) return true;
   }
   return false;
 }
 
-bool nsSMILTimedElement::AreEndTimesDependentOn(
+bool SMILTimedElement::AreEndTimesDependentOn(
     const nsSMILInstanceTime* 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;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILTimedElement.h
rename to dom/smil/SMILTimedElement.h
--- a/dom/smil/nsSMILTimedElement.h
+++ b/dom/smil/SMILTimedElement.h
@@ -26,28 +26,26 @@ class nsSMILTimeContainer;
 class nsSMILTimeValue;
 class nsAtom;
 
 namespace mozilla {
 class SMILAnimationFunction;
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
-}  // namespace mozilla
 
 //----------------------------------------------------------------------
-// nsSMILTimedElement
+// SMILTimedElement
 
-class nsSMILTimedElement {
+class SMILTimedElement {
  public:
-  nsSMILTimedElement();
-  ~nsSMILTimedElement();
+  SMILTimedElement();
+  ~SMILTimedElement();
 
   typedef mozilla::dom::Element Element;
-  typedef mozilla::SMILAnimationFunction SMILAnimationFunction;
 
   /*
    * Sets the owning animation element which this class uses to convert between
    * container times and to register timebase elements.
    */
   void SetAnimationElement(mozilla::dom::SVGAnimationElement* aElement);
 
   /*
@@ -311,17 +309,17 @@ class nsSMILTimedElement {
    * 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.
    *
    * @param aOther    The potential syncbase element.
    * @return true if this timed element's begin time for the currently
    * effective interval is directly or indirectly derived from aOther, false
    * otherwise.
    */
-  bool IsTimeDependent(const nsSMILTimedElement& aOther) const;
+  bool IsTimeDependent(const SMILTimedElement& aOther) const;
 
   /**
    * Called when the timed element has been bound to the document so that
    * references from this timed element to other elements can be resolved.
    *
    * @param aContextElement The element which provides the necessary context for
    *                        resolving references. This is typically the element
    *                        in the host language that owns this timed element.
@@ -343,19 +341,19 @@ class nsSMILTimedElement {
   // Cycle collection
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
   void Unlink();
 
   typedef bool (*RemovalTestFunction)(nsSMILInstanceTime* aInstance);
 
  protected:
   // Typedefs
-  typedef nsTArray<mozilla::UniquePtr<nsSMILTimeValueSpec>> TimeValueSpecList;
+  typedef nsTArray<UniquePtr<nsSMILTimeValueSpec>> TimeValueSpecList;
   typedef nsTArray<RefPtr<nsSMILInstanceTime>> InstanceTimeList;
-  typedef nsTArray<mozilla::UniquePtr<nsSMILInterval>> IntervalList;
+  typedef nsTArray<UniquePtr<nsSMILInterval>> IntervalList;
   typedef nsPtrHashKey<nsSMILTimeValueSpec> TimeValueSpecPtrKey;
   typedef nsTHashtable<TimeValueSpecPtrKey> TimeValueSpecHashSet;
 
   // Helper classes
   class InstanceTimeComparator {
    public:
     bool Equals(const nsSMILInstanceTime* aElem1,
                 const nsSMILInstanceTime* aElem2) const;
@@ -525,17 +523,17 @@ class nsSMILTimedElement {
   // (i)  we should not perform notification until this object is in
   //      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(nsSMILInterval* aInterval,
                              bool aBeginObjectChanged, bool aEndObjectChanged);
 
-  void FireTimeEventAsync(mozilla::EventMessage aMsg, int32_t aDetail);
+  void FireTimeEventAsync(EventMessage aMsg, int32_t aDetail);
   const nsSMILInstanceTime* GetEffectiveBeginInstance() const;
   const nsSMILInterval* GetPreviousInterval() const;
   bool HasPlayed() const { return !mOldIntervals.IsEmpty(); }
   bool HasClientInFillRange() const;
   bool EndHasEventConditions() const;
   bool AreEndTimesDependentOn(const nsSMILInstanceTime* aBase) const;
 
   // Reset the current interval by first passing ownership to a temporary
@@ -577,17 +575,17 @@ class nsSMILTimedElement {
   nsSMILRestartMode mRestartMode;
   static const nsAttrValue::EnumTable sRestartModeTable[];
 
   InstanceTimeList mBeginInstances;
   InstanceTimeList mEndInstances;
   uint32_t mInstanceSerialIndex;
 
   SMILAnimationFunction* mClient;
-  mozilla::UniquePtr<nsSMILInterval> mCurrentInterval;
+  UniquePtr<nsSMILInterval> mCurrentInterval;
   IntervalList mOldIntervals;
   uint32_t mCurrentRepeatIteration;
   nsSMILMilestone mPrevRegisteredMilestone;
   static const nsSMILMilestone sMaxMilestone;
   static const uint8_t sMaxNumIntervals;
   static const uint8_t sMaxNumInstanceTimes;
 
   // Set of dependent time value specs to be notified when establishing a new
@@ -630,19 +628,21 @@ class nsSMILTimedElement {
   class AutoIntervalUpdater;
 
   // Recursion depth checking
   uint8_t mDeleteCount;
   uint8_t mUpdateIntervalRecursionDepth;
   static const uint8_t sMaxUpdateIntervalRecursionDepth;
 };
 
-inline void ImplCycleCollectionUnlink(nsSMILTimedElement& aField) {
+inline void ImplCycleCollectionUnlink(SMILTimedElement& aField) {
   aField.Unlink();
 }
 
 inline void ImplCycleCollectionTraverse(
-    nsCycleCollectionTraversalCallback& aCallback, nsSMILTimedElement& aField,
+    nsCycleCollectionTraversalCallback& aCallback, SMILTimedElement& aField,
     const char* aName, uint32_t aFlags = 0) {
   aField.Traverse(&aCallback);
 }
 
+}  // namespace mozilla
+
 #endif  // NS_SMILTIMEDELEMENT_H_
--- 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',
-    'nsSMILCompositorTable.h',
     'nsSMILCSSProperty.h',
     'nsSMILInstanceTime.h',
     'nsSMILInterval.h',
     'nsSMILKeySpline.h',
     'nsSMILMilestone.h',
     'nsSMILRepeatCount.h',
     'nsSMILTargetIdentifier.h',
     'nsSMILTimeContainer.h',
-    'nsSMILTimedElement.h',
     'nsSMILTimeValue.h',
     'nsSMILTimeValueSpec.h',
     'nsSMILTimeValueSpecParams.h',
     'nsSMILTypes.h',
     'nsSMILValue.h',
     'SMILCSSValueType.h',
     'SMILNullType.h',
     'SMILType.h',
 ]
 
 EXPORTS.mozilla += [
     'SMILAnimationController.h',
     'SMILAnimationFunction.h',
+    'SMILCompositorTable.h',
     'SMILSetAnimationFunction.h',
+    'SMILTimedElement.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'TimeEvent.h',
 ]
 
 UNIFIED_SOURCES += [
-    'nsSMILCompositor.cpp',
     'nsSMILCSSProperty.cpp',
     'nsSMILInstanceTime.cpp',
     'nsSMILInterval.cpp',
     'nsSMILKeySpline.cpp',
     'nsSMILParserUtils.cpp',
     'nsSMILRepeatCount.cpp',
     'nsSMILTimeContainer.cpp',
-    'nsSMILTimedElement.cpp',
     'nsSMILTimeValue.cpp',
     'nsSMILTimeValueSpec.cpp',
     'nsSMILValue.cpp',
     'SMILAnimationController.cpp',
     'SMILAnimationFunction.cpp',
     'SMILBoolType.cpp',
+    'SMILCompositor.cpp',
     'SMILCSSValueType.cpp',
     'SMILEnumType.cpp',
     'SMILFloatType.cpp',
     'SMILIntegerType.cpp',
     'SMILNullType.cpp',
     'SMILSetAnimationFunction.cpp',
     'SMILStringType.cpp',
+    'SMILTimedElement.cpp',
     'TimeEvent.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/svg',
     '/layout/base',
     '/layout/style',
--- a/dom/smil/nsSMILInstanceTime.h
+++ b/dom/smil/nsSMILInstanceTime.h
@@ -17,22 +17,22 @@ class nsSMILTimeValueSpec;
 // nsSMILInstanceTime
 //
 // 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
 //
-// These objects are owned by an nsSMILTimedElement but MAY also be referenced
+// These objects are owned by an SMILTimedElement but MAY also be referenced
 // by:
 //
-// a) nsSMILIntervals that belong to the same nsSMILTimedElement and which refer
+// a) nsSMILIntervals that belong to the same SMILTimedElement and which refer
 //    to the nsSMILInstanceTimes which form the interval endpoints; and/or
-// b) nsSMILIntervals that belong to other nsSMILTimedElements but which need to
+// b) nsSMILIntervals 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
 //    performed by the nsSMILInterval.
 
 class nsSMILInstanceTime final {
  public:
   // Instance time source. Times generated by events, syncbase relationships,
@@ -109,17 +109,17 @@ class nsSMILInstanceTime final {
     // 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
-    // not be filtered out by the nsSMILTimedElement even if they appear to be
+    // 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
     // reset we should clear all the instance times that have been generated by
     // that attribute (and hence an nsSMILTimeValueSpec), but not those from the
     // DOM.
@@ -130,17 +130,17 @@ class nsSMILInstanceTime final {
     // should be preserved and not filtered.
     kWasDynamicEndpoint = 8
   };
   uint8_t mFlags;         // Combination of kDynamic, kMayUpdate, etc.
   mutable bool mVisited;  // Cycle tracking
 
   // Additional reference count to determine if this instance time is currently
   // used as a fixed endpoint in any intervals. Instance times that are used in
-  // this way should not be removed when the owning nsSMILTimedElement removes
+  // this way should not be removed when the owning SMILTimedElement removes
   // instance times in response to a restart or in an attempt to free up memory
   // by filtering out old instance times.
   //
   // Instance times are only shared in a few cases, namely:
   // a) early ends,
   // b) zero-duration intervals,
   // c) momentarily whilst establishing new intervals and updating the current
   //    interval, and
--- a/dom/smil/nsSMILMilestone.h
+++ b/dom/smil/nsSMILMilestone.h
@@ -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/. */
 
 #ifndef NS_SMILMILESTONE_H_
 #define NS_SMILMILESTONE_H_
 
 /*
- * A significant moment in an nsSMILTimedElement's lifetime where a sample is
+ * A significant moment in an SMILTimedElement's lifetime where a sample is
  * required.
  *
  * Animations register the next milestone in their lifetime with the time
  * container that they belong to. When the animation controller goes to run
  * a sample it first visits all the animations that have a registered milestone
  * in order of their milestone times. This allows interdependencies between
  * animations to be correctly resolved and events to fire in the proper order.
  *
@@ -22,17 +22,17 @@
  * animation B begins at the same time t (or has some other significant moment
  * such as firing a repeat event), SMIL's endpoint-exclusive timing model
  * implies that the interval end occurs first. In fact, interval ends can be
  * thought of as ending an infinitesimally small time before t. Therefore,
  * A should be sampled before B.
  *
  * Furthermore, this distinction between sampling the end of an interval and
  * a regular sample is used within the timing model (specifically in
- * nsSMILTimedElement) to ensure that all intervals ending at time t are sampled
+ * SMILTimedElement) to ensure that all intervals ending at time t are sampled
  * before any new intervals are entered so that we have a fully up-to-date set
  * of instance times available before committing to a new interval. Once an
  * interval is entered, the begin time is fixed.
  */
 class nsSMILMilestone {
  public:
   nsSMILMilestone(nsSMILTime aTime, bool aIsEnd)
       : mTime(aTime), mIsEnd(aIsEnd) {}
--- a/dom/smil/nsSMILTargetIdentifier.h
+++ b/dom/smil/nsSMILTargetIdentifier.h
@@ -10,17 +10,17 @@
 #include "mozilla/dom/Element.h"
 
 /**
  * Struct: nsSMILTargetIdentifier
  *
  * Tuple of: { Animated Element, Attribute Name }
  *
  * Used in SMILAnimationController as hash key for mapping an animation
- * target to the nsSMILCompositor for that target.
+ * target to the SMILCompositor for that target.
  *
  * NOTE: Need a nsRefPtr for the element & attribute name, because
  * SMILAnimationController retain its hash table for one sample into the
  * future, and we need to make sure their target isn't deleted in that time.
  */
 
 struct nsSMILTargetIdentifier {
   nsSMILTargetIdentifier()
--- a/dom/smil/nsSMILTimeContainer.cpp
+++ b/dom/smil/nsSMILTimeContainer.cpp
@@ -1,20 +1,20 @@
 /* -*- 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 "nsSMILTimeContainer.h"
-#include "nsSMILTimeValue.h"
-#include "nsSMILTimedElement.h"
-#include <algorithm>
 
 #include "mozilla/AutoRestore.h"
+#include "mozilla/SMILTimedElement.h"
+#include "nsSMILTimeValue.h"
+#include <algorithm>
 
 using namespace mozilla;
 
 nsSMILTimeContainer::nsSMILTimeContainer()
     : mParent(nullptr),
       mCurrentTime(0L),
       mParentOffset(0L),
       mPauseStart(0L),
--- a/dom/smil/nsSMILTimeValue.h
+++ b/dom/smil/nsSMILTimeValue.h
@@ -22,17 +22,17 @@
  *                        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).
  * nsSMILInterval      -- 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 nsSMILTimedElement and its
+ *                        a broker between an SMILTimedElement and its
  *                        nsSMILInstanceTimes 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
--- a/dom/smil/nsSMILTimeValueSpec.cpp
+++ b/dom/smil/nsSMILTimeValueSpec.cpp
@@ -1,23 +1,23 @@
 /* -*- 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/SMILTimedElement.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/dom/TimeEvent.h"
 #include "nsSMILTimeValueSpec.h"
 #include "nsSMILInterval.h"
 #include "nsSMILTimeContainer.h"
 #include "nsSMILTimeValue.h"
-#include "nsSMILTimedElement.h"
 #include "nsSMILInstanceTime.h"
 #include "nsSMILParserUtils.h"
 #include "nsString.h"
 #include <limits>
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
@@ -32,17 +32,17 @@ nsSMILTimeValueSpec::EventListener::Hand
     mSpec->HandleEvent(aEvent);
   }
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSMILTimeValueSpec::nsSMILTimeValueSpec(nsSMILTimedElement& aOwner,
+nsSMILTimeValueSpec::nsSMILTimeValueSpec(SMILTimedElement& aOwner,
                                          bool aIsBegin)
     : mOwner(&aOwner), mIsBegin(aIsBegin), mReferencedElement(this) {}
 
 nsSMILTimeValueSpec::~nsSMILTimeValueSpec() {
   UnregisterFromReferencedElement(mReferencedElement.get());
   if (mEventListener) {
     mEventListener->Disconnect();
     mEventListener = nullptr;
@@ -179,17 +179,17 @@ void nsSMILTimeValueSpec::Unlink() {
 void nsSMILTimeValueSpec::UpdateReferencedElement(Element* aFrom,
                                                   Element* aTo) {
   if (aFrom == aTo) return;
 
   UnregisterFromReferencedElement(aFrom);
 
   switch (mParams.mType) {
     case nsSMILTimeValueSpecParams::SYNCBASE: {
-      nsSMILTimedElement* to = GetTimedElement(aTo);
+      SMILTimedElement* to = GetTimedElement(aTo);
       if (to) {
         to->AddDependent(*this);
       }
     } break;
 
     case nsSMILTimeValueSpecParams::EVENT:
     case nsSMILTimeValueSpecParams::REPEAT:
       RegisterEventListener(aTo);
@@ -200,27 +200,27 @@ void nsSMILTimeValueSpec::UpdateReferenc
       break;
   }
 }
 
 void nsSMILTimeValueSpec::UnregisterFromReferencedElement(Element* aElement) {
   if (!aElement) return;
 
   if (mParams.mType == nsSMILTimeValueSpecParams::SYNCBASE) {
-    nsSMILTimedElement* timedElement = GetTimedElement(aElement);
+    SMILTimedElement* timedElement = GetTimedElement(aElement);
     if (timedElement) {
       timedElement->RemoveDependent(*this);
     }
     mOwner->RemoveInstanceTimesForCreator(this, mIsBegin);
   } else if (IsEventBased()) {
     UnregisterEventListener(aElement);
   }
 }
 
-nsSMILTimedElement* nsSMILTimeValueSpec::GetTimedElement(Element* aElement) {
+SMILTimedElement* nsSMILTimeValueSpec::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() {
--- a/dom/smil/nsSMILTimeValueSpec.h
+++ b/dom/smil/nsSMILTimeValueSpec.h
@@ -9,22 +9,22 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDTracker.h"
 #include "nsSMILTimeValueSpecParams.h"
 #include "nsStringFwd.h"
 #include "nsIDOMEventListener.h"
 
 class nsSMILTimeValue;
-class nsSMILTimedElement;
 class nsSMILTimeContainer;
 class nsSMILInstanceTime;
 class nsSMILInterval;
 
 namespace mozilla {
+class SMILTimedElement;
 namespace dom {
 class Event;
 }  // namespace dom
 
 class EventListenerManager;
 }  // namespace mozilla
 
 //----------------------------------------------------------------------
@@ -35,21 +35,22 @@ class EventListenerManager;
 // 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
 
 class nsSMILTimeValueSpec {
  public:
+  typedef mozilla::SMILTimedElement SMILTimedElement;
   typedef mozilla::dom::Element Element;
   typedef mozilla::dom::Event Event;
   typedef mozilla::dom::IDTracker IDTracker;
 
-  nsSMILTimeValueSpec(nsSMILTimedElement& aOwner, bool aIsBegin);
+  nsSMILTimeValueSpec(SMILTimedElement& aOwner, bool aIsBegin);
   ~nsSMILTimeValueSpec();
 
   nsresult SetSpec(const nsAString& aStringSpec, Element& aContextElement);
   void ResolveReferences(Element& aContextElement);
   bool IsEventBased() const;
 
   void HandleNewInterval(nsSMILInterval& aInterval,
                          const nsSMILTimeContainer* aSrcContainer);
@@ -65,28 +66,28 @@ class nsSMILTimeValueSpec {
 
   // Cycle-collection support
   void Traverse(nsCycleCollectionTraversalCallback* aCallback);
   void Unlink();
 
  protected:
   void UpdateReferencedElement(Element* aFrom, Element* aTo);
   void UnregisterFromReferencedElement(Element* aElement);
-  nsSMILTimedElement* GetTimedElement(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 nsSMILTimeContainer* aSrcContainer);
   bool ApplyOffset(nsSMILTimeValue& aTime) const;
 
-  nsSMILTimedElement* mOwner;
+  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;
 
   /**
--- a/dom/svg/SVGAnimationElement.cpp
+++ b/dom/svg/SVGAnimationElement.cpp
@@ -2,19 +2,19 @@
 /* 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/dom/SVGAnimationElement.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/ElementInlines.h"
+#include "mozilla/SMILAnimationController.h"
+#include "mozilla/SMILAnimationFunction.h"
 #include "nsSMILTimeContainer.h"
-#include "SMILAnimationController.h"
-#include "SMILAnimationFunction.h"
 #include "nsContentUtils.h"
 #include "nsIContentInlines.h"
 #include "nsIURI.h"
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
@@ -78,19 +78,17 @@ bool SVGAnimationElement::GetTargetAttri
   NS_ASSERTION(nameAttr->Type() == nsAttrValue::eAtom,
                "attributeName should have been parsed as an atom");
 
   return NS_SUCCEEDED(nsContentUtils::SplitQName(
       this, nsDependentAtomString(nameAttr->GetAtomValue()), aNamespaceID,
       aLocalName));
 }
 
-nsSMILTimedElement& SVGAnimationElement::TimedElement() {
-  return mTimedElement;
-}
+SMILTimedElement& SVGAnimationElement::TimedElement() { return mTimedElement; }
 
 SVGElement* SVGAnimationElement::GetTargetElement() {
   FlushAnimations();
 
   // We'll just call the other GetTargetElement method, and QI to the right type
   nsIContent* target = GetTargetElementContent();
 
   return (target && target->IsSVGElement()) ? static_cast<SVGElement*>(target)
--- a/dom/svg/SVGAnimationElement.h
+++ b/dom/svg/SVGAnimationElement.h
@@ -4,19 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_SVGAnimationElement_h
 #define mozilla_dom_SVGAnimationElement_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDTracker.h"
+#include "mozilla/dom/SVGElement.h"
 #include "mozilla/dom/SVGTests.h"
-#include "nsSMILTimedElement.h"
-#include "SVGElement.h"
+#include "mozilla/SMILTimedElement.h"
 
 namespace mozilla {
 namespace dom {
 
 typedef SVGElement SVGAnimationElementBase;
 
 enum nsSMILTargetAttrType {
   eSMILTargetAttrType_auto,
@@ -56,17 +56,17 @@ class SVGAnimationElement : public SVGAn
                                 const nsAttrValue* aValue,
                                 const nsAttrValue* aOldValue,
                                 nsIPrincipal* aSubjectPrincipal,
                                 bool aNotify) override;
 
   Element* GetTargetElementContent();
   virtual bool GetTargetAttributeName(int32_t* aNamespaceID,
                                       nsAtom** aLocalName) const;
-  nsSMILTimedElement& TimedElement();
+  mozilla::SMILTimedElement& TimedElement();
   nsSMILTimeContainer* GetTimeContainer();
   virtual SMILAnimationFunction& AnimationFunction() = 0;
 
   virtual bool IsEventAttributeNameInternal(nsAtom* aName) override;
 
   // Utility methods for within SVG
   void ActivateByHyperlink();
 
@@ -115,15 +115,15 @@ class SVGAnimationElement : public SVGAn
     // first time the target changes)
     virtual bool IsPersistent() override { return true; }
 
    private:
     SVGAnimationElement* const mAnimationElement;
   };
 
   HrefTargetTracker mHrefTarget;
-  nsSMILTimedElement mTimedElement;
+  mozilla::SMILTimedElement mTimedElement;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif  // mozilla_dom_SVGAnimationElement_h