Bug 886270 - Move SVGAnimatedInteger to WebIDL; r=dzbarsky
authorMs2ger <ms2ger@gmail.com>
Mon, 01 Jul 2013 09:02:56 +0200
changeset 150149 e8151bf1db51412f681287415569dbed0f8fe312
parent 150148 6c813cf67ed803584cc5d70e927b9e95563482be
child 150150 a115585785748f7a748f8e21e2847d78a24677c0
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdzbarsky
bugs886270
milestone25.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 886270 - Move SVGAnimatedInteger to WebIDL; r=dzbarsky
content/svg/content/src/SVGAnimatedInteger.cpp
content/svg/content/src/SVGAnimatedInteger.h
content/svg/content/src/SVGFEConvolveMatrixElement.cpp
content/svg/content/src/SVGFEConvolveMatrixElement.h
content/svg/content/src/SVGFETurbulenceElement.cpp
content/svg/content/src/SVGFETurbulenceElement.h
content/svg/content/src/SVGFilterElement.cpp
content/svg/content/src/SVGFilterElement.h
content/svg/content/src/moz.build
content/svg/content/src/nsSVGInteger.cpp
content/svg/content/src/nsSVGInteger.h
content/svg/content/src/nsSVGIntegerPair.cpp
content/svg/content/src/nsSVGIntegerPair.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/interfaces/svg/moz.build
dom/interfaces/svg/nsIDOMSVGAnimatedInteger.idl
dom/webidl/SVGAnimatedInteger.webidl
dom/webidl/SVGFETurbulenceElement.webidl
dom/webidl/SVGFilterElement.webidl
dom/webidl/WebIDL.mk
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/SVGAnimatedInteger.cpp
@@ -0,0 +1,32 @@
+/* -*- 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/dom/SVGAnimatedInteger.h"
+
+#include "mozilla/dom/SVGAnimatedIntegerBinding.h"
+
+namespace mozilla {
+namespace dom {
+
+NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedInteger,
+                                               mSVGElement)
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedInteger)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedInteger)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedInteger)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+NS_INTERFACE_MAP_END
+
+JSObject*
+SVGAnimatedInteger::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+{
+  return SVGAnimatedIntegerBinding::Wrap(aCx, aScope, this);
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/SVGAnimatedInteger.h
@@ -0,0 +1,51 @@
+/* -*- 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/. */
+
+#ifndef mozilla_dom_SVGAnimatedInteger_h
+#define mozilla_dom_SVGAnimatedInteger_h
+
+#include "nsIDOMSVGAnimatedEnum.h"
+#include "nsWrapperCache.h"
+
+#include "nsSVGElement.h"
+
+namespace mozilla {
+namespace dom {
+
+class SVGAnimatedInteger : public nsISupports
+                         , public nsWrapperCache
+{
+public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedInteger)
+
+  nsSVGElement* GetParentObject() const
+  {
+    return mSVGElement;
+  }
+
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+    MOZ_OVERRIDE MOZ_FINAL;
+
+  virtual int32_t BaseVal() = 0;
+  virtual void SetBaseVal(int32_t aBaseVal) = 0;
+  virtual int32_t AnimVal() = 0;
+
+protected:
+  explicit SVGAnimatedInteger(nsSVGElement* aSVGElement)
+    : mSVGElement(aSVGElement)
+  {
+    SetIsDOMBinding();
+  }
+  virtual ~SVGAnimatedInteger() {};
+
+  nsRefPtr<nsSVGElement> mSVGElement;
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_SVGAnimatedInteger_h
--- a/content/svg/content/src/SVGFEConvolveMatrixElement.cpp
+++ b/content/svg/content/src/SVGFEConvolveMatrixElement.cpp
@@ -86,42 +86,42 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFECon
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEConvolveMatrixElement::In1()
 {
   return mStringAttributes[IN1].ToDOMAnimatedString(this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFEConvolveMatrixElement::OrderX()
 {
   return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(nsSVGIntegerPair::eFirst, this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFEConvolveMatrixElement::OrderY()
 {
   return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(nsSVGIntegerPair::eSecond, this);
 }
 
 already_AddRefed<DOMSVGAnimatedNumberList>
 SVGFEConvolveMatrixElement::KernelMatrix()
 {
   return DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[KERNELMATRIX],
                                                  this, KERNELMATRIX);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFEConvolveMatrixElement::TargetX()
 {
   return mIntegerAttributes[TARGET_X].ToDOMAnimatedInteger(this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFEConvolveMatrixElement::TargetY()
 {
   return mIntegerAttributes[TARGET_Y].ToDOMAnimatedInteger(this);
 }
 
 already_AddRefed<SVGAnimatedEnumeration>
 SVGFEConvolveMatrixElement::EdgeMode()
 {
--- a/content/svg/content/src/SVGFEConvolveMatrixElement.h
+++ b/content/svg/content/src/SVGFEConvolveMatrixElement.h
@@ -54,21 +54,21 @@ public:
   virtual nsIntRect ComputeChangeBBox(const nsTArray<nsIntRect>& aSourceChangeBoxes,
           const nsSVGFilterInstance& aInstance) MOZ_OVERRIDE;
 
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
   // WebIDL
   already_AddRefed<SVGAnimatedString> In1();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> OrderX();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> OrderY();
+  already_AddRefed<SVGAnimatedInteger> OrderX();
+  already_AddRefed<SVGAnimatedInteger> OrderY();
   already_AddRefed<DOMSVGAnimatedNumberList> KernelMatrix();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> TargetX();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> TargetY();
+  already_AddRefed<SVGAnimatedInteger> TargetX();
+  already_AddRefed<SVGAnimatedInteger> TargetY();
   already_AddRefed<SVGAnimatedEnumeration> EdgeMode();
   already_AddRefed<SVGAnimatedBoolean> PreserveAlpha();
   already_AddRefed<nsIDOMSVGAnimatedNumber> Divisor();
   already_AddRefed<nsIDOMSVGAnimatedNumber> Bias();
   already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthX();
   already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthY();
 
 protected:
--- a/content/svg/content/src/SVGFETurbulenceElement.cpp
+++ b/content/svg/content/src/SVGFETurbulenceElement.cpp
@@ -93,17 +93,17 @@ SVGFETurbulenceElement::BaseFrequencyX()
 }
 
 already_AddRefed<nsIDOMSVGAnimatedNumber>
 SVGFETurbulenceElement::BaseFrequencyY()
 {
   return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(nsSVGNumberPair::eSecond, this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFETurbulenceElement::NumOctaves()
 {
   return mIntegerAttributes[OCTAVES].ToDOMAnimatedInteger(this);
 }
 
 already_AddRefed<nsIDOMSVGAnimatedNumber>
 SVGFETurbulenceElement::Seed()
 {
--- a/content/svg/content/src/SVGFETurbulenceElement.h
+++ b/content/svg/content/src/SVGFETurbulenceElement.h
@@ -45,17 +45,17 @@ public:
   virtual nsIntRect ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
           const nsSVGFilterInstance& aInstance) MOZ_OVERRIDE;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
 
   // WebIDL
   already_AddRefed<nsIDOMSVGAnimatedNumber> BaseFrequencyX();
   already_AddRefed<nsIDOMSVGAnimatedNumber> BaseFrequencyY();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> NumOctaves();
+  already_AddRefed<SVGAnimatedInteger> NumOctaves();
   already_AddRefed<nsIDOMSVGAnimatedNumber> Seed();
   already_AddRefed<SVGAnimatedEnumeration> StitchTiles();
   already_AddRefed<SVGAnimatedEnumeration> Type();
 
 protected:
   virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;
   virtual NumberPairAttributesInfo GetNumberPairInfo() MOZ_OVERRIDE;
   virtual IntegerAttributesInfo GetIntegerInfo() MOZ_OVERRIDE;
--- a/content/svg/content/src/SVGFilterElement.cpp
+++ b/content/svg/content/src/SVGFilterElement.cpp
@@ -100,24 +100,24 @@ SVGFilterElement::FilterUnits()
 }
 
 already_AddRefed<SVGAnimatedEnumeration>
 SVGFilterElement::PrimitiveUnits()
 {
   return mEnumAttributes[PRIMITIVEUNITS].ToDOMAnimatedEnum(this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFilterElement::FilterResX()
 {
   return mIntegerPairAttributes[FILTERRES].ToDOMAnimatedInteger(nsSVGIntegerPair::eFirst,
                                                                 this);
 }
 
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 SVGFilterElement::FilterResY()
 {
   return mIntegerPairAttributes[FILTERRES].ToDOMAnimatedInteger(nsSVGIntegerPair::eSecond,
                                                                 this);
 }
 
 void
 SVGFilterElement::SetFilterRes(uint32_t filterResX, uint32_t filterResY)
--- a/content/svg/content/src/SVGFilterElement.h
+++ b/content/svg/content/src/SVGFilterElement.h
@@ -49,18 +49,18 @@ public:
 
   // WebIDL
   already_AddRefed<SVGAnimatedLength> X();
   already_AddRefed<SVGAnimatedLength> Y();
   already_AddRefed<SVGAnimatedLength> Width();
   already_AddRefed<SVGAnimatedLength> Height();
   already_AddRefed<SVGAnimatedEnumeration> FilterUnits();
   already_AddRefed<SVGAnimatedEnumeration> PrimitiveUnits();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> FilterResX();
-  already_AddRefed<nsIDOMSVGAnimatedInteger> FilterResY();
+  already_AddRefed<SVGAnimatedInteger> FilterResX();
+  already_AddRefed<SVGAnimatedInteger> FilterResY();
   void SetFilterRes(uint32_t filterResX, uint32_t filterResY);
   already_AddRefed<SVGAnimatedString> Href();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo() MOZ_OVERRIDE;
   virtual IntegerPairAttributesInfo GetIntegerPairInfo() MOZ_OVERRIDE;
   virtual EnumAttributesInfo GetEnumInfo() MOZ_OVERRIDE;
--- a/content/svg/content/src/moz.build
+++ b/content/svg/content/src/moz.build
@@ -19,16 +19,17 @@ EXPORTS.mozilla.dom += [
     'SVGAltGlyphElement.h',
     'SVGAngle.h',
     'SVGAnimateElement.h',
     'SVGAnimateMotionElement.h',
     'SVGAnimateTransformElement.h',
     'SVGAnimatedAngle.h',
     'SVGAnimatedBoolean.h',
     'SVGAnimatedEnumeration.h',
+    'SVGAnimatedInteger.h',
     'SVGAnimatedLength.h',
     'SVGAnimatedRect.h',
     'SVGAnimatedString.h',
     'SVGAnimatedTransformList.h',
     'SVGAnimationElement.h',
     'SVGCircleElement.h',
     'SVGClipPathElement.h',
     'SVGComponentTransferFunctionElement.h',
@@ -113,16 +114,17 @@ CPP_SOURCES += [
     'SVGAltGlyphElement.cpp',
     'SVGAngle.cpp',
     'SVGAnimateElement.cpp',
     'SVGAnimateMotionElement.cpp',
     'SVGAnimateTransformElement.cpp',
     'SVGAnimatedAngle.cpp',
     'SVGAnimatedBoolean.cpp',
     'SVGAnimatedEnumeration.cpp',
+    'SVGAnimatedInteger.cpp',
     'SVGAnimatedLength.cpp',
     'SVGAnimatedLengthList.cpp',
     'SVGAnimatedNumberList.cpp',
     'SVGAnimatedPathSegList.cpp',
     'SVGAnimatedPointList.cpp',
     'SVGAnimatedPreserveAspectRatio.cpp',
     'SVGAnimatedRect.cpp',
     'SVGAnimatedString.cpp',
--- a/content/svg/content/src/nsSVGInteger.cpp
+++ b/content/svg/content/src/nsSVGInteger.cpp
@@ -5,29 +5,17 @@
 
 #include "nsError.h"
 #include "nsSVGAttrTearoffTable.h"
 #include "nsSVGInteger.h"
 #include "nsSMILValue.h"
 #include "SMILIntegerType.h"
 
 using namespace mozilla;
-
-NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger, mSVGElement)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGInteger::DOMAnimatedInteger)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGInteger::DOMAnimatedInteger)
-
-DOMCI_DATA(SVGAnimatedInteger, nsSVGInteger::DOMAnimatedInteger)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedInteger)
-NS_INTERFACE_MAP_END
+using namespace mozilla::dom;
 
 /* Implementation */
 
 static nsSVGAttrTearoffTable<nsSVGInteger, nsSVGInteger::DOMAnimatedInteger>
   sSVGAnimatedIntegerTearoffTable;
 
 static nsresult
 GetValueFromString(const nsAString &aValueAsString,
@@ -107,25 +95,17 @@ nsSVGInteger::SetAnimValue(int aValue, n
   if (mIsAnimated && aValue == mAnimVal) {
     return;
   }
   mAnimVal = aValue;
   mIsAnimated = true;
   aSVGElement->DidAnimateInteger(mAttrEnum);
 }
 
-nsresult
-nsSVGInteger::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
-                                   nsSVGElement *aSVGElement)
-{
-  *aResult = ToDOMAnimatedInteger(aSVGElement).get();
-  return NS_OK;
-}
-
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 nsSVGInteger::ToDOMAnimatedInteger(nsSVGElement *aSVGElement)
 {
   nsRefPtr<DOMAnimatedInteger> domAnimatedInteger =
     sSVGAnimatedIntegerTearoffTable.GetTearoff(this);
   if (!domAnimatedInteger) {
     domAnimatedInteger = new DOMAnimatedInteger(this, aSVGElement);
     sSVGAnimatedIntegerTearoffTable.AddTearoff(this, domAnimatedInteger);
   }
--- a/content/svg/content/src/nsSVGInteger.h
+++ b/content/svg/content/src/nsSVGInteger.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGINTEGER_H__
 #define __NS_SVGINTEGER_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
-#include "nsIDOMSVGAnimatedInteger.h"
+#include "SVGAnimatedInteger.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
 #include "mozilla/Attributes.h"
 
 class nsSMILValue;
 
 namespace mozilla {
 namespace dom {
@@ -48,56 +48,55 @@ public:
   // Returns true if the animated value of this integer has been explicitly
   // set (either by animation, or by taking on the base value which has been
   // explicitly set by markup or a DOM call), false otherwise.
   // If this returns false, the animated value is still valid, that is,
   // useable, and represents the default base value of the attribute.
   bool IsExplicitlySet() const
     { return mIsAnimated || mIsBaseSet; }
 
-  already_AddRefed<nsIDOMSVGAnimatedInteger>
+  already_AddRefed<mozilla::dom::SVGAnimatedInteger>
     ToDOMAnimatedInteger(nsSVGElement* aSVGElement);
-  nsresult ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
-                                nsSVGElement* aSVGElement);
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
   
 private:
 
   int32_t mAnimVal;
   int32_t mBaseVal;
   uint8_t mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
+  struct DOMAnimatedInteger MOZ_FINAL : public mozilla::dom::SVGAnimatedInteger
   {
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)
-
-    DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement *aSVGElement)
-      : mVal(aVal), mSVGElement(aSVGElement) {}
+    DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement)
+      : mozilla::dom::SVGAnimatedInteger(aSVGElement)
+      , mVal(aVal)
+    {}
     virtual ~DOMAnimatedInteger();
 
     nsSVGInteger* mVal; // kept alive because it belongs to content
-    nsRefPtr<nsSVGElement> mSVGElement;
 
-    NS_IMETHOD GetBaseVal(int32_t* aResult) MOZ_OVERRIDE
-      { *aResult = mVal->GetBaseValue(); return NS_OK; }
-    NS_IMETHOD SetBaseVal(int32_t aValue) MOZ_OVERRIDE
-      { mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; }
+    virtual int32_t BaseVal() MOZ_OVERRIDE
+    {
+      return mVal->GetBaseValue();
+    }
+    virtual void SetBaseVal(int32_t aValue) MOZ_OVERRIDE
+    {
+      mVal->SetBaseValue(aValue, mSVGElement);
+    }
 
     // Script may have modified animation parameters or timeline -- DOM getters
     // need to flush any resample requests to reflect these modifications.
-    NS_IMETHOD GetAnimVal(int32_t* aResult) MOZ_OVERRIDE
+    virtual int32_t AnimVal() MOZ_OVERRIDE
     {
       mSVGElement->FlushAnimations();
-      *aResult = mVal->GetAnimValue();
-      return NS_OK;
+      return mVal->GetAnimValue();
     }
   };
 
   struct SMILInteger : public nsISMILAttr
   {
   public:
     SMILInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/content/svg/content/src/nsSVGIntegerPair.cpp
+++ b/content/svg/content/src/nsSVGIntegerPair.cpp
@@ -8,29 +8,17 @@
 #include "nsCharSeparatedTokenizer.h"
 #include "nsError.h"
 #include "nsMathUtils.h"
 #include "nsSMILValue.h"
 #include "SVGContentUtils.h"
 #include "SVGIntegerPairSMILType.h"
 
 using namespace mozilla;
-
-NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGIntegerPair::DOMAnimatedInteger, mSVGElement)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGIntegerPair::DOMAnimatedInteger)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGIntegerPair::DOMAnimatedInteger)
-
-DOMCI_DATA(SVGAnimatedIntegerPair, nsSVGIntegerPair::DOMAnimatedInteger)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGIntegerPair::DOMAnimatedInteger)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedInteger)
-NS_INTERFACE_MAP_END
+using namespace mozilla::dom;
 
 static nsSVGAttrTearoffTable<nsSVGIntegerPair, nsSVGIntegerPair::DOMAnimatedInteger>
   sSVGFirstAnimatedIntegerTearoffTable;
 static nsSVGAttrTearoffTable<nsSVGIntegerPair, nsSVGIntegerPair::DOMAnimatedInteger>
   sSVGSecondAnimatedIntegerTearoffTable;
 
 /* Implementation */
 
@@ -163,26 +151,17 @@ nsSVGIntegerPair::SetAnimValue(const int
     return;
   }
   mAnimVal[0] = aValue[0];
   mAnimVal[1] = aValue[1];
   mIsAnimated = true;
   aSVGElement->DidAnimateIntegerPair(mAttrEnum);
 }
 
-nsresult
-nsSVGIntegerPair::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
-                                       PairIndex aIndex,
-                                       nsSVGElement *aSVGElement)
-{
-  *aResult = ToDOMAnimatedInteger(aIndex, aSVGElement).get();
-  return NS_OK;
-}
-
-already_AddRefed<nsIDOMSVGAnimatedInteger>
+already_AddRefed<SVGAnimatedInteger>
 nsSVGIntegerPair::ToDOMAnimatedInteger(PairIndex aIndex,
                                        nsSVGElement* aSVGElement)
 {
   nsRefPtr<DOMAnimatedInteger> domAnimatedInteger =
     aIndex == eFirst ? sSVGFirstAnimatedIntegerTearoffTable.GetTearoff(this) :
                        sSVGSecondAnimatedIntegerTearoffTable.GetTearoff(this);
   if (!domAnimatedInteger) {
     domAnimatedInteger = new DOMAnimatedInteger(this, aIndex, aSVGElement);
--- a/content/svg/content/src/nsSVGIntegerPair.h
+++ b/content/svg/content/src/nsSVGIntegerPair.h
@@ -4,20 +4,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGINTEGERPAIR_H__
 #define __NS_SVGINTEGERPAIR_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
-#include "nsIDOMSVGAnimatedInteger.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/SVGAnimatedInteger.h"
 
 class nsSMILValue;
 
 namespace mozilla {
 namespace dom {
 class SVGAnimationElement;
 }
 }
@@ -54,62 +54,59 @@ public:
   // Returns true if the animated value of this integer has been explicitly
   // set (either by animation, or by taking on the base value which has been
   // explicitly set by markup or a DOM call), false otherwise.
   // If this returns false, the animated value is still valid, that is,
   // useable, and represents the default base value of the attribute.
   bool IsExplicitlySet() const
     { return mIsAnimated || mIsBaseSet; }
 
-  nsresult ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
-                                PairIndex aIndex,
-                                nsSVGElement* aSVGElement);
-  already_AddRefed<nsIDOMSVGAnimatedInteger>
+  already_AddRefed<mozilla::dom::SVGAnimatedInteger>
     ToDOMAnimatedInteger(PairIndex aIndex,
                          nsSVGElement* aSVGElement);
    // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 
 private:
 
   int32_t mAnimVal[2];
   int32_t mBaseVal[2];
   uint8_t mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
+  struct DOMAnimatedInteger MOZ_FINAL : public mozilla::dom::SVGAnimatedInteger
   {
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)
-
-    DOMAnimatedInteger(nsSVGIntegerPair* aVal, PairIndex aIndex, nsSVGElement *aSVGElement)
-      : mVal(aVal), mSVGElement(aSVGElement), mIndex(aIndex) {}
+    DOMAnimatedInteger(nsSVGIntegerPair* aVal, PairIndex aIndex,
+                       nsSVGElement* aSVGElement)
+      : mozilla::dom::SVGAnimatedInteger(aSVGElement)
+      , mVal(aVal)
+      , mIndex(aIndex)
+    {}
     virtual ~DOMAnimatedInteger();
 
     nsSVGIntegerPair* mVal; // kept alive because it belongs to content
-    nsRefPtr<nsSVGElement> mSVGElement;
     PairIndex mIndex; // are we the first or second integer
 
-    NS_IMETHOD GetBaseVal(int32_t* aResult) MOZ_OVERRIDE
-      { *aResult = mVal->GetBaseValue(mIndex); return NS_OK; }
-    NS_IMETHOD SetBaseVal(int32_t aValue) MOZ_OVERRIDE
-      {
-        mVal->SetBaseValue(aValue, mIndex, mSVGElement);
-        return NS_OK;
-      }
+    virtual int32_t BaseVal() MOZ_OVERRIDE
+    {
+      return mVal->GetBaseValue(mIndex);
+    }
+    virtual void SetBaseVal(int32_t aValue) MOZ_OVERRIDE
+    {
+      mVal->SetBaseValue(aValue, mIndex, mSVGElement);
+    }
 
     // Script may have modified animation parameters or timeline -- DOM getters
     // need to flush any resample requests to reflect these modifications.
-    NS_IMETHOD GetAnimVal(int32_t* aResult) MOZ_OVERRIDE
+    virtual int32_t AnimVal() MOZ_OVERRIDE
     {
       mSVGElement->FlushAnimations();
-      *aResult = mVal->GetAnimValue(mIndex);
-      return NS_OK;
+      return mVal->GetAnimValue(mIndex);
     }
   };
 
   struct SMILIntegerPair : public nsISMILAttr
   {
   public:
     SMILIntegerPair(nsSVGIntegerPair* aVal, nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -178,17 +178,16 @@
 #include "nsTreeColumns.h"
 #endif
 #include "nsIDOMXPathExpression.h"
 #include "nsIDOMNSXPathExpression.h"
 #include "nsIDOMXPathNSResolver.h"
 #include "nsIDOMXPathResult.h"
 #include "nsIDOMMozBrowserFrame.h"
 
-#include "nsIDOMSVGAnimatedInteger.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMSVGNumber.h"
 
 // Storage includes
 #include "DOMStorage.h"
 
 // Drag and drop
@@ -565,18 +564,16 @@ static nsDOMClassInfoData sClassInfoData
 
   NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   // other SVG classes
-  NS_DEFINE_CLASSINFO_DATA(SVGAnimatedInteger, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedNumber, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGLength, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozCanvasPrintState, nsDOMGenericSH,
@@ -1503,20 +1500,16 @@ nsDOMClassInfo::Init()
 
   DOM_CLASSINFO_MAP_BEGIN(CSSSupportsRule, nsIDOMCSSSupportsRule)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
   DOM_CLASSINFO_MAP_END
 
   // The SVG document
 
   // other SVG classes
-  DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedInteger, nsIDOMSVGAnimatedInteger)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedNumber, nsIDOMSVGAnimatedNumber)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGLength, nsIDOMSVGLength)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLength)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -69,17 +69,16 @@ DOMCI_CLASS(DOMStringList)
 #ifdef MOZ_XUL
 DOMCI_CLASS(TreeColumn)
 #endif
 
 DOMCI_CLASS(CSSMozDocumentRule)
 DOMCI_CLASS(CSSSupportsRule)
 
 // other SVG classes
-DOMCI_CLASS(SVGAnimatedInteger)
 DOMCI_CLASS(SVGAnimatedNumber)
 DOMCI_CLASS(SVGLength)
 DOMCI_CLASS(SVGNumber)
 
 // Canvas
 DOMCI_CLASS(MozCanvasPrintState)
 
 // WindowUtils
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1658,17 +1658,16 @@ addExternalIface('nsIVariant', nativeTyp
 addExternalIface('OutputStream', nativeType='nsIOutputStream',
                  notflattened=True)
 addExternalIface('Principal', nativeType='nsIPrincipal',
                  headerFile='nsIPrincipal.h', notflattened=True)
 addExternalIface('PrintCallback', nativeType='nsIPrintCallback',
                  headerFile='nsIDOMHTMLCanvasElement.h')
 addExternalIface('Selection', nativeType='nsISelection')
 addExternalIface('StyleSheetList')
-addExternalIface('SVGAnimatedNumber')
 addExternalIface('SVGLength')
 addExternalIface('SVGNumber')
 addExternalIface('TouchList', headerFile='nsIDOMTouchEvent.h')
 addExternalIface('URI', nativeType='nsIURI', headerFile='nsIURI.h',
                  notflattened=True)
 addExternalIface('UserDataHandler')
 addExternalIface('Window')
 addExternalIface('XPathResult', nativeType='nsISupports')
--- a/dom/interfaces/svg/moz.build
+++ b/dom/interfaces/svg/moz.build
@@ -1,17 +1,16 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIDOMSVGAnimatedEnum.idl',
-    'nsIDOMSVGAnimatedInteger.idl',
     'nsIDOMSVGAnimatedNumber.idl',
     'nsIDOMSVGElement.idl',
     'nsIDOMSVGLength.idl',
     'nsIDOMSVGNumber.idl',
 ]
 
 XPIDL_MODULE = 'dom_svg'
 
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGAnimatedInteger.idl
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-/**
- * The nsIDOMSVGAnimatedNumber interface is the interface to an SVG
- * Animated Integer.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/SVG11/types.html
- *
- */
-
-[scriptable, uuid(7b196db6-955e-4a9f-8f42-645ebc2ce938)]
-interface nsIDOMSVGAnimatedInteger : nsISupports
-{
-  attribute long baseVal;
-      // raises DOMException on setting
-  readonly attribute long animVal;
-};
-
-
new file mode 100644
--- /dev/null
+++ b/dom/webidl/SVGAnimatedInteger.webidl
@@ -0,0 +1,16 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedInteger
+ *
+ * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+interface SVGAnimatedInteger {
+           attribute long baseVal;
+  readonly attribute long animVal;
+};
--- a/dom/webidl/SVGFETurbulenceElement.webidl
+++ b/dom/webidl/SVGFETurbulenceElement.webidl
@@ -5,17 +5,16 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/SVG2/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface SVGAnimatedInteger;
 interface SVGAnimatedNumber;
 
 interface SVGFETurbulenceElement : SVGElement {
 
   // Turbulence Types
   const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
   const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
   const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE = 2;
--- a/dom/webidl/SVGFilterElement.webidl
+++ b/dom/webidl/SVGFilterElement.webidl
@@ -5,18 +5,16 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/SVG2/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface SVGAnimatedInteger;
-
 interface SVGFilterElement : SVGElement {
   readonly attribute SVGAnimatedEnumeration filterUnits;
   readonly attribute SVGAnimatedEnumeration primitiveUnits;
   readonly attribute SVGAnimatedLength x;
   readonly attribute SVGAnimatedLength y;
   readonly attribute SVGAnimatedLength width;
   readonly attribute SVGAnimatedLength height;
   readonly attribute SVGAnimatedInteger filterResX;
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -224,16 +224,17 @@ webidl_files = \
   SimpleGestureEvent.webidl \
   StyleSheet.webidl \
   SVGAElement.webidl \
   SVGAltGlyphElement.webidl \
   SVGAngle.webidl \
   SVGAnimatedAngle.webidl \
   SVGAnimatedBoolean.webidl \
   SVGAnimatedEnumeration.webidl \
+  SVGAnimatedInteger.webidl \
   SVGAnimatedLength.webidl \
   SVGAnimatedLengthList.webidl \
   SVGAnimatedNumberList.webidl \
   SVGAnimatedPathData.webidl \
   SVGAnimatedPoints.webidl \
   SVGAnimatedPreserveAspectRatio.webidl \
   SVGAnimatedRect.webidl \
   SVGAnimatedString.webidl \