Bug 1517715 - Move nsSMILCSSProperty, nsSMILKeySpline and nsSMILParserUtils to the mozilla namespace r=bbirtles
authorlongsonr <longsonr@gmail.com>
Tue, 08 Jan 2019 07:55:14 +0000
changeset 510000 0db2741d6edaefd516f8baa2041cf670a25aeb06
parent 509999 2bd9efc392886fd31f0925e8163fcdd160f24113
child 510001 81ddd47b2cae63f03d4e70853f5bd5262ff1afc4
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
bugs1517715
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 1517715 - Move nsSMILCSSProperty, nsSMILKeySpline and nsSMILParserUtils to the mozilla namespace r=bbirtles
dom/animation/ComputedTimingFunction.h
dom/smil/SMILAnimationController.cpp
dom/smil/SMILAnimationFunction.cpp
dom/smil/SMILAnimationFunction.h
dom/smil/SMILCSSProperty.cpp
dom/smil/SMILCSSProperty.h
dom/smil/SMILCSSValueType.cpp
dom/smil/SMILCompositor.cpp
dom/smil/SMILKeySpline.cpp
dom/smil/SMILKeySpline.h
dom/smil/SMILParserUtils.cpp
dom/smil/SMILParserUtils.h
dom/smil/SMILTimedElement.cpp
dom/smil/moz.build
dom/smil/nsSMILCSSProperty.cpp
dom/smil/nsSMILCSSProperty.h
dom/smil/nsSMILKeySpline.cpp
dom/smil/nsSMILKeySpline.h
dom/smil/nsSMILParserUtils.cpp
dom/smil/nsSMILParserUtils.h
dom/smil/nsSMILTimeValueSpec.cpp
dom/smil/test/test_smilKeySplines.xhtml
dom/svg/SVGMotionSMILAnimationFunction.cpp
dom/svg/SVGMotionSMILPathUtils.h
layout/generic/ScrollAnimationBezierPhysics.cpp
layout/generic/ScrollAnimationBezierPhysics.h
layout/generic/nsGfxScrollFrame.cpp
layout/painting/nsDisplayList.cpp
--- a/dom/animation/ComputedTimingFunction.h
+++ b/dom/animation/ComputedTimingFunction.h
@@ -3,22 +3,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ComputedTimingFunction_h
 #define mozilla_ComputedTimingFunction_h
 
 #include "nsDebug.h"
-#include "nsSMILKeySpline.h"  // nsSMILKeySpline
 #include "nsStringFwd.h"
 #include "nsTimingFunction.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Maybe.h"
