Bug 832169 - Convert SVGAnimatedLength to WebIDL r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 19 Jan 2013 15:56:00 -0500
changeset 119370 e5321a44b63c1e0cb89dd86de23a2837eddc3fcd
parent 119369 a5f5694ad2c075d5b249b5335527de2aea8769cb
child 119371 abafe7350c6f1a95a7811b17ec23f6440be0a7ac
push id24197
push userryanvm@gmail.com
push dateSun, 20 Jan 2013 05:25:28 +0000
treeherdermozilla-central@1d122eaa9070 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs832169
milestone21.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 832169 - Convert SVGAnimatedLength to WebIDL r=bz
content/svg/content/src/Makefile.in
content/svg/content/src/SVGAnimatedLength.cpp
content/svg/content/src/SVGAnimatedLength.h
content/svg/content/src/SVGCircleElement.cpp
content/svg/content/src/SVGCircleElement.h
content/svg/content/src/SVGEllipseElement.cpp
content/svg/content/src/SVGEllipseElement.h
content/svg/content/src/SVGForeignObjectElement.cpp
content/svg/content/src/SVGForeignObjectElement.h
content/svg/content/src/SVGGradientElement.cpp
content/svg/content/src/SVGGradientElement.h
content/svg/content/src/SVGImageElement.cpp
content/svg/content/src/SVGImageElement.h
content/svg/content/src/SVGLineElement.cpp
content/svg/content/src/SVGLineElement.h
content/svg/content/src/SVGPatternElement.cpp
content/svg/content/src/SVGPatternElement.h
content/svg/content/src/SVGRectElement.cpp
content/svg/content/src/SVGRectElement.h
content/svg/content/src/SVGSVGElement.cpp
content/svg/content/src/SVGSVGElement.h
content/svg/content/src/SVGTextPathElement.cpp
content/svg/content/src/SVGTextPathElement.h
content/svg/content/src/SVGUseElement.cpp
content/svg/content/src/SVGUseElement.h
content/svg/content/src/nsSVGLength2.cpp
content/svg/content/src/nsSVGLength2.h
dom/webidl/SVGAnimatedLength.webidl
dom/webidl/SVGCircleElement.webidl
dom/webidl/SVGEllipseElement.webidl
dom/webidl/SVGForeignObjectElement.webidl
dom/webidl/SVGLineElement.webidl
dom/webidl/SVGPatternElement.webidl
dom/webidl/SVGRectElement.webidl
dom/webidl/SVGSVGElement.webidl
dom/webidl/SVGTextPathElement.webidl
dom/webidl/WebIDL.mk
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -60,16 +60,17 @@ CPPSRCS		= \
 		nsSVGRect.cpp \
 		nsSVGUnknownElement.cpp \
 		nsSVGViewBox.cpp \
 		SVGAElement.cpp \
 		SVGAltGlyphElement.cpp \
 		SVGAngle.cpp \
 		SVGAnimatedAngle.cpp \
 		SVGAnimatedBoolean.cpp \
+		SVGAnimatedLength.cpp \
 		SVGAnimatedLengthList.cpp \
 		SVGAnimatedNumberList.cpp \
 		SVGAnimatedPathSegList.cpp \
 		SVGAnimatedPointList.cpp \
 		SVGAnimatedPreserveAspectRatio.cpp \
 		SVGAnimatedTransformList.cpp \
 		SVGAnimateElement.cpp \
 		SVGAnimateTransformElement.cpp \
@@ -154,16 +155,17 @@ EXPORTS =  			\
 EXPORTS_NAMESPACES = mozilla/dom
 
 EXPORTS_mozilla/dom = \
 	SVGAElement.h \
 	SVGAltGlyphElement.h \
 	SVGAngle.h \
 	SVGAnimatedAngle.h \
 	SVGAnimatedBoolean.h \