+#include "mozilla/SMILKeySpline.h"
 
 namespace mozilla {
 
 class ComputedTimingFunction {
  public:
   enum class Type : uint8_t {
     Ease = uint8_t(StyleTimingKeyword::Ease),            // ease
     Linear = uint8_t(StyleTimingKeyword::Linear),        // linear
@@ -51,17 +51,17 @@ class ComputedTimingFunction {
     Init(aFunction);
   }
   void Init(const nsTimingFunction& aFunction);
 
   // BeforeFlag is used in step timing function.
   // https://drafts.csswg.org/css-easing/#before-flag
   enum class BeforeFlag { Unset, Set };
   double GetValue(double aPortion, BeforeFlag aBeforeFlag) const;
-  const nsSMILKeySpline* GetFunction() const {
+  const SMILKeySpline* GetFunction() const {
     NS_ASSERTION(HasSpline(), "Type mismatch");
     return &mTimingFunction;
   }
   Type GetType() const { return mType; }
   bool HasSpline() const { return mType != Type::Step; }
   const StepFunc& GetSteps() const {
     MOZ_ASSERT(mType == Type::Step);
     return mSteps;
@@ -105,17 +105,17 @@ class ComputedTimingFunction {
 
  private:
   ComputedTimingFunction(double x1, double y1, double x2, double y2)
       : mType(Type::CubicBezier), mTimingFunction(x1, y1, x2, y2) {}
   ComputedTimingFunction(uint32_t aSteps, StyleStepPosition aPos)
       : mType(Type::Step), mSteps{aSteps, aPos} {}
 
   Type mType;
-  nsSMILKeySpline mTimingFunction;
+  SMILKeySpline mTimingFunction;
   StepFunc mSteps;
 };
 
 inline bool operator==(const Maybe<ComputedTimingFunction>& aLHS,
                        const nsTimingFunction& aRHS) {
   if (aLHS.isNothing()) {
     return aRHS.IsLinear();
   }
--- a/dom/smil/SMILAnimationController.cpp
+++ b/dom/smil/SMILAnimationController.cpp
@@ -1,31 +1,31 @@
 /* -*- 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/SMILAnimationController.h"
+#include "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 "mozilla/dom/Document.h"
 #include "nsIPresShell.h"
 #include "nsIPresShellInlines.h"
 #include "nsITimer.h"
 #include "SMILCompositor.h"
-#include "nsSMILCSSProperty.h"
+#include "SMILCSSProperty.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 //----------------------------------------------------------------------
 // SMILAnimationController implementation
 
--- a/dom/smil/SMILAnimationFunction.cpp
+++ b/dom/smil/SMILAnimationFunction.cpp
@@ -2,21 +2,21 @@
 /* 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/SMILParserUtils.h"
 #include "mozilla/SMILTimedElement.h"
 #include "mozilla/Move.h"
 #include "nsISMILAttr.h"
 #include "SMILCSSValueType.h"
-#include "nsSMILParserUtils.h"
 #include "SMILNullType.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsIContent.h"
 #include "nsContentUtils.h"
 #include "nsReadableUtils.h"
@@ -631,17 +631,17 @@ double SMILAnimationFunction::ScaleSimpl
 double SMILAnimationFunction::ScaleIntervalProgress(double aProgress,
                                                     uint32_t aIntervalIndex) {
   if (GetCalcMode() != CALC_SPLINE) return aProgress;
 
   if (!HasAttr(nsGkAtoms::keySplines)) return aProgress;
 
   MOZ_ASSERT(aIntervalIndex < mKeySplines.Length(), "Invalid interval index");
 
-  nsSMILKeySpline const& spline = mKeySplines[aIntervalIndex];
+  SMILKeySpline const& spline = mKeySplines[aIntervalIndex];
   return spline.GetSplineValue(aProgress);
 }
 
 bool SMILAnimationFunction::HasAttr(nsAtom* aAttName) const {
   return mAnimationElement->HasAttr(aAttName);
 }
 
 const nsAttrValue* SMILAnimationFunction::GetAttr(nsAtom* aAttName) const {
@@ -708,18 +708,18 @@ nsresult SMILAnimationFunction::GetValue
   mValueNeedsReparsingEverySample = false;
   nsSMILValueArray result;
 
   // If "values" is set, use it
   if (HasAttr(nsGkAtoms::values)) {
     nsAutoString attValue;
     GetAttr(nsGkAtoms::values, attValue);
     bool preventCachingOfSandwich = false;
-    if (!nsSMILParserUtils::ParseValues(attValue, mAnimationElement, aSMILAttr,
-                                        result, preventCachingOfSandwich)) {
+    if (!SMILParserUtils::ParseValues(attValue, mAnimationElement, aSMILAttr,
+                                      result, preventCachingOfSandwich)) {
       return NS_ERROR_FAILURE;
     }
 
     if (preventCachingOfSandwich) {
       mValueNeedsReparsingEverySample = true;
     }
     // Else try to/from/by
   } else {
@@ -935,17 +935,17 @@ void SMILAnimationFunction::UnsetCalcMod
 
 nsresult SMILAnimationFunction::SetKeySplines(const nsAString& aKeySplines,
                                               nsAttrValue& aResult) {
   mKeySplines.Clear();
   aResult.SetTo(aKeySplines);
 
   mHasChanged = true;
 
-  if (!nsSMILParserUtils::ParseKeySplines(aKeySplines, mKeySplines)) {
+  if (!SMILParserUtils::ParseKeySplines(aKeySplines, mKeySplines)) {
     mKeySplines.Clear();
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 void SMILAnimationFunction::UnsetKeySplines() {
@@ -956,18 +956,18 @@ void SMILAnimationFunction::UnsetKeySpli
 
 nsresult SMILAnimationFunction::SetKeyTimes(const nsAString& aKeyTimes,
                                             nsAttrValue& aResult) {
   mKeyTimes.Clear();
   aResult.SetTo(aKeyTimes);
 
   mHasChanged = true;
 
-  if (!nsSMILParserUtils::ParseSemicolonDelimitedProgressList(aKeyTimes, true,
-                                                              mKeyTimes)) {
+  if (!SMILParserUtils::ParseSemicolonDelimitedProgressList(aKeyTimes, true,
+                                                            mKeyTimes)) {
     mKeyTimes.Clear();
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 void SMILAnimationFunction::UnsetKeyTimes() {
--- a/dom/smil/SMILAnimationFunction.h
+++ b/dom/smil/SMILAnimationFunction.h
@@ -3,25 +3,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILANIMATIONFUNCTION_H_
 #define NS_SMILANIMATIONFUNCTION_H_
 
 #include "mozilla/SMILTargetIdentifier.h"
-#include "nsISMILAttr.h"
+#include "nsAttrValue.h"
 #include "nsGkAtoms.h"
-#include "nsString.h"
+#include "nsISMILAttr.h"
+#include "SMILKeySpline.h"
 #include "nsSMILTimeValue.h"
-#include "nsSMILKeySpline.h"
+#include "nsSMILTypes.h"
 #include "nsSMILValue.h"
+#include "nsString.h"
 #include "nsTArray.h"
-#include "nsAttrValue.h"
-#include "nsSMILTypes.h"
 
 namespace mozilla {
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 //----------------------------------------------------------------------
 // SMILAnimationFunction
@@ -396,17 +396,17 @@ class SMILAnimationFunction {
   // Members
   // -------
 
   static nsAttrValue::EnumTable sAdditiveTable[];
   static nsAttrValue::EnumTable sCalcModeTable[];
   static nsAttrValue::EnumTable sAccumulateTable[];
 
   FallibleTArray<double> mKeyTimes;
-  FallibleTArray<nsSMILKeySpline> mKeySplines;
+  FallibleTArray<SMILKeySpline> mKeySplines;
 
   // These are the parameters provided by the previous sample. Currently we
   // perform lazy calculation. That is, we only calculate the result if and when
   // instructed by the compositor. This allows us to apply the result directly
   // to the animation value and allows the compositor to filter out functions
   // that it determines will not contribute to the final result.
   nsSMILTime mSampleTime;  // sample time within simple dur
   nsSMILTimeValue mSimpleDuration;
rename from dom/smil/nsSMILCSSProperty.cpp
rename to dom/smil/SMILCSSProperty.cpp
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/SMILCSSProperty.cpp
@@ -1,42 +1,41 @@
 /* -*- 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/. */
 
 /* representation of a SMIL-animatable CSS property on an element */
 
-#include "nsSMILCSSProperty.h"
+#include "SMILCSSProperty.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/Move.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "nsDOMCSSAttrDeclaration.h"
 #include "SMILCSSValueType.h"
 #include "nsSMILValue.h"
 #include "nsCSSProps.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
 
 // Class Methods
-nsSMILCSSProperty::nsSMILCSSProperty(nsCSSPropertyID aPropID, Element* aElement,
-                                     ComputedStyle* aBaseComputedStyle)
+SMILCSSProperty::SMILCSSProperty(nsCSSPropertyID aPropID, Element* aElement,
+                                 ComputedStyle* aBaseComputedStyle)
     : mPropID(aPropID),
       mElement(aElement),
       mBaseComputedStyle(aBaseComputedStyle) {
   MOZ_ASSERT(IsPropertyAnimatable(mPropID),
-             "Creating a nsSMILCSSProperty for a property "
+             "Creating a SMILCSSProperty for a property "
              "that's not supported for animation");
 }
 
-nsSMILValue nsSMILCSSProperty::GetBaseValue() const {
+nsSMILValue SMILCSSProperty::GetBaseValue() const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
   nsSMILValue baseValue;
 
   // SPECIAL CASE: (a) Shorthands
   //               (b) 'display'
   //               (c) No base ComputedStyle
@@ -68,17 +67,17 @@ nsSMILValue nsSMILCSSProperty::GetBaseVa
     return baseValue;
   }
 
   baseValue = SMILCSSValueType::ValueFromAnimationValue(mPropID, mElement,
                                                         computedValue);
   return baseValue;
 }
 
-nsresult nsSMILCSSProperty::ValueFromString(
+nsresult SMILCSSProperty::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* aSrcElement,
     nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
 
   SMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
                                     &aPreventCachingOfSandwich);
 
   if (aValue.IsNull()) {
@@ -89,30 +88,30 @@ nsresult nsSMILCSSProperty::ValueFromStr
   // culprit), when we have animation setting display:none on a <use> element,
   // if we DON'T set the property every sample, chaos ensues.
   if (!aPreventCachingOfSandwich && mPropID == eCSSProperty_display) {
     aPreventCachingOfSandwich = true;
   }
   return NS_OK;
 }
 
-nsresult nsSMILCSSProperty::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SMILCSSProperty::SetAnimValue(const nsSMILValue& aValue) {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
   return mElement->SMILOverrideStyle()->SetSMILValue(mPropID, aValue);
 }
 
-void nsSMILCSSProperty::ClearAnimValue() {
+void SMILCSSProperty::ClearAnimValue() {
   // Put empty string in override style for our property
   mElement->SMILOverrideStyle()->SetPropertyValue(mPropID, EmptyString(),
                                                   nullptr);
 }
 
 // Based on http://www.w3.org/TR/SVG/propidx.html
 // static
-bool nsSMILCSSProperty::IsPropertyAnimatable(nsCSSPropertyID aPropID) {
+bool SMILCSSProperty::IsPropertyAnimatable(nsCSSPropertyID aPropID) {
   // Bug 1353918: Drop this check
   if (!Servo_Property_IsAnimatable(aPropID)) {
     return false;
   }
 
   // NOTE: Right now, Gecko doesn't recognize the following properties from
   // the SVG Property Index:
   //   alignment-baseline
@@ -193,8 +192,10 @@ bool nsSMILCSSProperty::IsPropertyAnimat
     case eCSSProperty_direction:
     case eCSSProperty_unicode_bidi:
       return false;
 
     default:
       return false;
   }
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILCSSProperty.h
rename to dom/smil/SMILCSSProperty.h
--- a/dom/smil/nsSMILCSSProperty.h
+++ b/dom/smil/SMILCSSProperty.h
@@ -15,42 +15,40 @@
 #include "nsCSSPropertyID.h"
 #include "nsCSSValue.h"
 
 namespace mozilla {
 class ComputedStyle;
 namespace dom {
 class Element;
 }  // namespace dom
-}  // namespace mozilla
 
 /**
- * nsSMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
+ * SMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
  * that target CSS properties.  Represents a particular animation-targeted CSS
  * property on a particular element.
  */
-class nsSMILCSSProperty : public nsISMILAttr {
+class SMILCSSProperty : public nsISMILAttr {
  public:
   /**
-   * Constructs a new nsSMILCSSProperty.
+   * Constructs a new SMILCSSProperty.
    * @param  aPropID   The CSS property we're interested in animating.
    * @param  aElement  The element whose CSS property is being animated.
    * @param  aBaseComputedStyle  The ComputedStyle to use when getting the base
    *                             value. If this is nullptr and GetBaseValue is
    *                             called, an empty nsSMILValue initialized with
    *                             the SMILCSSValueType will be returned.
    */
-  nsSMILCSSProperty(nsCSSPropertyID aPropID, mozilla::dom::Element* aElement,
-                    mozilla::ComputedStyle* aBaseComputedStyle);
+  SMILCSSProperty(nsCSSPropertyID aPropID, dom::Element* aElement,
+                  ComputedStyle* aBaseComputedStyle);
 
   // nsISMILAttr methods
   virtual nsresult ValueFromString(
-      const nsAString& aStr,
-      const mozilla::dom::SVGAnimationElement* aSrcElement, nsSMILValue& aValue,
-      bool& aPreventCachingOfSandwich) const override;
+      const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
+      nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
   virtual nsSMILValue GetBaseValue() const override;
   virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
   virtual void ClearAnimValue() override;
 
   /**
    * Utility method - returns true if the given property is supported for
    * SMIL animation.
    *
@@ -64,19 +62,21 @@ class nsSMILCSSProperty : public nsISMIL
   static bool IsPropertyAnimatable(nsCSSPropertyID aPropID);
 
  protected:
   nsCSSPropertyID mPropID;
   // Using non-refcounted pointer for mElement -- we know mElement will stay
   // alive for my lifetime because a nsISMILAttr (like me) only lives as long
   // as the Compositing step, and DOM elements don't get a chance to die during
   // that time.
-  mozilla::dom::Element* mElement;
+  dom::Element* mElement;
 
   // The style to use when fetching base styles.
   //
   // As with mElement, since an nsISMILAttr only lives as long as the
   // compositing step and since ComposeAttribute holds an owning reference to
   // the base ComputedStyle, we can use a non-owning reference here.
-  mozilla::ComputedStyle* mBaseComputedStyle;
+  ComputedStyle* mBaseComputedStyle;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILCSSPROPERTY_H_
--- a/dom/smil/SMILCSSValueType.cpp
+++ b/dom/smil/SMILCSSValueType.cpp
@@ -5,27 +5,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* representation of a value for a SMIL-animated CSS property */
 
 #include "SMILCSSValueType.h"
 
 #include "nsComputedDOMStyle.h"
 #include "nsString.h"
-#include "nsSMILParserUtils.h"
 #include "nsSMILValue.h"
 #include "nsCSSProps.h"
 #include "nsCSSValue.h"
 #include "nsColor.h"
 #include "nsPresContext.h"
 #include "mozilla/DeclarationBlock.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StyleAnimationValue.h"  // For AnimationValue
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/ServoStyleSet.h"
+#include "mozilla/SMILParserUtils.h"
 #include "mozilla/dom/BaseKeyframeTypesBinding.h"  // For CompositeOperation
 #include "mozilla/dom/Element.h"
 #include "nsDebug.h"
 #include "nsStyleUtil.h"
 #include "mozilla/dom/Document.h"
 
 using namespace mozilla::dom;
 
--- a/dom/smil/SMILCompositor.cpp
+++ b/dom/smil/SMILCompositor.cpp
@@ -4,17 +4,17 @@
  * 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 "SMILCompositor.h"
 
 #include "nsComputedDOMStyle.h"
 #include "nsCSSProps.h"
 #include "nsHashKeys.h"
-#include "nsSMILCSSProperty.h"
+#include "SMILCSSProperty.h"
 
 namespace mozilla {
 
 // PLDHashEntryHdr methods
 bool SMILCompositor::KeyEquals(KeyTypePointer aKey) const {
   return aKey && aKey->Equals(mKey);
 }
 
@@ -119,33 +119,33 @@ void SMILCompositor::ClearAnimationEffec
 
 // Protected Helper Functions
 // --------------------------
 UniquePtr<nsISMILAttr> SMILCompositor::CreateSMILAttr(
     ComputedStyle* aBaseComputedStyle) {
   nsCSSPropertyID propID = GetCSSPropertyToAnimate();
 
   if (propID != eCSSProperty_UNKNOWN) {
-    return MakeUnique<nsSMILCSSProperty>(propID, mKey.mElement.get(),
-                                         aBaseComputedStyle);
+    return MakeUnique<SMILCSSProperty>(propID, mKey.mElement.get(),
+                                       aBaseComputedStyle);
   }
 
   return mKey.mElement->GetAnimatedAttr(mKey.mAttributeNamespaceID,
                                         mKey.mAttributeName);
 }
 
 nsCSSPropertyID SMILCompositor::GetCSSPropertyToAnimate() const {
   if (mKey.mAttributeNamespaceID != kNameSpaceID_None) {
     return eCSSProperty_UNKNOWN;
   }
 
   nsCSSPropertyID propID =
       nsCSSProps::LookupProperty(nsDependentAtomString(mKey.mAttributeName));
 
-  if (!nsSMILCSSProperty::IsPropertyAnimatable(propID)) {
+  if (!SMILCSSProperty::IsPropertyAnimatable(propID)) {
     return eCSSProperty_UNKNOWN;
   }
 
   // If we are animating the 'width' or 'height' of an outer SVG
   // element we should animate it as a CSS property, but for other elements
   // (e.g. <rect>) we should animate it as a length attribute.
   // The easiest way to test for an outer SVG element, is to see if it is an
   // SVG-namespace element mapping its width/height attribute to style.
rename from dom/smil/nsSMILKeySpline.cpp
rename to dom/smil/SMILKeySpline.cpp
--- a/dom/smil/nsSMILKeySpline.cpp
+++ b/dom/smil/SMILKeySpline.cpp
@@ -1,65 +1,66 @@
 /* -*- 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 "nsSMILKeySpline.h"
+#include "SMILKeySpline.h"
 #include <stdint.h>
 #include <math.h>
 
+namespace mozilla {
+
 #define NEWTON_ITERATIONS 4
 #define NEWTON_MIN_SLOPE 0.02
 #define SUBDIVISION_PRECISION 0.0000001
 #define SUBDIVISION_MAX_ITERATIONS 10
 
-const double nsSMILKeySpline::kSampleStepSize =
+const double SMILKeySpline::kSampleStepSize =
     1.0 / double(kSplineTableSize - 1);
 
-void nsSMILKeySpline::Init(double aX1, double aY1, double aX2, double aY2) {
+void SMILKeySpline::Init(double aX1, double aY1, double aX2, double aY2) {
   mX1 = aX1;
   mY1 = aY1;
   mX2 = aX2;
   mY2 = aY2;
 
   if (mX1 != mY1 || mX2 != mY2) CalcSampleValues();
 }
 
-double nsSMILKeySpline::GetSplineValue(double aX) const {
+double SMILKeySpline::GetSplineValue(double aX) const {
   if (mX1 == mY1 && mX2 == mY2) return aX;
 
   return CalcBezier(GetTForX(aX), mY1, mY2);
 }
 
-void nsSMILKeySpline::GetSplineDerivativeValues(double aX, double& aDX,
-                                                double& aDY) const {
+void SMILKeySpline::GetSplineDerivativeValues(double aX, double& aDX,
+                                              double& aDY) const {
   double t = GetTForX(aX);
   aDX = GetSlope(t, mX1, mX2);
   aDY = GetSlope(t, mY1, mY2);
 }
 
-void nsSMILKeySpline::CalcSampleValues() {
+void SMILKeySpline::CalcSampleValues() {
   for (uint32_t i = 0; i < kSplineTableSize; ++i) {
     mSampleValues[i] = CalcBezier(double(i) * kSampleStepSize, mX1, mX2);
   }
 }
 
-/*static*/ double nsSMILKeySpline::CalcBezier(double aT, double aA1,
-                                              double aA2) {
+/*static*/ double SMILKeySpline::CalcBezier(double aT, double aA1, double aA2) {
   // use Horner's scheme to evaluate the Bezier polynomial
   return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
 }
 
-/*static*/ double nsSMILKeySpline::GetSlope(double aT, double aA1, double aA2) {
+/*static*/ double SMILKeySpline::GetSlope(double aT, double aA1, double aA2) {
   return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
 }
 
-double nsSMILKeySpline::GetTForX(double aX) const {
+double SMILKeySpline::GetTForX(double aX) const {
   // Early return when aX == 1.0 to avoid floating-point inaccuracies.
   if (aX == 1.0) {
     return 1.0;
   }
   // Find interval where t lies
   double intervalStart = 0.0;
   const double* currentSample = &mSampleValues[1];
   const double* const lastSample = &mSampleValues[kSplineTableSize - 1];
@@ -80,33 +81,33 @@ double nsSMILKeySpline::GetTForX(double 
     return NewtonRaphsonIterate(aX, guessForT);
   } else if (initialSlope == 0.0) {
     return guessForT;
   } else {
     return BinarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);
   }
 }
 
-double nsSMILKeySpline::NewtonRaphsonIterate(double aX, double aGuessT) const {
+double SMILKeySpline::NewtonRaphsonIterate(double aX, double aGuessT) const {
   // Refine guess with Newton-Raphson iteration
   for (uint32_t i = 0; i < NEWTON_ITERATIONS; ++i) {
     // We're trying to find where f(t) = aX,
     // so we're actually looking for a root for: CalcBezier(t) - aX
     double currentX = CalcBezier(aGuessT, mX1, mX2) - aX;
     double currentSlope = GetSlope(aGuessT, mX1, mX2);
 
     if (currentSlope == 0.0) return aGuessT;
 
     aGuessT -= currentX / currentSlope;
   }
 
   return aGuessT;
 }
 
-double nsSMILKeySpline::BinarySubdivide(double aX, double aA, double aB) const {
+double SMILKeySpline::BinarySubdivide(double aX, double aA, double aB) const {
   double currentX;
   double currentT;
   uint32_t i = 0;
 
   do {
     currentT = aA + (aB - aA) / 2.0;
     currentX = CalcBezier(currentT, mX1, mX2) - aX;
 
@@ -115,8 +116,10 @@ double nsSMILKeySpline::BinarySubdivide(
     } else {
       aA = currentT;
     }
   } while (fabs(currentX) > SUBDIVISION_PRECISION &&
            ++i < SUBDIVISION_MAX_ITERATIONS);
 
   return currentT;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILKeySpline.h
rename to dom/smil/SMILKeySpline.h
--- a/dom/smil/nsSMILKeySpline.h
+++ b/dom/smil/SMILKeySpline.h
@@ -5,35 +5,37 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILKEYSPLINE_H_
 #define NS_SMILKEYSPLINE_H_
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/PodOperations.h"
 
+namespace mozilla {
+
 /**
  * Utility class to provide scaling defined in a keySplines element.
  */
-class nsSMILKeySpline {
+class SMILKeySpline {
  public:
-  nsSMILKeySpline() : mX1(0), mY1(0), mX2(0), mY2(0) {
+  SMILKeySpline() : mX1(0), mY1(0), mX2(0), mY2(0) {
     /* caller must call Init later */\
   }
 
     /**
      * Creates a new key spline control point description.
      *
      * aX1, etc. are the x1, y1, x2, y2 cubic Bezier control points as defined
      * by SMILANIM 3.2.3. They must each be in the range 0.0 <= x <= 1.0
      */
-    nsSMILKeySpline(double aX1, double aY1, double aX2, double aY2)
-        : mX1(0), mY1(0), mX2(0), mY2(0) {
-      Init(aX1, aY1, aX2, aY2);
-    }
+  SMILKeySpline(double aX1, double aY1, double aX2, double aY2)
+      : mX1(0), mY1(0), mX2(0), mY2(0) {
+    Init(aX1, aY1, aX2, aY2);
+  }
 
     double X1() const { return mX1; }
     double Y1() const { return mY1; }
     double X2() const { return mX2; }
     double Y2() const { return mY2; }
 
     void Init(double aX1, double aY1, double aX2, double aY2);
 
@@ -42,24 +44,24 @@ class nsSMILKeySpline {
      *
      * @param aX  The input x value. A floating-point number between 0 and
      *            1 (inclusive).
      */
     double GetSplineValue(double aX) const;
 
     void GetSplineDerivativeValues(double aX, double& aDX, double& aDY) const;
 
-    bool operator==(const nsSMILKeySpline& aOther) const {
+    bool operator==(const SMILKeySpline& aOther) const {
       return mX1 == aOther.mX1 && mY1 == aOther.mY1 && mX2 == aOther.mX2 &&
              mY2 == aOther.mY2;
     }
-    bool operator!=(const nsSMILKeySpline& aOther) const {
+    bool operator!=(const SMILKeySpline& aOther) const {
       return !(*this == aOther);
     }
-    int32_t Compare(const nsSMILKeySpline& aRhs) const {
+    int32_t Compare(const SMILKeySpline& aRhs) const {
       if (mX1 != aRhs.mX1) return mX1 < aRhs.mX1 ? -1 : 1;
       if (mY1 != aRhs.mY1) return mY1 < aRhs.mY1 ? -1 : 1;
       if (mX2 != aRhs.mX2) return mX2 < aRhs.mX2 ? -1 : 1;
       if (mY2 != aRhs.mY2) return mY2 < aRhs.mY2 ? -1 : 1;
       return 0;
     }
 
    private:
@@ -95,9 +97,11 @@ class nsSMILKeySpline {
     double mY2;
 
     enum { kSplineTableSize = 11 };
     double mSampleValues[kSplineTableSize];
 
     static const double kSampleStepSize;
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILKEYSPLINE_H_
rename from dom/smil/nsSMILParserUtils.cpp
rename to dom/smil/SMILParserUtils.cpp
--- a/dom/smil/nsSMILParserUtils.cpp
+++ b/dom/smil/SMILParserUtils.cpp
@@ -1,34 +1,35 @@
 /* -*- 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 "nsSMILParserUtils.h"
+#include "SMILParserUtils.h"
 #include "mozilla/SVGContentUtils.h"
 #include "mozilla/TextUtils.h"
-#include "nsSMILKeySpline.h"
+#include "SMILKeySpline.h"
 #include "nsISMILAttr.h"
 #include "nsSMILValue.h"
 #include "nsSMILTimeValue.h"
 #include "nsSMILTimeValueSpecParams.h"
 #include "nsSMILTypes.h"
 #include "nsSMILRepeatCount.h"
 #include "nsContentUtils.h"
 #include "nsCharSeparatedTokenizer.h"
 
-using namespace mozilla;
 using namespace mozilla::dom;
 //------------------------------------------------------------------------------
 // Helper functions and Constants
 
 namespace {
 
+using namespace mozilla;
+
 const uint32_t MSEC_PER_SEC = 1000;
 const uint32_t MSEC_PER_MIN = 1000 * 60;
 const uint32_t MSEC_PER_HOUR = 1000 * 60 * 60;
 
 #define ACCESSKEY_PREFIX_LC NS_LITERAL_STRING("accesskey(")  // SMIL2+
 #define ACCESSKEY_PREFIX_CC NS_LITERAL_STRING("accessKey(")  // SVG/SMIL ANIM
 #define REPEAT_PREFIX NS_LITERAL_STRING("repeat(")
 #define WALLCLOCK_PREFIX NS_LITERAL_STRING("wallclock(")
@@ -391,20 +392,22 @@ bool ParseElementBaseTimeValueSpec(const
     return false;
   }
   aResult = result;
   return true;
 }
 
 }  // namespace
 
+namespace mozilla {
+
 //------------------------------------------------------------------------------
 // Implementation
 
-const nsDependentSubstring nsSMILParserUtils::TrimWhitespace(
+const nsDependentSubstring SMILParserUtils::TrimWhitespace(
     const nsAString& aString) {
   nsAString::const_iterator start, end;
 
   aString.BeginReading(start);
   aString.EndReading(end);
 
   // Skip whitespace characters at the beginning
   while (start != end && nsContentUtils::IsHTMLWhitespace(*start)) {
@@ -421,18 +424,18 @@ const nsDependentSubstring nsSMILParserU
 
       break;
     }
   }
 
   return Substring(start, end);
 }
 
-bool nsSMILParserUtils::ParseKeySplines(
-    const nsAString& aSpec, FallibleTArray<nsSMILKeySpline>& aKeySplines) {
+bool SMILParserUtils::ParseKeySplines(
+    const nsAString& aSpec, FallibleTArray<SMILKeySpline>& aKeySplines) {
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
       controlPointTokenizer(aSpec, ';');
   while (controlPointTokenizer.hasMoreTokens()) {
     nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
         tokenizer(controlPointTokenizer.nextToken(), ',',
                   nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
 
     double values[4];
@@ -440,26 +443,26 @@ bool nsSMILParserUtils::ParseKeySplines(
       if (!tokenizer.hasMoreTokens() ||
           !SVGContentUtils::ParseNumber(tokenizer.nextToken(), values[i]) ||
           values[i] > 1.0 || values[i] < 0.0) {
         return false;
       }
     }
     if (tokenizer.hasMoreTokens() || tokenizer.separatorAfterCurrentToken() ||
         !aKeySplines.AppendElement(
-            nsSMILKeySpline(values[0], values[1], values[2], values[3]),
+            SMILKeySpline(values[0], values[1], values[2], values[3]),
             fallible)) {
       return false;
     }
   }
 
   return !aKeySplines.IsEmpty();
 }
 
-bool nsSMILParserUtils::ParseSemicolonDelimitedProgressList(
+bool SMILParserUtils::ParseSemicolonDelimitedProgressList(
     const nsAString& aSpec, bool aNonDecreasing,
     FallibleTArray<double>& aArray) {
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tokenizer(
       aSpec, ';');
 
   double previousValue = -1.0;
 
   while (tokenizer.hasMoreTokens()) {
@@ -479,17 +482,17 @@ bool nsSMILParserUtils::ParseSemicolonDe
     previousValue = value;
   }
 
   return !aArray.IsEmpty();
 }
 
 // Helper class for ParseValues
 class MOZ_STACK_CLASS SMILValueParser
-    : public nsSMILParserUtils::GenericValueParser {
+    : public SMILParserUtils::GenericValueParser {
  public:
   SMILValueParser(const SVGAnimationElement* aSrcElement,
                   const nsISMILAttr* aSMILAttr,
                   FallibleTArray<nsSMILValue>* aValuesArray,
                   bool* aPreventCachingOfSandwich)
       : mSrcElement(aSrcElement),
         mSMILAttr(aSMILAttr),
         mValuesArray(aValuesArray),
@@ -513,63 +516,63 @@ class MOZ_STACK_CLASS SMILValueParser
 
  protected:
   const SVGAnimationElement* mSrcElement;
   const nsISMILAttr* mSMILAttr;
   FallibleTArray<nsSMILValue>* mValuesArray;
   bool* mPreventCachingOfSandwich;
 };
 
-bool nsSMILParserUtils::ParseValues(const nsAString& aSpec,
-                                    const SVGAnimationElement* aSrcElement,
-                                    const nsISMILAttr& aAttribute,
-                                    FallibleTArray<nsSMILValue>& aValuesArray,
-                                    bool& aPreventCachingOfSandwich) {
+bool SMILParserUtils::ParseValues(const nsAString& aSpec,
+                                  const SVGAnimationElement* aSrcElement,
+                                  const nsISMILAttr& aAttribute,
+                                  FallibleTArray<nsSMILValue>& aValuesArray,
+                                  bool& aPreventCachingOfSandwich) {
   // Assume all results can be cached, until we find one that can't.
   aPreventCachingOfSandwich = false;
   SMILValueParser valueParser(aSrcElement, &aAttribute, &aValuesArray,
                               &aPreventCachingOfSandwich);
   return ParseValuesGeneric(aSpec, valueParser);
 }
 
-bool nsSMILParserUtils::ParseValuesGeneric(const nsAString& aSpec,
-                                           GenericValueParser& aParser) {
+bool SMILParserUtils::ParseValuesGeneric(const nsAString& aSpec,
+                                         GenericValueParser& aParser) {
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tokenizer(
       aSpec, ';');
   if (!tokenizer.hasMoreTokens()) {  // Empty list
     return false;
   }
 
   while (tokenizer.hasMoreTokens()) {
     if (!aParser.Parse(tokenizer.nextToken())) {
       return false;
     }
   }
 
   return true;
 }
 
-bool nsSMILParserUtils::ParseRepeatCount(const nsAString& aSpec,
-                                         nsSMILRepeatCount& aResult) {
-  const nsAString& spec = nsSMILParserUtils::TrimWhitespace(aSpec);
+bool SMILParserUtils::ParseRepeatCount(const nsAString& aSpec,
+                                       nsSMILRepeatCount& aResult) {
+  const nsAString& spec = SMILParserUtils::TrimWhitespace(aSpec);
 
   if (spec.EqualsLiteral("indefinite")) {
     aResult.SetIndefinite();
     return true;
   }
 
   double value;
   if (!SVGContentUtils::ParseNumber(spec, value) || value <= 0.0) {
     return false;
   }
   aResult = value;
   return true;
 }
 
-bool nsSMILParserUtils::ParseTimeValueSpecParams(
+bool SMILParserUtils::ParseTimeValueSpecParams(
     const nsAString& aSpec, nsSMILTimeValueSpecParams& aResult) {
   const nsAString& spec = TrimWhitespace(aSpec);
 
   if (spec.EqualsLiteral("indefinite")) {
     aResult.mType = nsSMILTimeValueSpecParams::INDEFINITE;
     return true;
   }
 
@@ -589,25 +592,25 @@ bool nsSMILParserUtils::ParseTimeValueSp
       StringBeginsWith(spec, ACCESSKEY_PREFIX_CC)) {
     return false;  // accesskey is not supported
   }
 
   // event, syncbase, or repeat
   return ParseElementBaseTimeValueSpec(spec, aResult);
 }
 
-bool nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
-                                        nsSMILTimeValue* aResult) {
+bool SMILParserUtils::ParseClockValue(const nsAString& aSpec,
+                                      nsSMILTimeValue* aResult) {
   RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
   RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   return ::ParseClockValue(iter, end, aResult) && iter == end;
 }
 
-int32_t nsSMILParserUtils::CheckForNegativeNumber(const nsAString& aStr) {
+int32_t SMILParserUtils::CheckForNegativeNumber(const nsAString& aStr) {
   int32_t absValLocation = -1;
 
   RangedPtr<const char16_t> start(SVGContentUtils::GetStartRangedPtr(aStr));
   RangedPtr<const char16_t> iter = start;
   RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aStr));
 
   // Skip initial whitespace
   while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
@@ -619,8 +622,10 @@ int32_t nsSMILParserUtils::CheckForNegat
     ++iter;
     // Check for numeric character
     if (iter != end && mozilla::IsAsciiDigit(*iter)) {
       absValLocation = iter - start;
     }
   }
   return absValLocation;
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILParserUtils.h
rename to dom/smil/SMILParserUtils.h
--- a/dom/smil/nsSMILParserUtils.h
+++ b/dom/smil/SMILParserUtils.h
@@ -6,45 +6,44 @@
 
 #ifndef NS_SMILPARSERUTILS_H_
 #define NS_SMILPARSERUTILS_H_
 
 #include "nsTArray.h"
 #include "nsStringFwd.h"
 
 class nsISMILAttr;
-class nsSMILKeySpline;
+class SMILKeySpline;
 class nsSMILTimeValue;
 class nsSMILValue;
 class nsSMILRepeatCount;
 class nsSMILTimeValueSpecParams;
 
 namespace mozilla {
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
-}  // namespace mozilla
 
 /**
  * Common parsing utilities for the SMIL module. There is little re-use here; it
  * simply serves to simplify other classes by moving parsing outside and to aid
  * unit testing.
  */
-class nsSMILParserUtils {
+class SMILParserUtils {
  public:
   // Abstract helper-class for assisting in parsing |values| attribute
   class MOZ_STACK_CLASS GenericValueParser {
    public:
     virtual bool Parse(const nsAString& aValueStr) = 0;
   };
 
   static const nsDependentSubstring TrimWhitespace(const nsAString& aString);
 
   static bool ParseKeySplines(const nsAString& aSpec,
-                              FallibleTArray<nsSMILKeySpline>& aKeySplines);
+                              FallibleTArray<SMILKeySpline>& aKeySplines);
 
   // Used for parsing the |keyTimes| and |keyPoints| attributes.
   static bool ParseSemicolonDelimitedProgressList(
       const nsAString& aSpec, bool aNonDecreasing,
       FallibleTArray<double>& aArray);
 
   static bool ParseValues(const nsAString& aSpec,
                           const mozilla::dom::SVGAnimationElement* aSrcElement,
@@ -79,9 +78,11 @@ class nsSMILParserUtils {
    * Specifically, it checks whether the string looks matches the pattern
    * "[whitespace]*-[numeral].*" If the string matches this pattern, this
    * method returns the index of the first character after the '-' sign
    * (i.e. the index of the absolute value).  If not, this method returns -1.
    */
   static int32_t CheckForNegativeNumber(const nsAString& aStr);
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILPARSERUTILS_H_
--- a/dom/smil/SMILTimedElement.cpp
+++ b/dom/smil/SMILTimedElement.cpp
@@ -6,24 +6,24 @@
 
 #include "SMILTimedElement.h"
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/SMILAnimationFunction.h"
+#include "mozilla/SMILParserUtils.h"
 #include "mozilla/SMILTimeContainer.h"
 #include "mozilla/TaskCategory.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsSMILTimeValue.h"
 #include "nsSMILTimeValueSpec.h"
 #include "nsSMILInstanceTime.h"
-#include "nsSMILParserUtils.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"
@@ -844,24 +844,24 @@ void SMILTimedElement::UnsetEndSpec(Remo
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetSimpleDuration(const nsAString& aDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
-  const nsAString& dur = nsSMILParserUtils::TrimWhitespace(aDurSpec);
+  const nsAString& dur = SMILParserUtils::TrimWhitespace(aDurSpec);
 
   // SVG-specific: "For SVG's animation elements, if "media" is specified, the
   // attribute will be ignored." (SVG 1.1, section 19.2.6)
   if (dur.EqualsLiteral("media") || dur.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
-    if (!nsSMILParserUtils::ParseClockValue(dur, &duration) ||
+    if (!SMILParserUtils::ParseClockValue(dur, &duration) ||
         duration.GetMillis() == 0L) {
       mSimpleDur.SetIndefinite();
       return NS_ERROR_FAILURE;
     }
   }
   // mSimpleDur should never be unresolved. ParseClockValue will either set
   // duration to resolved or will return false.
   MOZ_ASSERT(duration.IsResolved(), "Setting unresolved simple duration");
@@ -876,22 +876,22 @@ void SMILTimedElement::UnsetSimpleDurati
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetMin(const nsAString& aMinSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
-  const nsAString& min = nsSMILParserUtils::TrimWhitespace(aMinSpec);
+  const nsAString& min = SMILParserUtils::TrimWhitespace(aMinSpec);
 
   if (min.EqualsLiteral("media")) {
     duration.SetMillis(0L);
   } else {
-    if (!nsSMILParserUtils::ParseClockValue(min, &duration)) {
+    if (!SMILParserUtils::ParseClockValue(min, &duration)) {
       mMin.SetMillis(0L);
       return NS_ERROR_FAILURE;
     }
   }
 
   MOZ_ASSERT(duration.GetMillis() >= 0L, "Invalid duration");
 
   mMin = duration;
@@ -904,22 +904,22 @@ void SMILTimedElement::UnsetMin() {
   UpdateCurrentInterval();
 }
 
 nsresult SMILTimedElement::SetMax(const nsAString& aMaxSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
-  const nsAString& max = nsSMILParserUtils::TrimWhitespace(aMaxSpec);
+  const nsAString& max = SMILParserUtils::TrimWhitespace(aMaxSpec);
 
   if (max.EqualsLiteral("media") || max.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
-    if (!nsSMILParserUtils::ParseClockValue(max, &duration) ||
+    if (!SMILParserUtils::ParseClockValue(max, &duration) ||
         duration.GetMillis() == 0L) {
       mMax.SetIndefinite();
       return NS_ERROR_FAILURE;
     }
     MOZ_ASSERT(duration.GetMillis() > 0L, "Invalid duration");
   }
 
   mMax = duration;
@@ -947,17 +947,17 @@ void SMILTimedElement::UnsetRestart() {
 }
 
 nsresult SMILTimedElement::SetRepeatCount(const nsAString& aRepeatCountSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILRepeatCount newRepeatCount;
 
-  if (nsSMILParserUtils::ParseRepeatCount(aRepeatCountSpec, newRepeatCount)) {
+  if (SMILParserUtils::ParseRepeatCount(aRepeatCountSpec, newRepeatCount)) {
     mRepeatCount = newRepeatCount;
     return NS_OK;
   }
   mRepeatCount.Unset();
   return NS_ERROR_FAILURE;
 }
 
 void SMILTimedElement::UnsetRepeatCount() {
@@ -966,23 +966,22 @@ void SMILTimedElement::UnsetRepeatCount(
 }
 
 nsresult SMILTimedElement::SetRepeatDur(const nsAString& aRepeatDurSpec) {
   // Update the current interval before returning
   AutoIntervalUpdater updater(*this);
 
   nsSMILTimeValue duration;
 
-  const nsAString& repeatDur =
-      nsSMILParserUtils::TrimWhitespace(aRepeatDurSpec);
+  const nsAString& repeatDur = SMILParserUtils::TrimWhitespace(aRepeatDurSpec);
 
   if (repeatDur.EqualsLiteral("indefinite")) {
     duration.SetIndefinite();
   } else {
-    if (!nsSMILParserUtils::ParseClockValue(repeatDur, &duration)) {
+    if (!SMILParserUtils::ParseClockValue(repeatDur, &duration)) {
       mRepeatDur.SetUnresolved();
       return NS_ERROR_FAILURE;
     }
   }
 
   mRepeatDur = duration;
 
   return NS_OK;
--- a/dom/smil/moz.build
+++ b/dom/smil/moz.build
@@ -6,65 +6,65 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "SVG")
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 
 EXPORTS += [
     'nsISMILAttr.h',
-    'nsSMILCSSProperty.h',
     'nsSMILInstanceTime.h',
     'nsSMILInterval.h',
-    'nsSMILKeySpline.h',
     'nsSMILRepeatCount.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',
+    'SMILKeySpline.h',
     'SMILMilestone.h',
+    'SMILParserUtils.h',
     'SMILSetAnimationFunction.h',
     'SMILTargetIdentifier.h',
     'SMILTimeContainer.h',
     'SMILTimedElement.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'TimeEvent.h',
 ]
 
 UNIFIED_SOURCES += [
-    'nsSMILCSSProperty.cpp',
     'nsSMILInstanceTime.cpp',
     'nsSMILInterval.cpp',
-    'nsSMILKeySpline.cpp',
-    'nsSMILParserUtils.cpp',
     'nsSMILRepeatCount.cpp',
     'nsSMILTimeValue.cpp',
     'nsSMILTimeValueSpec.cpp',
     'nsSMILValue.cpp',
     'SMILAnimationController.cpp',
     'SMILAnimationFunction.cpp',
     'SMILBoolType.cpp',
     'SMILCompositor.cpp',
+    'SMILCSSProperty.cpp',
     'SMILCSSValueType.cpp',
     'SMILEnumType.cpp',
     'SMILFloatType.cpp',
     'SMILIntegerType.cpp',
+    'SMILKeySpline.cpp',
     'SMILNullType.cpp',
+    'SMILParserUtils.cpp',
     'SMILSetAnimationFunction.cpp',
     'SMILStringType.cpp',
     'SMILTimeContainer.cpp',
     'SMILTimedElement.cpp',
     'TimeEvent.cpp',
 ]
 
 LOCAL_INCLUDES += [
--- a/dom/smil/nsSMILTimeValueSpec.cpp
+++ b/dom/smil/nsSMILTimeValueSpec.cpp
@@ -1,25 +1,25 @@
 /* -*- 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/SMILParserUtils.h"
 #include "mozilla/SMILTimeContainer.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 "nsSMILTimeValue.h"
 #include "nsSMILInstanceTime.h"
-#include "nsSMILParserUtils.h"
 #include "nsString.h"
 #include <limits>
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // Nested class: EventListener
@@ -48,17 +48,17 @@ nsSMILTimeValueSpec::~nsSMILTimeValueSpe
     mEventListener = nullptr;
   }
 }
 
 nsresult nsSMILTimeValueSpec::SetSpec(const nsAString& aStringSpec,
                                       Element& aContextElement) {
   nsSMILTimeValueSpecParams params;
 
-  if (!nsSMILParserUtils::ParseTimeValueSpecParams(aStringSpec, params))
+  if (!SMILParserUtils::ParseTimeValueSpecParams(aStringSpec, params))
     return NS_ERROR_FAILURE;
 
   mParams = params;
 
   // According to SMIL 3.0:
   //   The special value "indefinite" does not yield an instance time in the
   //   begin list. It will, however yield a single instance with the value
   //   "indefinite" in an end list. This value is not removed by a reset.
--- a/dom/smil/test/test_smilKeySplines.xhtml
+++ b/dom/smil/test/test_smilKeySplines.xhtml
@@ -132,17 +132,17 @@ function testSimpleD(anim) {
   anim.setAttribute('keySplines', '1 0 .25 .25');
   checkSample(0, 10);
   checkSampleRough(1, 10.076925);
   checkSampleRough(2, 10.644369);
   checkSampleRough(3, 16.908699);
   checkSample(4, 20);
 }
 
-// Bug 501569 -- nsSMILKeySpline(1, 0, 0, 1) miscalculates values just under 0.5
+// Bug 501569 -- SMILKeySpline(1, 0, 0, 1) miscalculates values just under 0.5
 function testSimpleE(anim) {
   anim.setAttribute('dur','10s');
   anim.setAttribute('values', '0; 10');
   anim.setAttribute('keyTimes', '0; 1');
   anim.setAttribute('calcMode', 'spline');
   anim.setAttribute('keySplines', '1 0 0 1');
   checkSample(0, 0);
   checkSampleRough(0.001, 0);
--- a/dom/svg/SVGMotionSMILAnimationFunction.cpp
+++ b/dom/svg/SVGMotionSMILAnimationFunction.cpp
@@ -1,22 +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 "SVGMotionSMILAnimationFunction.h"
+
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/dom/SVGPathElement.h"  // for nsSVGPathList
 #include "mozilla/dom/SVGMPathElement.h"
 #include "mozilla/gfx/2D.h"
+#include "mozilla/SMILParserUtils.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
-#include "nsSMILParserUtils.h"
 #include "SVGAngle.h"
 #include "SVGPathDataParser.h"
 #include "SVGMotionSMILType.h"
 #include "SVGMotionSMILPathUtils.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGAngle_Binding;
 using namespace mozilla::gfx;
@@ -149,17 +150,17 @@ void SVGMotionSMILAnimationFunction::Reb
 
   bool success = false;
   if (HasAttr(nsGkAtoms::values)) {
     // Generate path based on our values array
     mPathSourceType = ePathSourceType_ValuesAttr;
     const nsAString& valuesStr = GetAttr(nsGkAtoms::values)->GetStringValue();
     SVGMotionSMILPathUtils::MotionValueParser parser(&pathGenerator,
                                                      &mPathVertices);
-    success = nsSMILParserUtils::ParseValuesGeneric(valuesStr, parser);
+    success = SMILParserUtils::ParseValuesGeneric(valuesStr, parser);
   } else if (HasAttr(nsGkAtoms::to) || HasAttr(nsGkAtoms::by)) {
     // Apply 'from' value (or a dummy 0,0 'from' value)
     if (HasAttr(nsGkAtoms::from)) {
       const nsAString& fromStr = GetAttr(nsGkAtoms::from)->GetStringValue();
       success = pathGenerator.MoveToAbsolute(fromStr);
       mPathVertices.AppendElement(0.0, fallible);
     } else {
       // Create dummy 'from' value at 0,0, if we're doing by-animation.
@@ -357,18 +358,18 @@ void SVGMotionSMILAnimationFunction::Che
 
 nsresult SVGMotionSMILAnimationFunction::SetKeyPoints(
     const nsAString& aKeyPoints, nsAttrValue& aResult) {
   mKeyPoints.Clear();
   aResult.SetTo(aKeyPoints);
 
   mHasChanged = true;
 
-  if (!nsSMILParserUtils::ParseSemicolonDelimitedProgressList(aKeyPoints, false,
-                                                              mKeyPoints)) {
+  if (!SMILParserUtils::ParseSemicolonDelimitedProgressList(aKeyPoints, false,
+                                                            mKeyPoints)) {
     mKeyPoints.Clear();
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 void SVGMotionSMILAnimationFunction::UnsetKeyPoints() {
--- a/dom/svg/SVGMotionSMILPathUtils.h
+++ b/dom/svg/SVGMotionSMILPathUtils.h
@@ -6,21 +6,21 @@
 
 /* Helper class to help with generating anonymous path elements for
    <animateMotion> elements to use. */
 
 #ifndef MOZILLA_SVGMOTIONSMILPATHUTILS_H_
 #define MOZILLA_SVGMOTIONSMILPATHUTILS_H_
 
 #include "mozilla/Attributes.h"
-#include "gfxPlatform.h"
+#include "mozilla/RefPtr.h"
+#include "mozilla/SMILParserUtils.h"
 #include "mozilla/gfx/2D.h"
-#include "mozilla/RefPtr.h"
+#include "gfxPlatform.h"
 #include "nsDebug.h"
-#include "nsSMILParserUtils.h"
 #include "nsStringFwd.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 
 namespace dom {
 class SVGElement;
 }
@@ -72,28 +72,28 @@ class SVGMotionSMILPathUtils {
     const dom::SVGElement* mSVGElement;  // context for converting to user units
     RefPtr<PathBuilder> mPathBuilder;
     bool mHaveReceivedCommands;
   };
 
   // Class to assist in passing each subcomponent of a |values| attribute to
   // a PathGenerator, for generating a corresponding Path.
   class MOZ_STACK_CLASS MotionValueParser
-      : public nsSMILParserUtils::GenericValueParser {
+      : public SMILParserUtils::GenericValueParser {
    public:
     MotionValueParser(PathGenerator* aPathGenerator,
                       FallibleTArray<double>* aPointDistances)
         : mPathGenerator(aPathGenerator),
           mPointDistances(aPointDistances),
           mDistanceSoFar(0.0) {
       MOZ_ASSERT(mPointDistances->IsEmpty(),
                  "expecting point distances array to start empty");
     }
 
-    // nsSMILParserUtils::GenericValueParser interface
+    // SMILParserUtils::GenericValueParser interface
     virtual bool Parse(const nsAString& aValueStr) override;
 
    protected:
     PathGenerator* mPathGenerator;
     FallibleTArray<double>* mPointDistances;
     double mDistanceSoFar;
   };
 };
--- a/layout/generic/ScrollAnimationBezierPhysics.cpp
+++ b/layout/generic/ScrollAnimationBezierPhysics.cpp
@@ -85,17 +85,17 @@ void ScrollAnimationBezierPhysics::Initi
   TimeDuration maxDelta = TimeDuration::FromMilliseconds(
       mSettings.mMaxMS / mSettings.mIntervalRatio);
   mPrevEventTime[0] = aTime - maxDelta;
   mPrevEventTime[1] = mPrevEventTime[0] - maxDelta;
   mPrevEventTime[2] = mPrevEventTime[1] - maxDelta;
 }
 
 void ScrollAnimationBezierPhysics::InitTimingFunction(
-    nsSMILKeySpline& aTimingFunction, nscoord aCurrentPos,
+    SMILKeySpline& aTimingFunction, nscoord aCurrentPos,
     nscoord aCurrentVelocity, nscoord aDestination) {
   if (aDestination == aCurrentPos ||
       gfxPrefs::SmoothScrollCurrentVelocityWeighting() == 0) {
     aTimingFunction.Init(
         0, 0, 1 - gfxPrefs::SmoothScrollStopDecelerationWeighting(), 1);
     return;
   }
 
@@ -132,18 +132,18 @@ nsSize ScrollAnimationBezierPhysics::Vel
   double timeProgress = ProgressAt(aTime);
   return nsSize(VelocityComponent(timeProgress, mTimingFunctionX, mStartPos.x,
                                   mDestination.x),
                 VelocityComponent(timeProgress, mTimingFunctionY, mStartPos.y,
                                   mDestination.y));
 }
 
 nscoord ScrollAnimationBezierPhysics::VelocityComponent(
-    double aTimeProgress, const nsSMILKeySpline& aTimingFunction,
-    nscoord aStart, nscoord aDestination) const {
+    double aTimeProgress, const SMILKeySpline& aTimingFunction, nscoord aStart,
+    nscoord aDestination) const {
   double dt, dxy;
   aTimingFunction.GetSplineDerivativeValues(aTimeProgress, dt, dxy);
   if (dt == 0) return dxy >= 0 ? nscoord_MAX : nscoord_MIN;
 
   const TimeDuration oneSecond = TimeDuration::FromSeconds(1);
   double slope = dxy / dt;
   return NSToCoordRound(slope * (aDestination - aStart) /
                         (mDuration / oneSecond));
--- a/layout/generic/ScrollAnimationBezierPhysics.h
+++ b/layout/generic/ScrollAnimationBezierPhysics.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 mozilla_layout_ScrollAnimationBezierPhysics_h_
 #define mozilla_layout_ScrollAnimationBezierPhysics_h_
 
 #include "ScrollAnimationPhysics.h"
-#include "nsSMILKeySpline.h"
+#include "mozilla/SMILKeySpline.h"
 
 namespace mozilla {
 
 struct ScrollAnimationBezierPhysicsSettings {
   // These values are minimum and maximum animation duration per event,
   // and a global ratio which defines how longer is the animation's duration
   // compared to the average recent events intervals (such that for a relatively
   // consistent events rate, the next event arrives before current animation
@@ -48,27 +48,27 @@ class ScrollAnimationBezierPhysics final
   }
 
  protected:
   double ProgressAt(const TimeStamp& aTime) const {
     return clamped((aTime - mStartTime) / mDuration, 0.0, 1.0);
   }
 
   nscoord VelocityComponent(double aTimeProgress,
-                            const nsSMILKeySpline& aTimingFunction,
+                            const SMILKeySpline& aTimingFunction,
                             nscoord aStart, nscoord aDestination) const;
 
   // Calculate duration, possibly dynamically according to events rate and
   // event origin. (also maintain previous timestamps - which are only used
   // here).
   TimeDuration ComputeDuration(const TimeStamp& aTime);
 
   // Initializes the timing function in such a way that the current velocity is
   // preserved.
-  void InitTimingFunction(nsSMILKeySpline& aTimingFunction, nscoord aCurrentPos,
+  void InitTimingFunction(SMILKeySpline& aTimingFunction, nscoord aCurrentPos,
                           nscoord aCurrentVelocity, nscoord aDestination);
 
   // Initialize event history.
   void InitializeHistory(const TimeStamp& aTime);
 
   // Cached Preferences values.
   ScrollAnimationBezierPhysicsSettings mSettings;
 
@@ -79,16 +79,16 @@ class ScrollAnimationBezierPhysics final
   // relevant intervals between them.
   TimeStamp mPrevEventTime[3];
 
   TimeStamp mStartTime;
 
   nsPoint mStartPos;
   nsPoint mDestination;
   TimeDuration mDuration;
-  nsSMILKeySpline mTimingFunctionX;
-  nsSMILKeySpline mTimingFunctionY;
+  SMILKeySpline mTimingFunctionX;
+  SMILKeySpline mTimingFunctionY;
   bool mIsFirstIteration;
 };
 
 }  // namespace mozilla
 
 #endif  // mozilla_layout_ScrollAnimationBezierPhysics_h_
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -41,17 +41,16 @@
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/HTMLTextAreaElement.h"
 #include <stdint.h>
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Telemetry.h"
 #include "FrameLayerBuilder.h"
-#include "nsSMILKeySpline.h"
 #include "nsSubDocumentFrame.h"
 #include "nsSVGOuterSVGFrame.h"
 #include "nsIObjectLoadingContent.h"
 #include "mozilla/Attributes.h"
 #include "ScrollbarActivity.h"
 #include "nsRefreshDriver.h"
 #include "nsStyleConsts.h"
 #include "nsSVGIntegrationUtils.h"
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -389,17 +389,17 @@ static void AddTransformFunctions(const 
 
 static TimingFunction ToTimingFunction(
     const Maybe<ComputedTimingFunction>& aCTF) {
   if (aCTF.isNothing()) {
     return TimingFunction(null_t());
   }
 
   if (aCTF->HasSpline()) {
-    const nsSMILKeySpline* spline = aCTF->GetFunction();
+    const SMILKeySpline* spline = aCTF->GetFunction();
     return TimingFunction(CubicBezierFunction(spline->X1(), spline->Y1(),
                                               spline->X2(), spline->Y2()));
   }
 
   return TimingFunction(StepFunction(
       aCTF->GetSteps().mSteps, static_cast<uint8_t>(aCTF->GetSteps().mPos)));
 }