+	SVGAnimatedLength.h \
 	SVGAnimateElement.h \
 	SVGAnimateTransformElement.h \
 	SVGAnimateMotionElement.h \
 	SVGAnimationElement.h \
 	SVGClipPathElement.h \
 	SVGCircleElement.h \
 	SVGDefsElement.h \
 	SVGDescElement.h \
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/SVGAnimatedLength.cpp
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; 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 "mozilla/dom/SVGAnimatedLength.h"
+#include "mozilla/dom/SVGAnimatedLengthBinding.h"
+
+DOMCI_DATA(SVGAnimatedLength, mozilla::dom::SVGAnimatedLength)
+
+namespace mozilla {
+namespace dom {
+
+NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedLength, mSVGElement)
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedLength)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedLength)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedLength)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedLength)
+NS_INTERFACE_MAP_END
+
+JSObject*
+SVGAnimatedLength::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
+{
+  return SVGAnimatedLengthBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
+
+already_AddRefed<nsIDOMSVGLength>
+SVGAnimatedLength::BaseVal()
+{
+  nsRefPtr<nsIDOMSVGLength> angle;
+  mVal->ToDOMBaseVal(getter_AddRefs(angle), mSVGElement);
+  return angle.forget();
+}
+
+already_AddRefed<nsIDOMSVGLength>
+SVGAnimatedLength::AnimVal()
+{
+  nsRefPtr<nsIDOMSVGLength> angle;
+  mVal->ToDOMAnimVal(getter_AddRefs(angle), mSVGElement);
+  return angle.forget();
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/SVGAnimatedLength.h
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; 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/. */
+
+#ifndef mozilla_dom_SVGAnimatedLength_h
+#define mozilla_dom_SVGAnimatedLength_h
+
+#include "nsSVGElement.h"
+#include "nsSVGLength2.h"
+
+namespace mozilla {
+namespace dom {
+
+class SVGAnimatedLength MOZ_FINAL : public nsIDOMSVGAnimatedLength,
+                                    public nsWrapperCache
+{
+public:
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedLength)
+
+  SVGAnimatedLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
+    : mVal(aVal), mSVGElement(aSVGElement)
+  { SetIsDOMBinding(); }
+
+  ~SVGAnimatedLength();
+
+  NS_IMETHOD GetBaseVal(nsIDOMSVGLength **aBaseVal)
+    { *aBaseVal = BaseVal().get(); return NS_OK; }
+
+  NS_IMETHOD GetAnimVal(nsIDOMSVGLength **aAnimVal)
+    { *aAnimVal = AnimVal().get(); return NS_OK; }
+
+  // WebIDL
+  nsSVGElement* GetParentObject() { return mSVGElement; }
+  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap);
+  already_AddRefed<nsIDOMSVGLength> BaseVal();
+  already_AddRefed<nsIDOMSVGLength> AnimVal();
+
+protected:
+  nsSVGLength2* mVal; // kept alive because it belongs to content
+  nsRefPtr<nsSVGElement> mSVGElement;
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_SVGAnimatedLength_h
--- a/content/svg/content/src/SVGCircleElement.cpp
+++ b/content/svg/content/src/SVGCircleElement.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; 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 "mozilla/dom/SVGCircleElement.h"
 #include "nsGkAtoms.h"
 #include "gfxContext.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGCircleElementBinding.h"
 
 DOMCI_NODE_DATA(SVGCircleElement, mozilla::dom::SVGCircleElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Circle)
 
 namespace mozilla {
 namespace dom {
@@ -60,43 +61,43 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGCircl
 
 /* readonly attribute nsIDOMSVGAnimatedLength cx; */
 NS_IMETHODIMP SVGCircleElement::GetCx(nsIDOMSVGAnimatedLength * *aCx)
 {
   *aCx = Cx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGCircleElement::Cx()
 {
   return mLengthAttributes[ATTR_CX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength cy; */
 NS_IMETHODIMP SVGCircleElement::GetCy(nsIDOMSVGAnimatedLength * *aCy)
 {
   *aCy = Cy().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGCircleElement::Cy()
 {
   return mLengthAttributes[ATTR_CY].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength r; */
 NS_IMETHODIMP SVGCircleElement::GetR(nsIDOMSVGAnimatedLength * *aR)
 {
   *aR = R().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGCircleElement::R()
 {
   return mLengthAttributes[ATTR_R].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
--- a/content/svg/content/src/SVGCircleElement.h
+++ b/content/svg/content/src/SVGCircleElement.h
@@ -45,19 +45,19 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cy();
-  already_AddRefed<nsIDOMSVGAnimatedLength> R();
+  already_AddRefed<SVGAnimatedLength> Cx();
+  already_AddRefed<SVGAnimatedLength> Cy();
+  already_AddRefed<SVGAnimatedLength> R();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { ATTR_CX, ATTR_CY, ATTR_R };
   nsSVGLength2 mLengthAttributes[3];
   static LengthInfo sLengthInfo[3];
--- a/content/svg/content/src/SVGEllipseElement.cpp
+++ b/content/svg/content/src/SVGEllipseElement.cpp
@@ -1,13 +1,14 @@
 /* -*- Mode: C++; 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 "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGEllipseElement.h"
 #include "mozilla/dom/SVGEllipseElementBinding.h"
 #include "gfxContext.h"
 
 DOMCI_NODE_DATA(SVGEllipseElement, mozilla::dom::SVGEllipseElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Ellipse)
 
@@ -60,56 +61,56 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGEllip
 
 /* readonly attribute nsIDOMSVGAnimatedLength cx; */
 NS_IMETHODIMP SVGEllipseElement::GetCx(nsIDOMSVGAnimatedLength * *aCx)
 {
   *aCx = Cx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGEllipseElement::Cx()
 {
   return mLengthAttributes[CX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength cy; */
 NS_IMETHODIMP SVGEllipseElement::GetCy(nsIDOMSVGAnimatedLength * *aCy)
 {
   *aCy = Cy().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGEllipseElement::Cy()
 {
   return mLengthAttributes[CY].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength rx; */
 NS_IMETHODIMP SVGEllipseElement::GetRx(nsIDOMSVGAnimatedLength * *aRx)
 {
   *aRx = Rx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGEllipseElement::Rx()
 {
   return mLengthAttributes[RX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength ry; */
 NS_IMETHODIMP SVGEllipseElement::GetRy(nsIDOMSVGAnimatedLength * *aRy)
 {
   *aRy = Ry().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGEllipseElement::Ry()
 {
   return mLengthAttributes[RY].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
--- a/content/svg/content/src/SVGEllipseElement.h
+++ b/content/svg/content/src/SVGEllipseElement.h
@@ -45,20 +45,20 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cy();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Rx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Ry();
+  already_AddRefed<SVGAnimatedLength> Cx();
+  already_AddRefed<SVGAnimatedLength> Cy();
+  already_AddRefed<SVGAnimatedLength> Rx();
+  already_AddRefed<SVGAnimatedLength> Ry();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { CX, CY, RX, RY };
   nsSVGLength2 mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
--- a/content/svg/content/src/SVGForeignObjectElement.cpp
+++ b/content/svg/content/src/SVGForeignObjectElement.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; 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 "mozilla/Util.h"
 
 #include "nsCOMPtr.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGForeignObjectElement.h"
 #include "mozilla/dom/SVGForeignObjectElementBinding.h"
 
 DOMCI_NODE_DATA(SVGForeignObjectElement, mozilla::dom::SVGForeignObjectElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(ForeignObject)
 
 namespace mozilla {
@@ -62,58 +63,58 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGForei
 
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP SVGForeignObjectElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGForeignObjectElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP SVGForeignObjectElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGForeignObjectElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP SVGForeignObjectElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGForeignObjectElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP SVGForeignObjectElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGForeignObjectElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
--- a/content/svg/content/src/SVGForeignObjectElement.h
+++ b/content/svg/content/src/SVGForeignObjectElement.h
@@ -50,20 +50,20 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Height();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   nsSVGLength2 mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
--- a/content/svg/content/src/SVGGradientElement.cpp
+++ b/content/svg/content/src/SVGGradientElement.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; 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 "mozilla/dom/SVGGradientElement.h"
 
 #include "DOMSVGAnimatedTransformList.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGRadialGradientElementBinding.h"
 #include "mozilla/dom/SVGLinearGradientElementBinding.h"
 #include "mozilla/Util.h"
 #include "nsCOMPtr.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 #include "nsIDOMSVGGradientElement.h"
@@ -217,56 +218,56 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLinea
 
 /* readonly attribute nsIDOMSVGAnimatedLength x1; */
 NS_IMETHODIMP SVGLinearGradientElement::GetX1(nsIDOMSVGAnimatedLength * *aX1)
 {
   *aX1 = X1().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLinearGradientElement::X1()
 {
   return mLengthAttributes[ATTR_X1].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y1; */
 NS_IMETHODIMP SVGLinearGradientElement::GetY1(nsIDOMSVGAnimatedLength * *aY1)
 {
   *aY1 = Y1().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLinearGradientElement::Y1()
 {
   return mLengthAttributes[ATTR_Y1].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength x2; */
 NS_IMETHODIMP SVGLinearGradientElement::GetX2(nsIDOMSVGAnimatedLength * *aX2)
 {
   *aX2 = X2().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLinearGradientElement::X2()
 {
   return mLengthAttributes[ATTR_X2].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y2; */
 NS_IMETHODIMP SVGLinearGradientElement::GetY2(nsIDOMSVGAnimatedLength * *aY2)
 {
   *aY2 = Y2().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLinearGradientElement::Y2()
 {
   return mLengthAttributes[ATTR_Y2].ToDOMAnimatedLength(this);
 }
 
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
@@ -337,69 +338,69 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRadia
 
 /* readonly attribute nsIDOMSVGAnimatedLength cx; */
 NS_IMETHODIMP SVGRadialGradientElement::GetCx(nsIDOMSVGAnimatedLength * *aCx)
 {
   *aCx = Cx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::Cx()
 {
   return mLengthAttributes[ATTR_CX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength cy; */
 NS_IMETHODIMP SVGRadialGradientElement::GetCy(nsIDOMSVGAnimatedLength * *aCy)
 {
   *aCy = Cy().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::Cy()
 {
   return mLengthAttributes[ATTR_CY].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength r; */
 NS_IMETHODIMP SVGRadialGradientElement::GetR(nsIDOMSVGAnimatedLength * *aR)
 {
   *aR = R().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::R()
 {
   return mLengthAttributes[ATTR_R].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength fx; */
 NS_IMETHODIMP SVGRadialGradientElement::GetFx(nsIDOMSVGAnimatedLength * *aFx)
 {
   *aFx = Fx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::Fx()
 {
   return mLengthAttributes[ATTR_FX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength fy; */
 NS_IMETHODIMP SVGRadialGradientElement::GetFy(nsIDOMSVGAnimatedLength * *aFy)
 {
   *aFy = Fy().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::Fy()
 {
   return mLengthAttributes[ATTR_FY].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
--- a/content/svg/content/src/SVGGradientElement.h
+++ b/content/svg/content/src/SVGGradientElement.h
@@ -124,20 +124,20 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X1();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y1();
-  already_AddRefed<nsIDOMSVGAnimatedLength> X2();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y2();
+  already_AddRefed<SVGAnimatedLength> X1();
+  already_AddRefed<SVGAnimatedLength> Y1();
+  already_AddRefed<SVGAnimatedLength> X2();
+  already_AddRefed<SVGAnimatedLength> Y2();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   // nsIDOMSVGLinearGradientElement values
   enum { ATTR_X1, ATTR_Y1, ATTR_X2, ATTR_Y2 };
   nsSVGLength2 mLengthAttributes[4];
@@ -179,21 +179,21 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Cy();
-  already_AddRefed<nsIDOMSVGAnimatedLength> R();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Fx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Fy();
+  already_AddRefed<SVGAnimatedLength> Cx();
+  already_AddRefed<SVGAnimatedLength> Cy();
+  already_AddRefed<SVGAnimatedLength> R();
+  already_AddRefed<SVGAnimatedLength> Fx();
+  already_AddRefed<SVGAnimatedLength> Fy();
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   // nsIDOMSVGRadialGradientElement values
   enum { ATTR_CX, ATTR_CY, ATTR_R, ATTR_FX, ATTR_FY };
   nsSVGLength2 mLengthAttributes[5];
   static LengthInfo sLengthInfo[5];
--- a/content/svg/content/src/SVGImageElement.cpp
+++ b/content/svg/content/src/SVGImageElement.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; 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 "mozilla/Util.h"
 
 #include "mozilla/dom/SVGImageElement.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "nsCOMPtr.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "imgIContainer.h"
 #include "imgINotificationObserver.h"
 #include "gfxContext.h"
 #include "mozilla/dom/SVGImageElementBinding.h"
 
@@ -83,56 +84,56 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGImage
 
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP SVGImageElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGImageElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP SVGImageElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGImageElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP SVGImageElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGImageElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP SVGImageElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGImageElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
 NS_IMETHODIMP
 SVGImageElement::GetPreserveAspectRatio(nsISupports
--- a/content/svg/content/src/SVGImageElement.h
+++ b/content/svg/content/src/SVGImageElement.h
@@ -77,20 +77,20 @@ public:
 
   bool IsImageSrcSetDisabled() const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Height();
   already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
 
 protected:
   nsresult LoadSVGImage(bool aForce, bool aNotify);
 
   virtual LengthAttributesInfo GetLengthInfo();
   virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
--- a/content/svg/content/src/SVGLineElement.cpp
+++ b/content/svg/content/src/SVGLineElement.cpp
@@ -1,13 +1,14 @@
 /* -*- Mode: C++; 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 "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGLineElement.h"
 #include "mozilla/dom/SVGLineElementBinding.h"
 #include "gfxContext.h"
 
 DOMCI_NODE_DATA(SVGLineElement, mozilla::dom::SVGLineElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Line)
 
@@ -60,56 +61,56 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLineE
 
 /* readonly attribute nsIDOMSVGAnimatedLength cx; */
 NS_IMETHODIMP SVGLineElement::GetX1(nsIDOMSVGAnimatedLength * *aX1)
 {
   *aX1 = X1().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLineElement::X1()
 {
   return mLengthAttributes[ATTR_X1].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength cy; */
 NS_IMETHODIMP SVGLineElement::GetY1(nsIDOMSVGAnimatedLength * *aY1)
 {
   *aY1 = Y1().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLineElement::Y1()
 {
   return mLengthAttributes[ATTR_Y1].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength rx; */
 NS_IMETHODIMP SVGLineElement::GetX2(nsIDOMSVGAnimatedLength * *aX2)
 {
   *aX2 = X2().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLineElement::X2()
 {
   return mLengthAttributes[ATTR_X2].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength ry; */
 NS_IMETHODIMP SVGLineElement::GetY2(nsIDOMSVGAnimatedLength * *aY2)
 {
   *aY2 = Y2().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGLineElement::Y2()
 {
   return mLengthAttributes[ATTR_Y2].ToDOMAnimatedLength(this);
 }
 
 
 //----------------------------------------------------------------------
 // nsIContent methods
--- a/content/svg/content/src/SVGLineElement.h
+++ b/content/svg/content/src/SVGLineElement.h
@@ -47,20 +47,20 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X1();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y1();
-  already_AddRefed<nsIDOMSVGAnimatedLength> X2();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y2();
+  already_AddRefed<SVGAnimatedLength> X1();
+  already_AddRefed<SVGAnimatedLength> Y1();
+  already_AddRefed<SVGAnimatedLength> X2();
+  already_AddRefed<SVGAnimatedLength> Y2();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { ATTR_X1, ATTR_Y1, ATTR_X2, ATTR_Y2 };
   nsSVGLength2 mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
--- a/content/svg/content/src/SVGPatternElement.cpp
+++ b/content/svg/content/src/SVGPatternElement.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Util.h"
 
 #include "DOMSVGAnimatedTransformList.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsCOMPtr.h"
 #include "nsGkAtoms.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGPatternElement.h"
 #include "mozilla/dom/SVGPatternElementBinding.h"
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Pattern)
 
 DOMCI_NODE_DATA(SVGPatternElement, mozilla::dom::SVGPatternElement)
 
 namespace mozilla {
@@ -161,56 +162,56 @@ SVGPatternElement::PatternTransform()
 
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP SVGPatternElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGPatternElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP SVGPatternElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGPatternElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP SVGPatternElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGPatternElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP SVGPatternElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGPatternElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsIDOMSVGURIReference methods:
 
--- a/content/svg/content/src/SVGPatternElement.h
+++ b/content/svg/content/src/SVGPatternElement.h
@@ -82,20 +82,20 @@ public:
   }
 
   // WebIDL
   already_AddRefed<nsIDOMSVGAnimatedRect> ViewBox();
   already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
   already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternUnits();
   already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternContentUnits();
   already_AddRefed<DOMSVGAnimatedTransformList> PatternTransform();
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Height();
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
   virtual EnumAttributesInfo GetEnumInfo();
   virtual nsSVGViewBox *GetViewBox();
   virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
--- a/content/svg/content/src/SVGRectElement.cpp
+++ b/content/svg/content/src/SVGRectElement.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/SVGRectElement.h"
 #include "nsGkAtoms.h"
 #include "gfxContext.h"
 #include "mozilla/dom/SVGRectElementBinding.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include <algorithm>
 
 DOMCI_NODE_DATA(SVGRectElement, mozilla::dom::SVGRectElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Rect)
 
 namespace mozilla {
 namespace dom {
@@ -64,82 +65,82 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRectE
 
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP SVGRectElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP SVGRectElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP SVGRectElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP SVGRectElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength rx; */
 NS_IMETHODIMP SVGRectElement::GetRx(nsIDOMSVGAnimatedLength * *aRx)
 {
   *aRx = Rx().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::Rx()
 {
   return mLengthAttributes[ATTR_RX].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength ry; */
 NS_IMETHODIMP SVGRectElement::GetRy(nsIDOMSVGAnimatedLength * *aRy)
 {
   *aRy = Ry().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGRectElement::Ry()
 {
   return mLengthAttributes[ATTR_RY].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
--- a/content/svg/content/src/SVGRectElement.h
+++ b/content/svg/content/src/SVGRectElement.h
@@ -45,22 +45,22 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Rx();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Ry();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Rx();
+  already_AddRefed<SVGAnimatedLength> Ry();
 
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT, ATTR_RX, ATTR_RY };
   nsSVGLength2 mLengthAttributes[6];
   static LengthInfo sLengthInfo[6];
--- a/content/svg/content/src/SVGSVGElement.cpp
+++ b/content/svg/content/src/SVGSVGElement.cpp
@@ -34,16 +34,17 @@
 #include "SVGContentUtils.h"
 
 #include "nsEventDispatcher.h"
 #include "nsSMILTimeContainer.h"
 #include "nsSMILAnimationController.h"
 #include "nsSMILTypes.h"
 #include "nsIContentIterator.h"
 #include "SVGAngle.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include <algorithm>
 
 DOMCI_NODE_DATA(SVGSVGElement, mozilla::dom::SVGSVGElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT_CHECK_PARSER(SVG)
 
 namespace mozilla {
 namespace dom {
@@ -203,59 +204,59 @@ SVGSVGElement::Clone(nsINodeInfo *aNodeI
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP
 SVGSVGElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGSVGElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP
 SVGSVGElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGSVGElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP
 SVGSVGElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGSVGElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP
 SVGSVGElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGSVGElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute float pixelUnitToMillimeterX; */
 NS_IMETHODIMP
 SVGSVGElement::GetPixelUnitToMillimeterX(float *aPixelUnitToMillimeterX)
--- a/content/svg/content/src/SVGSVGElement.h
+++ b/content/svg/content/src/SVGSVGElement.h
@@ -226,20 +226,20 @@ public:
     mViewportHeight = aSize.height;
   }
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Height();
   float PixelUnitToMillimeterX();
   float PixelUnitToMillimeterY();
   float ScreenPixelToMillimeterX();
   float ScreenPixelToMillimeterY();
   bool UseCurrentView();
   // XPIDL SetCurrentScale and SetCurrentTranslate are alright to use because
   // they only throw on non-finite floats and we don't allow those.
   float CurrentScale();
--- a/content/svg/content/src/SVGTextPathElement.cpp
+++ b/content/svg/content/src/SVGTextPathElement.cpp
@@ -7,16 +7,17 @@
 #include "mozilla/dom/SVGTextPathElementBinding.h"
 #include "nsSVGElement.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMSVGTextPathElement.h"
 #include "nsIDOMSVGURIReference.h"
 #include "nsIFrame.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 
 DOMCI_NODE_DATA(SVGTextPathElement, mozilla::dom::SVGTextPathElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(TextPath)
 
 namespace mozilla {
 namespace dom {
 
@@ -110,17 +111,17 @@ SVGTextPathElement::Href()
 // nsIDOMSVGTextPathElement methods
 
 NS_IMETHODIMP SVGTextPathElement::GetStartOffset(nsIDOMSVGAnimatedLength * *aStartOffset)
 {
   *aStartOffset = StartOffset().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGTextPathElement::StartOffset()
 {
   return mLengthAttributes[STARTOFFSET].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedEnumeration method; */
 NS_IMETHODIMP SVGTextPathElement::GetMethod(nsIDOMSVGAnimatedEnumeration * *aMethod)
 {
--- a/content/svg/content/src/SVGTextPathElement.h
+++ b/content/svg/content/src/SVGTextPathElement.h
@@ -67,17 +67,17 @@ public:
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
 
   // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedLength> StartOffset();
+  already_AddRefed<SVGAnimatedLength> StartOffset();
   already_AddRefed<nsIDOMSVGAnimatedEnumeration> Method();
   already_AddRefed<nsIDOMSVGAnimatedEnumeration> Spacing();
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
 
  protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
   virtual EnumAttributesInfo GetEnumInfo();
--- a/content/svg/content/src/SVGUseElement.cpp
+++ b/content/svg/content/src/SVGUseElement.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; 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 "mozilla/Util.h"
 
+#include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGUseElement.h"
 #include "mozilla/dom/SVGUseElementBinding.h"
 #include "nsIDOMSVGGElement.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "nsIDOMSVGSymbolElement.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
@@ -150,56 +151,56 @@ SVGUseElement::Href()
 
 /* readonly attribute nsIDOMSVGAnimatedLength x; */
 NS_IMETHODIMP SVGUseElement::GetX(nsIDOMSVGAnimatedLength * *aX)
 {
   *aX = X().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGUseElement::X()
 {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength y; */
 NS_IMETHODIMP SVGUseElement::GetY(nsIDOMSVGAnimatedLength * *aY)
 {
   *aY = Y().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGUseElement::Y()
 {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength width; */
 NS_IMETHODIMP SVGUseElement::GetWidth(nsIDOMSVGAnimatedLength * *aWidth)
 {
   *aWidth = Width().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGUseElement::Width()
 {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
 /* readonly attribute nsIDOMSVGAnimatedLength height; */
 NS_IMETHODIMP SVGUseElement::GetHeight(nsIDOMSVGAnimatedLength * *aHeight)
 {
   *aHeight = Height().get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 SVGUseElement::Height()
 {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
 //----------------------------------------------------------------------
 // nsIMutationObserver methods
 
--- a/content/svg/content/src/SVGUseElement.h
+++ b/content/svg/content/src/SVGUseElement.h
@@ -86,20 +86,20 @@ public:
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
-  already_AddRefed<nsIDOMSVGAnimatedLength> X();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Y();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Width();
-  already_AddRefed<nsIDOMSVGAnimatedLength> Height();
+  already_AddRefed<SVGAnimatedLength> X();
+  already_AddRefed<SVGAnimatedLength> Y();
+  already_AddRefed<SVGAnimatedLength> Width();
+  already_AddRefed<SVGAnimatedLength> Height();
 
 protected:
   class SourceReference : public nsReferencedElement {
   public:
     SourceReference(SVGUseElement* aContainer) : mContainer(aContainer) {}
   protected:
     virtual void ElementChanged(Element* aFrom, Element* aTo) {
       nsReferencedElement::ElementChanged(aFrom, aTo);
--- a/content/svg/content/src/nsSVGLength2.cpp
+++ b/content/svg/content/src/nsSVGLength2.cpp
@@ -11,71 +11,59 @@
 #include "mozilla/dom/SVGSVGElement.h"
 #include "nsIFrame.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGAttrTearoffTable.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 #include "nsSMILValue.h"
 #include "nsSMILFloatType.h"
 #include "nsAttrValueInlines.h"
+#include "mozilla/dom/SVGAnimatedLength.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal, mSVGElement)
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal, mSVGElement)
 
-NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength, mSVGElement)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMBaseVal)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMBaseVal)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimVal)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimVal)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimatedLength)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimatedLength)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGLength)
 NS_INTERFACE_MAP_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGLength)
 NS_INTERFACE_MAP_END
 
-DOMCI_DATA(SVGAnimatedLength, nsSVGLength2::DOMAnimatedLength)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedLength)
-NS_INTERFACE_MAP_END
-
 static nsIAtom** const unitMap[] =
 {
   nullptr, /* SVG_LENGTHTYPE_UNKNOWN */
   nullptr, /* SVG_LENGTHTYPE_NUMBER */
   &nsGkAtoms::percentage,
   &nsGkAtoms::em,
   &nsGkAtoms::ex,
   &nsGkAtoms::px,
   &nsGkAtoms::cm,
   &nsGkAtoms::mm,
   &nsGkAtoms::in,
   &nsGkAtoms::pt,
   &nsGkAtoms::pc
 };
 
-static nsSVGAttrTearoffTable<nsSVGLength2, nsSVGLength2::DOMAnimatedLength>
+static nsSVGAttrTearoffTable<nsSVGLength2, SVGAnimatedLength>
   sSVGAnimatedLengthTearoffTable;
 static nsSVGAttrTearoffTable<nsSVGLength2, nsSVGLength2::DOMBaseVal>
   sBaseSVGLengthTearoffTable;
 static nsSVGAttrTearoffTable<nsSVGLength2, nsSVGLength2::DOMAnimVal>
   sAnimSVGLengthTearoffTable;
 
 /* Helper functions */
 
@@ -486,30 +474,30 @@ nsSVGLength2::SetAnimValue(float aValue,
 nsresult
 nsSVGLength2::ToDOMAnimatedLength(nsIDOMSVGAnimatedLength **aResult,
                                   nsSVGElement *aSVGElement)
 {
   *aResult = ToDOMAnimatedLength(aSVGElement).get();
   return NS_OK;
 }
 
-already_AddRefed<nsIDOMSVGAnimatedLength>
+already_AddRefed<SVGAnimatedLength>
 nsSVGLength2::ToDOMAnimatedLength(nsSVGElement* aSVGElement)
 {
-  nsRefPtr<DOMAnimatedLength> domAnimatedLength =
+  nsRefPtr<SVGAnimatedLength> svgAnimatedLength =
     sSVGAnimatedLengthTearoffTable.GetTearoff(this);
-  if (!domAnimatedLength) {
-    domAnimatedLength = new DOMAnimatedLength(this, aSVGElement);
-    sSVGAnimatedLengthTearoffTable.AddTearoff(this, domAnimatedLength);
+  if (!svgAnimatedLength) {
+    svgAnimatedLength = new SVGAnimatedLength(this, aSVGElement);
+    sSVGAnimatedLengthTearoffTable.AddTearoff(this, svgAnimatedLength);
   }
 
-  return domAnimatedLength.forget();
+  return svgAnimatedLength.forget();
 }
 
-nsSVGLength2::DOMAnimatedLength::~DOMAnimatedLength()
+SVGAnimatedLength::~SVGAnimatedLength()
 {
   sSVGAnimatedLengthTearoffTable.RemoveTearoff(mVal);
 }
 
 nsISMILAttr*
 nsSVGLength2::ToSMILAttr(nsSVGElement *aSVGElement)
 {
   return new SMILLength(this, aSVGElement);
--- a/content/svg/content/src/nsSVGLength2.h
+++ b/content/svg/content/src/nsSVGLength2.h
@@ -18,23 +18,24 @@
 #include "SVGContentUtils.h"
 
 class nsIFrame;
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 namespace mozilla {
 namespace dom {
+class SVGAnimatedLength;
 class SVGSVGElement;
 }
 }
 
 class nsSVGLength2
 {
-
+  friend class mozilla::dom::SVGAnimatedLength;
 public:
   void Init(uint8_t aCtxType = SVGContentUtils::XY,
             uint8_t aAttrEnum = 0xff,
             float aValue = 0,
             uint8_t aUnitType = nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER) {
     mAnimVal = mBaseVal = aValue;
     mSpecifiedUnitType = aUnitType;
     mAttrEnum = aAttrEnum;
@@ -86,17 +87,17 @@ public:
   // 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 ToDOMAnimatedLength(nsIDOMSVGAnimatedLength **aResult,
                                nsSVGElement* aSVGElement);
 
-  already_AddRefed<nsIDOMSVGAnimatedLength>
+  already_AddRefed<mozilla::dom::SVGAnimatedLength>
   ToDOMAnimatedLength(nsSVGElement* aSVGElement);
 
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 
 private:
   
   float mAnimVal;
@@ -240,35 +241,16 @@ public:
     NS_IMETHOD NewValueSpecifiedUnits(uint16_t unitType,
                                       float valueInSpecifiedUnits)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
 
     NS_IMETHOD ConvertToSpecifiedUnits(uint16_t unitType)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
-  struct DOMAnimatedLength : public nsIDOMSVGAnimatedLength
-  {
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedLength)
-
-    DOMAnimatedLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
-      : mVal(aVal), mSVGElement(aSVGElement) {}
-    virtual ~DOMAnimatedLength();
-    
-    nsSVGLength2* mVal; // kept alive because it belongs to content
-    nsRefPtr<nsSVGElement> mSVGElement;
-
-    NS_IMETHOD GetBaseVal(nsIDOMSVGLength **aBaseVal)
-      { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); }
-
-    NS_IMETHOD GetAnimVal(nsIDOMSVGLength **aAnimVal)
-      { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); }
-  };
-
   struct SMILLength : public nsISMILAttr
   {
   public:
     SMILLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     // These will stay alive because a nsISMILAttr only lives as long
     // as the Compositing step, and DOM elements don't get a chance to
new file mode 100644
--- /dev/null
+++ b/dom/webidl/SVGAnimatedLength.webidl
@@ -0,0 +1,21 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * http://www.w3.org/TR/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface SVGLength;
+
+interface SVGAnimatedLength {
+  [Constant]
+  readonly attribute SVGLength baseVal;
+  [Constant]
+  readonly attribute SVGLength animVal;
+};
+
--- a/dom/webidl/SVGCircleElement.webidl
+++ b/dom/webidl/SVGCircleElement.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 SVGAnimatedLength;
-
 interface SVGCircleElement : SVGGraphicsElement {
   [Constant]
   readonly attribute SVGAnimatedLength cx;
   [Constant]
   readonly attribute SVGAnimatedLength cy;
   [Constant]
   readonly attribute SVGAnimatedLength r;
 };
--- a/dom/webidl/SVGEllipseElement.webidl
+++ b/dom/webidl/SVGEllipseElement.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 SVGAnimatedLength;
-
 interface SVGEllipseElement : SVGGraphicsElement {
   [Constant]
   readonly attribute SVGAnimatedLength cx;
   [Constant]
   readonly attribute SVGAnimatedLength cy;
   [Constant]
   readonly attribute SVGAnimatedLength rx;
   [Constant]
--- a/dom/webidl/SVGForeignObjectElement.webidl
+++ b/dom/webidl/SVGForeignObjectElement.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 SVGAnimatedLength;
-
 interface SVGForeignObjectElement : SVGGraphicsElement {
   [Constant]
   readonly attribute SVGAnimatedLength x;
   [Constant]
   readonly attribute SVGAnimatedLength y;
   [Constant]
   readonly attribute SVGAnimatedLength width;
   [Constant]
--- a/dom/webidl/SVGLineElement.webidl
+++ b/dom/webidl/SVGLineElement.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 SVGAnimatedLength;
-
 interface SVGLineElement : SVGGraphicsElement {
   [Constant]
   readonly attribute SVGAnimatedLength x1;
   [Constant]
   readonly attribute SVGAnimatedLength y1;
   [Constant]
   readonly attribute SVGAnimatedLength x2;
   [Constant]
--- a/dom/webidl/SVGPatternElement.webidl
+++ b/dom/webidl/SVGPatternElement.webidl
@@ -6,17 +6,16 @@
  * The origin of this IDL file is
  * http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGPatternElement
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface SVGAnimatedEnumeration;
-interface SVGAnimatedLength;
 
 interface SVGPatternElement : SVGElement {
   [Constant]
   readonly attribute SVGAnimatedEnumeration patternUnits;
   [Constant]
   readonly attribute SVGAnimatedEnumeration patternContentUnits;
   [Constant]
   readonly attribute SVGAnimatedTransformList patternTransform;
--- a/dom/webidl/SVGRectElement.webidl
+++ b/dom/webidl/SVGRectElement.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 SVGAnimatedLength;
-
 interface SVGRectElement : SVGGraphicsElement {
   [Constant]
   readonly attribute SVGAnimatedLength x;
   [Constant]
   readonly attribute SVGAnimatedLength y;
   [Constant]
   readonly attribute SVGAnimatedLength width;
   [Constant]
--- a/dom/webidl/SVGSVGElement.webidl
+++ b/dom/webidl/SVGSVGElement.webidl
@@ -6,17 +6,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 SVGAnimatedString;
-interface SVGAnimatedLength;
 interface SVGViewSpec;
 interface SVGPoint;
 interface SVGRect;
 
 interface SVGSVGElement : SVGGraphicsElement {
 
   readonly attribute SVGAnimatedLength x;
   readonly attribute SVGAnimatedLength y;
--- a/dom/webidl/SVGTextPathElement.webidl
+++ b/dom/webidl/SVGTextPathElement.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 SVGAnimatedLength;
 interface SVGAnimatedEnumeration;
 
 interface SVGTextPathElement : SVGTextContentElement {
 
   // textPath Method Types
   const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0;
   const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1;
   const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2;
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -98,16 +98,17 @@ webidl_files = \
   Rect.webidl \
   RGBColor.webidl \
   Screen.webidl \
   SVGAElement.webidl \
   SVGAltGlyphElement.webidl \
   SVGAngle.webidl \
   SVGAnimatedAngle.webidl \
   SVGAnimatedBoolean.webidl \
+  SVGAnimatedLength.webidl \
   SVGAnimatedLengthList.webidl \
   SVGAnimatedNumberList.webidl \
   SVGAnimatedPathData.webidl \
   SVGAnimatedPoints.webidl \
   SVGAnimatedPreserveAspectRatio.webidl \
   SVGAnimatedTransformList.webidl \
   SVGAnimateElement.webidl \
   SVGAnimateMotionElement.webidl \