Bug 817442 Part 5: Remove nsIDOMSVG(Animated)Angle r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 22 Dec 2012 23:54:23 -0500
changeset 126033 f76cba2067065290851a3faf06ffa06ce353fcd1
parent 126032 19990126a4847b8e5ddac44f0395aae6a1f8cc7e
child 126034 822291ecc6955418f661303583cbce7733f89862
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs817442
milestone20.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 817442 Part 5: Remove nsIDOMSVG(Animated)Angle r=bz
content/svg/content/src/SVGAngle.cpp
content/svg/content/src/SVGAngle.h
content/svg/content/src/SVGAnimatedAngle.cpp
content/svg/content/src/SVGAnimatedAngle.h
content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
content/svg/content/src/SVGMotionSMILType.cpp
content/svg/content/src/SVGOrientSMILType.cpp
content/svg/content/src/nsSVGAngle.cpp
content/svg/content/src/nsSVGAngle.h
content/svg/content/src/nsSVGMarkerElement.cpp
content/svg/content/src/nsSVGSVGElement.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGAngle.idl
dom/interfaces/svg/nsIDOMSVGAnimatedAngle.idl
dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
dom/interfaces/svg/nsIDOMSVGSVGElement.idl
--- a/content/svg/content/src/SVGAngle.cpp
+++ b/content/svg/content/src/SVGAngle.cpp
@@ -10,23 +10,20 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAngle, mSVGElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAngle)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAngle)
 
-DOMCI_DATA(SVGAngle, SVGAngle)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAngle)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAngle)
+  NS_INTERFACE_MAP_ENTRY(SVGAngle)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAngle)
 NS_INTERFACE_MAP_END
 
 JSObject*
 SVGAngle::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
 {
   return SVGAngleBinding::Wrap(aCx, aScope, this, aTriedToWrap);
 }
 
@@ -76,46 +73,29 @@ SVGAngle::SetValueInSpecifiedUnits(float
     return;
   } else if (mType == BaseValue) {
     mVal->SetBaseValueInSpecifiedUnits(aValue, mSVGElement);
   } else {
     mVal->mBaseVal = aValue;
   }
 }
 
-NS_IMETHODIMP
-SVGAngle::NewValueSpecifiedUnits(uint16_t unitType,
-                                 float valueInSpecifiedUnits)
-{
-  ErrorResult rv;
-  NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits, rv);
-  return rv.ErrorCode();
-}
-
 void
 SVGAngle::NewValueSpecifiedUnits(uint16_t unitType,
                                  float valueInSpecifiedUnits,
                                  ErrorResult& rv)
 {
   if (mType == AnimValue) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
   rv = mVal->NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits,
                                     mType == BaseValue ? mSVGElement : nullptr);
 }
 
-NS_IMETHODIMP
-SVGAngle::ConvertToSpecifiedUnits(uint16_t unitType)
-{
-  ErrorResult rv;
-  ConvertToSpecifiedUnits(unitType, rv);
-  return rv.ErrorCode();
-}
-
 void
 SVGAngle::ConvertToSpecifiedUnits(uint16_t unitType, ErrorResult& rv)
 {
   if (mType == AnimValue) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
   rv = mVal->ConvertToSpecifiedUnits(unitType, mType == BaseValue ? mSVGElement : nullptr);
@@ -127,19 +107,18 @@ SVGAngle::SetValueAsString(const nsAStri
   if (mType == AnimValue) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
   bool isBaseVal = mType == BaseValue;
   rv = mVal->SetBaseValueString(aValue, isBaseVal ? mSVGElement : nullptr, isBaseVal);
 }
 
-NS_IMETHODIMP
+void
 SVGAngle::GetValueAsString(nsAString& aValue)
 {
   if (mType == AnimValue) {
     mVal->GetAnimValueString(aValue);
   } else {
     mVal->GetBaseValueString(aValue);
   }
-  return NS_OK;
 }
 
--- a/content/svg/content/src/SVGAngle.h
+++ b/content/svg/content/src/SVGAngle.h
@@ -1,77 +1,72 @@
 /* -*- 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/. */
 
 #pragma once
 
-#include "nsIDOMSVGAngle.h"
 #include "nsWrapperCache.h"
 #include "nsSVGElement.h"
 #include "mozilla/Attributes.h"
 
 class nsSVGAngle;
 
+// We make SVGAngle a pseudo-interface to allow us to QI to it in order
+// to check that the objects that scripts pass in are our our *native*
+// transform objects.
+
+// {da9670f6-6d3d-4fb3-974c-9d6bad8dcd53}
+#define MOZILLA_SVGANGLE_IID \
+{0x2cd27ef5, 0x81d8, 0x4720, \
+  {0x81, 0x42, 0x66, 0xc6, 0xa9, 0xbe, 0xc3, 0xeb } }
+
+
 namespace mozilla {
 namespace dom {
 
-class SVGAngle MOZ_FINAL : public nsIDOMSVGAngle,
+class SVGAngle MOZ_FINAL : public nsISupports,
                            public nsWrapperCache
 {
 public:
   typedef enum {
     BaseValue,
     AnimValue,
     CreatedValue
   } AngleType;
 
+  NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_SVGANGLE_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAngle)
 
   SVGAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement, AngleType aType)
     : mVal(aVal), mSVGElement(aSVGElement), mType(aType)
   {
     SetIsDOMBinding();
   }
 
   ~SVGAngle();
 
-  NS_IMETHOD GetUnitType(uint16_t* aResult)
-    { *aResult = UnitType(); return NS_OK; }
-
-  NS_IMETHOD GetValue(float* aResult)
-    { *aResult = Value(); return NS_OK; }
-  NS_IMETHOD SetValue(float aValue)
-    { ErrorResult rv; SetValue(aValue, rv); return rv.ErrorCode(); }
-  NS_IMETHOD GetValueInSpecifiedUnits(float* aResult)
-    { *aResult = ValueInSpecifiedUnits(); return NS_OK; }
-  NS_IMETHOD SetValueInSpecifiedUnits(float aValue)
-    { ErrorResult rv; SetValueInSpecifiedUnits(aValue, rv); return rv.ErrorCode(); }
-  NS_IMETHOD SetValueAsString(const nsAString& aValue)
-    { ErrorResult rv; SetValueAsString(aValue, rv); return rv.ErrorCode(); }
-  NS_IMETHOD GetValueAsString(nsAString& aValue);
-  NS_IMETHOD NewValueSpecifiedUnits(uint16_t unitType,
-                                    float valueInSpecifiedUnits);
-  NS_IMETHOD ConvertToSpecifiedUnits(uint16_t unitType);
-
   // WebIDL
   nsSVGElement* GetParentObject() { return mSVGElement; }
   virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap);
   uint16_t UnitType() const;
   float Value() const;
+  void GetValueAsString(nsAString& aValue);
   void SetValue(float aValue, ErrorResult& rv);
   float ValueInSpecifiedUnits() const;
   void SetValueInSpecifiedUnits(float aValue, ErrorResult& rv);
   void SetValueAsString(const nsAString& aValue, ErrorResult& rv);
   void NewValueSpecifiedUnits(uint16_t unitType, float value, ErrorResult& rv);
   void ConvertToSpecifiedUnits(uint16_t unitType, ErrorResult& rv);
 
 protected:
   nsSVGAngle* mVal; // if mType is CreatedValue, we own the angle.  Otherwise, the element does.
   nsRefPtr<nsSVGElement> mSVGElement;
   AngleType mType;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(SVGAngle, MOZILLA_SVGANGLE_IID)
+
 } //namespace dom
 } //namespace mozilla
 
--- a/content/svg/content/src/SVGAnimatedAngle.cpp
+++ b/content/svg/content/src/SVGAnimatedAngle.cpp
@@ -1,32 +1,29 @@
 /* -*- 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 "SVGAnimatedAngle.h"
+#include "SVGAngle.h"
 #include "nsSVGAngle.h"
 #include "mozilla/dom/SVGAnimatedAngleBinding.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedAngle, mSVGElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedAngle)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedAngle)
 
-DOMCI_DATA(SVGAnimatedAngle, SVGAnimatedAngle)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedAngle)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedAngle)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedAngle)
 NS_INTERFACE_MAP_END
 
 JSObject*
 SVGAnimatedAngle::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
 {
   return SVGAnimatedAngleBinding::Wrap(aCx, aScope, this, aTriedToWrap);
 }
 
--- a/content/svg/content/src/SVGAnimatedAngle.h
+++ b/content/svg/content/src/SVGAnimatedAngle.h
@@ -1,44 +1,43 @@
 /* -*- 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/. */
 
 #pragma once
 
-#include "nsIDOMSVGAnimatedAngle.h"
 #include "nsWrapperCache.h"
 #include "nsSVGElement.h"
 #include "SVGAngle.h"
 #include "mozilla/Attributes.h"
 
 class nsSVGAngle;
 
 namespace mozilla {
 namespace dom {
 
-class SVGAnimatedAngle MOZ_FINAL : public nsIDOMSVGAnimatedAngle,
+class SVGAnimatedAngle MOZ_FINAL : public nsISupports,
                                    public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedAngle)
 
   SVGAnimatedAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
     : mVal(aVal), mSVGElement(aSVGElement)
   {
     SetIsDOMBinding();
   }
   ~SVGAnimatedAngle();
 
-  NS_IMETHOD GetBaseVal(nsIDOMSVGAngle **aBaseVal)
+  NS_IMETHOD GetBaseVal(nsISupports **aBaseVal)
     { *aBaseVal = BaseVal().get(); return NS_OK; }
 
-  NS_IMETHOD GetAnimVal(nsIDOMSVGAngle **aAnimVal)
+  NS_IMETHOD GetAnimVal(nsISupports **aAnimVal)
     { *aAnimVal = AnimVal().get(); return NS_OK; }
 
   // WebIDL
   nsSVGElement* GetParentObject() { return mSVGElement; }
   virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap);
   already_AddRefed<SVGAngle> BaseVal();
   already_AddRefed<SVGAngle> AnimVal();
 
--- a/content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
+++ b/content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
@@ -445,19 +445,19 @@ SVGMotionSMILAnimationFunction::SetRotat
       // XXX report to console?
       return rv;
     }
 
     mRotateAngle = svgAngle.GetBaseValInSpecifiedUnits();
 
     // Convert to radian units, if we're not already in radians.
     uint8_t angleUnit = svgAngle.GetBaseValueUnit();
-    if (angleUnit != nsIDOMSVGAngle::SVG_ANGLETYPE_RAD) {
+    if (angleUnit != SVG_ANGLETYPE_RAD) {
       mRotateAngle *= nsSVGAngle::GetDegreesPerUnit(angleUnit) /
-        nsSVGAngle::GetDegreesPerUnit(nsIDOMSVGAngle::SVG_ANGLETYPE_RAD);
+        nsSVGAngle::GetDegreesPerUnit(SVG_ANGLETYPE_RAD);
     }
   }
   return NS_OK;
 }
 
 void
 SVGMotionSMILAnimationFunction::UnsetRotate()
 {
--- a/content/svg/content/src/SVGMotionSMILType.cpp
+++ b/content/svg/content/src/SVGMotionSMILType.cpp
@@ -3,18 +3,16 @@
  * 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/. */
 
 /* implementation of nsISMILType for use by <animateMotion> element */
 
 #include "SVGMotionSMILType.h"
 #include "nsSMILValue.h"
 #include "nsDebug.h"
-#include "nsSVGAngle.h"
-#include "nsIDOMSVGAngle.h"
 #include "nsSVGPathElement.h"
 #include "nsMathUtils.h"
 #include <math.h>
 
 namespace mozilla {
 
 /*static*/ SVGMotionSMILType SVGMotionSMILType::sSingleton;
 
--- a/content/svg/content/src/SVGOrientSMILType.cpp
+++ b/content/svg/content/src/SVGOrientSMILType.cpp
@@ -16,17 +16,17 @@ namespace mozilla {
 /*static*/ SVGOrientSMILType SVGOrientSMILType::sSingleton;
 
 void
 SVGOrientSMILType::Init(nsSMILValue& aValue) const
 {
   NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected value type");
 
   aValue.mU.mOrient.mAngle = 0.0f;
-  aValue.mU.mOrient.mUnit = nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
+  aValue.mU.mOrient.mUnit = SVG_ANGLETYPE_UNSPECIFIED;
   aValue.mU.mOrient.mOrientType = nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_ANGLE;
   aValue.mType = this;
 }
 
 void
 SVGOrientSMILType::Destroy(nsSMILValue& aValue) const
 {
   NS_PRECONDITION(aValue.mType == this, "Unexpected SMIL value.");
--- a/content/svg/content/src/nsSVGAngle.cpp
+++ b/content/svg/content/src/nsSVGAngle.cpp
@@ -38,18 +38,18 @@ static nsSVGAttrTearoffTable<nsSVGAngle,
 static nsSVGAttrTearoffTable<nsSVGAngle, SVGAngle>
   sAnimSVGAngleTearoffTable;
 
 /* Helper functions */
 
 static bool
 IsValidUnitType(uint16_t unit)
 {
-  if (unit > nsIDOMSVGAngle::SVG_ANGLETYPE_UNKNOWN &&
-      unit <= nsIDOMSVGAngle::SVG_ANGLETYPE_GRAD)
+  if (unit > SVG_ANGLETYPE_UNKNOWN &&
+      unit <= SVG_ANGLETYPE_GRAD)
     return true;
 
   return false;
 }
 
 static void 
 GetUnitString(nsAString& unit, uint16_t unitType)
 {
@@ -63,29 +63,29 @@ GetUnitString(nsAString& unit, uint16_t 
   NS_NOTREACHED("Unknown unit type");
   return;
 }
 
 static uint16_t
 GetUnitTypeForString(const nsAString& unitStr)
 {
   if (unitStr.IsEmpty()) 
-    return nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
+    return SVG_ANGLETYPE_UNSPECIFIED;
                    
   nsIAtom *unitAtom = NS_GetStaticAtom(unitStr);
 
   if (unitAtom) {
     for (uint32_t i = 0 ; i < ArrayLength(unitMap) ; i++) {
       if (unitMap[i] && *unitMap[i] == unitAtom) {
         return i;
       }
     }
   }
 
-  return nsIDOMSVGAngle::SVG_ANGLETYPE_UNKNOWN;
+  return SVG_ANGLETYPE_UNKNOWN;
 }
 
 static void
 GetValueString(nsAString &aValueAsString, float aValue, uint16_t aUnitType)
 {
   PRUnichar buf[24];
   nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
                             NS_LITERAL_STRING("%g").get(),
@@ -120,22 +120,22 @@ GetValueFromString(const nsAString &aVal
   
   return NS_ERROR_DOM_SYNTAX_ERR;
 }
 
 /* static */ float
 nsSVGAngle::GetDegreesPerUnit(uint8_t aUnit)
 {
   switch (aUnit) {
-  case nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED:
-  case nsIDOMSVGAngle::SVG_ANGLETYPE_DEG:
+  case SVG_ANGLETYPE_UNSPECIFIED:
+  case SVG_ANGLETYPE_DEG:
     return 1;
-  case nsIDOMSVGAngle::SVG_ANGLETYPE_RAD:
+  case SVG_ANGLETYPE_RAD:
     return static_cast<float>(180.0 / M_PI);
-  case nsIDOMSVGAngle::SVG_ANGLETYPE_GRAD:
+  case SVG_ANGLETYPE_GRAD:
     return 90.0f / 100.0f;
   default:
     NS_NOTREACHED("Unknown unit type");
     return 0;
   }
 }
 
 void
@@ -338,17 +338,17 @@ nsSVGAngle::SetAnimValue(float aValue, u
   }
   mAnimVal = aValue;
   mAnimValUnit = aUnit;
   mIsAnimated = true;
   aSVGElement->DidAnimateAngle(mAttrEnum);
 }
 
 nsresult
-nsSVGAngle::ToDOMAnimatedAngle(nsIDOMSVGAnimatedAngle **aResult,
+nsSVGAngle::ToDOMAnimatedAngle(nsISupports **aResult,
                                nsSVGElement *aSVGElement)
 {
   nsRefPtr<SVGAnimatedAngle> domAnimatedAngle =
     sSVGAnimatedAngleTearoffTable.GetTearoff(this);
   if (!domAnimatedAngle) {
     domAnimatedAngle = new SVGAnimatedAngle(this, aSVGElement);
     sSVGAnimatedAngleTearoffTable.AddTearoff(this, domAnimatedAngle);
   }
@@ -427,15 +427,15 @@ nsresult
 nsSVGAngle::SMILOrient::SetAnimValue(const nsSMILValue& aValue)
 {
   NS_ASSERTION(aValue.mType == &SVGOrientSMILType::sSingleton,
                "Unexpected type to assign animated value");
 
   if (aValue.mType == &SVGOrientSMILType::sSingleton) {
     mOrientType->SetAnimValue(aValue.mU.mOrient.mOrientType);
     if (aValue.mU.mOrient.mOrientType == nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_AUTO) {
-      mAngle->SetAnimValue(0.0f, nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED, mSVGElement);
+      mAngle->SetAnimValue(0.0f, SVG_ANGLETYPE_UNSPECIFIED, mSVGElement);
     } else {
       mAngle->SetAnimValue(aValue.mU.mOrient.mAngle, aValue.mU.mOrient.mUnit, mSVGElement);
     }
   }
   return NS_OK;
 }
--- a/content/svg/content/src/nsSVGAngle.h
+++ b/content/svg/content/src/nsSVGAngle.h
@@ -4,43 +4,49 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGANGLE_H__
 #define __NS_SVGANGLE_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
-#include "nsIDOMSVGAngle.h"
-#include "nsIDOMSVGAnimatedAngle.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
 #include "nsWrapperCache.h"
 #include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 class nsSVGOrientType;
 
 namespace mozilla {
+
+// Angle Unit Types
+static const unsigned short SVG_ANGLETYPE_UNKNOWN     = 0;
+static const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1;
+static const unsigned short SVG_ANGLETYPE_DEG         = 2;
+static const unsigned short SVG_ANGLETYPE_RAD         = 3;
+static const unsigned short SVG_ANGLETYPE_GRAD        = 4;
+
 namespace dom {
 class SVGAngle;
 class SVGAnimatedAngle;
 }
 }
 
 class nsSVGAngle
 {
   friend class mozilla::dom::SVGAngle;
   friend class mozilla::dom::SVGAnimatedAngle;
 
 public:
   void Init(uint8_t aAttrEnum = 0xff,
             float aValue = 0,
-            uint8_t aUnitType = nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED) {
+            uint8_t aUnitType = mozilla::SVG_ANGLETYPE_UNSPECIFIED) {
     mAnimVal = mBaseVal = aValue;
     mAnimValUnit = mBaseValUnit = aUnitType;
     mAttrEnum = aAttrEnum;
     mIsAnimated = false;
   }
 
   nsresult SetBaseValueString(const nsAString& aValue,
                               nsSVGElement *aSVGElement,
@@ -56,18 +62,18 @@ public:
   void SetBaseValue(float aValue, nsSVGElement *aSVGElement, bool aDoSetAttr);
   void SetAnimValue(float aValue, uint8_t aUnit, nsSVGElement *aSVGElement);
 
   uint8_t GetBaseValueUnit() const { return mBaseValUnit; }
   uint8_t GetAnimValueUnit() const { return mAnimValUnit; }
   float GetBaseValInSpecifiedUnits() const { return mBaseVal; }
   float GetAnimValInSpecifiedUnits() const { return mAnimVal; }
 
-  static nsresult ToDOMSVGAngle(nsIDOMSVGAngle **aResult);
-  nsresult ToDOMAnimatedAngle(nsIDOMSVGAnimatedAngle **aResult,
+  static nsresult ToDOMSVGAngle(nsISupports **aResult);
+  nsresult ToDOMAnimatedAngle(nsISupports **aResult,
                               nsSVGElement* aSVGElement);
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 
   static float GetDegreesPerUnit(uint8_t aUnit);
 
 private:
 
--- a/content/svg/content/src/nsSVGMarkerElement.cpp
+++ b/content/svg/content/src/nsSVGMarkerElement.cpp
@@ -8,16 +8,17 @@
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 #include "nsError.h"
 #include "nsSVGMarkerElement.h"
 #include "gfxMatrix.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 #include "SVGContentUtils.h"
+#include "SVGAngle.h"
 
 using namespace mozilla;
 
 nsSVGElement::LengthInfo nsSVGMarkerElement::sLengthInfo[4] =
 {
   { &nsGkAtoms::refX, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
   { &nsGkAtoms::refY, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
   { &nsGkAtoms::markerWidth, 3, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
@@ -35,17 +36,17 @@ nsSVGElement::EnumInfo nsSVGMarkerElemen
   { &nsGkAtoms::markerUnits,
     sUnitsMap,
     nsIDOMSVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH
   }
 };
 
 nsSVGElement::AngleInfo nsSVGMarkerElement::sAngleInfo[1] =
 {
-  { &nsGkAtoms::orient, 0, nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED }
+  { &nsGkAtoms::orient, 0, SVG_ANGLETYPE_UNSPECIFIED }
 };
 
 NS_IMPL_NS_NEW_SVG_ELEMENT(Marker)
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum, mSVGElement)
@@ -164,39 +165,38 @@ NS_IMETHODIMP nsSVGMarkerElement::GetMar
 }
 
 /* readonly attribute nsIDOMSVGAnimatedEnumeration orientType; */
 NS_IMETHODIMP nsSVGMarkerElement::GetOrientType(nsIDOMSVGAnimatedEnumeration * *aOrientType)
 {
   return mOrientType.ToDOMAnimatedEnum(aOrientType, this);
 }
 
-/* readonly attribute nsIDOMSVGAnimatedLength orientAngle; */
-NS_IMETHODIMP nsSVGMarkerElement::GetOrientAngle(nsIDOMSVGAnimatedAngle * *aOrientAngle)
+/* readonly attribute SVGAnimatedAngle orientAngle; */
+NS_IMETHODIMP nsSVGMarkerElement::GetOrientAngle(nsISupports * *aOrientAngle)
 {
   return mAngleAttributes[ORIENT].ToDOMAnimatedAngle(aOrientAngle, this);
 }
 
 /* void setOrientToAuto (); */
 NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAuto()
 {
   SetAttr(kNameSpaceID_None, nsGkAtoms::orient, nullptr,
           NS_LITERAL_STRING("auto"), true);
   return NS_OK;
 }
 
-/* void setOrientToAngle (in nsIDOMSVGAngle angle); */
-NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAngle(nsIDOMSVGAngle *angle)
+/* void setOrientToAngle (in SVGAngle angle); */
+NS_IMETHODIMP nsSVGMarkerElement::SetOrientToAngle(nsISupports *aAngle)
 {
+  nsCOMPtr<dom::SVGAngle> angle = do_QueryInterface(aAngle);
   if (!angle)
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
 
-  float f;
-  nsresult rv = angle->GetValue(&f);
-  NS_ENSURE_SUCCESS(rv, rv);
+  float f = angle->Value();
   NS_ENSURE_FINITE(f, NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
   mAngleAttributes[ORIENT].SetBaseValue(f, this, true);
 
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // nsIContent methods
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -557,19 +557,19 @@ nsSVGSVGElement::CreateSVGNumber(nsIDOMS
 /* nsIDOMSVGLength createSVGLength (); */
 NS_IMETHODIMP
 nsSVGSVGElement::CreateSVGLength(nsIDOMSVGLength **_retval)
 {
   NS_ADDREF(*_retval = new DOMSVGLength());
   return NS_OK;
 }
 
-/* nsIDOMSVGAngle createSVGAngle (); */
+/* SVGAngle createSVGAngle (); */
 NS_IMETHODIMP
-nsSVGSVGElement::CreateSVGAngle(nsIDOMSVGAngle **_retval)
+nsSVGSVGElement::CreateSVGAngle(nsISupports **_retval)
 {
   nsSVGAngle* angle = new nsSVGAngle();
   angle->Init();
   NS_ADDREF(*_retval = new SVGAngle(angle, this, SVGAngle::CreatedValue));
   return NS_OK;
 }
 
 /* nsIDOMSVGPoint createSVGPoint (); */
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -307,18 +307,16 @@
 #include "nsIDOMNSXPathExpression.h"
 #include "nsIDOMXPathNSResolver.h"
 #include "nsIDOMXPathResult.h"
 #include "nsIDOMMozBrowserFrame.h"
 
 #include "nsIDOMGetSVGDocument.h"
 #include "nsIDOMSVGAElement.h"
 #include "nsIDOMSVGAltGlyphElement.h"
-#include "nsIDOMSVGAngle.h"
-#include "nsIDOMSVGAnimatedAngle.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 #include "nsIDOMSVGAnimatedInteger.h"
 #include "nsIDOMSVGAnimatedLength.h"
 #include "nsIDOMSVGAnimatedLengthList.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsIDOMSVGAnimatedNumberList.h"
 #include "nsIDOMSVGAnimatedPathData.h"
 #include "nsIDOMSVGAnimatedPoints.h"
@@ -1217,20 +1215,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA_WITH_NAME(SVGUnknownElement, SVGElement, nsElementSH,
                                      ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGUseElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGViewElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
 
   // other SVG classes
-  NS_DEFINE_CLASSINFO_DATA(SVGAngle, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGAnimatedAngle, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedEnumeration, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedInteger, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedLength, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedLengthList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -3490,25 +3484,16 @@ nsDOMClassInfo::Init()
 
   DOM_CLASSINFO_MAP_BEGIN(SVGViewElement, nsIDOMSVGViewElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGZoomAndPan)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   // other SVG classes
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGAngle, nsIDOMSVGAngle)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAngle)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedAngle, nsIDOMSVGAnimatedAngle)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedAngle)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedEnumeration, nsIDOMSVGAnimatedEnumeration)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedInteger, nsIDOMSVGAnimatedInteger)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -250,18 +250,16 @@ DOMCI_CLASS(SVGTextElement)
 DOMCI_CLASS(SVGTextPathElement)
 DOMCI_CLASS(SVGTitleElement)
 DOMCI_CLASS(SVGTSpanElement)
 DOMCI_CLASS(SVGUnknownElement)
 DOMCI_CLASS(SVGUseElement)
 DOMCI_CLASS(SVGViewElement)
 
 // other SVG classes
-DOMCI_CLASS(SVGAngle)
-DOMCI_CLASS(SVGAnimatedAngle)
 DOMCI_CLASS(SVGAnimatedEnumeration)
 DOMCI_CLASS(SVGAnimatedInteger)
 DOMCI_CLASS(SVGAnimatedLength)
 DOMCI_CLASS(SVGAnimatedLengthList)
 DOMCI_CLASS(SVGAnimatedNumber)
 DOMCI_CLASS(SVGAnimatedNumberList)
 DOMCI_CLASS(SVGAnimatedRect)
 DOMCI_CLASS(SVGAnimatedString)
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -14,18 +14,16 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 XPIDL_MODULE	= dom_svg
 
 XPIDLSRCS	= \
 		nsIDOMGetSVGDocument.idl \
 		nsIDOMSVGAElement.idl \
 		nsIDOMSVGAltGlyphElement.idl \
-		nsIDOMSVGAngle.idl \
-		nsIDOMSVGAnimatedAngle.idl \
 		nsIDOMSVGAnimatedEnum.idl \
 		nsIDOMSVGAnimatedInteger.idl \
 		nsIDOMSVGAnimatedLength.idl \
 		nsIDOMSVGAnimatedLengthList.idl \
 		nsIDOMSVGAnimatedNumber.idl \
 		nsIDOMSVGAnimatedNumberList.idl \
 		nsIDOMSVGAnimatedPathData.idl \
 		nsIDOMSVGAnimatedPoints.idl \
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGAngle.idl
+++ /dev/null
@@ -1,37 +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 nsIDOMSVGAngle interface is the interface to an SVG angle.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAngle
- *
- */
-
-[scriptable, uuid(58b6190e-37b3-412a-ba02-1d5ad6c6ea7c)]
-interface nsIDOMSVGAngle : nsISupports
-{
-  // Angle Unit Types
-  const unsigned short SVG_ANGLETYPE_UNKNOWN     = 0;
-  const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1;
-  const unsigned short SVG_ANGLETYPE_DEG         = 2;
-  const unsigned short SVG_ANGLETYPE_RAD         = 3;
-  const unsigned short SVG_ANGLETYPE_GRAD        = 4;
-
-  readonly attribute unsigned short unitType;
-  attribute float value;
-  // raises DOMException on setting
-  attribute float valueInSpecifiedUnits;
-  // raises DOMException on setting
-  attribute DOMString valueAsString;
-  // raises DOMException on setting
-
-  void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits);
-  void convertToSpecifiedUnits(in unsigned short unitType);
-};
-  
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGAnimatedAngle.idl
+++ /dev/null
@@ -1,24 +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"
-
-interface nsIDOMSVGAngle;
-
-/**
- * The nsIDOMSVGAnimatedAngle interface is the interface to an SVG
- * animated angle.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedAngle
- *
- */
-
-[scriptable, uuid(c6ab8b9e-32db-464a-ae33-8691d44bc60a)]
-interface nsIDOMSVGAnimatedAngle : nsISupports
-{
-  readonly attribute nsIDOMSVGAngle baseVal;
-  readonly attribute nsIDOMSVGAngle animVal;
-};
--- a/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
@@ -2,18 +2,16 @@
 /* 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 "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
-interface nsIDOMSVGAngle;
-interface nsIDOMSVGAnimatedAngle;
 interface nsIDOMSVGAnimatedRect;
 interface nsIDOMSVGMatrix;
 
 /**
  * The nsIDOMSVGMarker interface is the interface to an SVG marker element.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/painting.html#InterfaceSVGMarkerElement
@@ -47,13 +45,13 @@ interface nsIDOMSVGMarkerElement
   const unsigned short SVG_MARKER_ORIENT_ANGLE        = 2;
 
   readonly attribute nsIDOMSVGAnimatedLength      refX;
   readonly attribute nsIDOMSVGAnimatedLength      refY;
   readonly attribute nsIDOMSVGAnimatedEnumeration markerUnits;
   readonly attribute nsIDOMSVGAnimatedLength      markerWidth;
   readonly attribute nsIDOMSVGAnimatedLength      markerHeight;
   readonly attribute nsIDOMSVGAnimatedEnumeration orientType;
-  readonly attribute nsIDOMSVGAnimatedAngle       orientAngle;
+  readonly attribute nsISupports                  orientAngle;
 
   void setOrientToAuto ( );
-  void setOrientToAngle ( in nsIDOMSVGAngle angle );
+  void setOrientToAngle ( in nsISupports angle );
 };
--- a/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
@@ -6,17 +6,16 @@
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGRect;
 interface nsIDOMSVGViewSpec;
 interface nsIDOMSVGPoint;
 interface nsIDOMSVGNumber;
 interface nsIDOMSVGLength;
-interface nsIDOMSVGAngle;
 interface nsIDOMSVGMatrix;
 interface nsIDOMSVGTransform;
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
@@ -71,16 +70,17 @@ interface nsIDOMSVGSVGElement
   nsIDOMNodeList getIntersectionList(in nsIDOMSVGRect rect,
                                      in nsIDOMSVGElement referenceElement);
   nsIDOMNodeList getEnclosureList(in nsIDOMSVGRect rect, in nsIDOMSVGElement referenceElement);
   boolean       checkIntersection(in nsIDOMSVGElement element, in nsIDOMSVGRect rect);
   boolean       checkEnclosure(in nsIDOMSVGElement element, in nsIDOMSVGRect rect);
   void          deSelectAll();
   nsIDOMSVGNumber       createSVGNumber();
   nsIDOMSVGLength       createSVGLength();
-  nsIDOMSVGAngle        createSVGAngle();
+  // SVGAngle
+  nsISupports           createSVGAngle();
   nsIDOMSVGPoint        createSVGPoint();
   nsIDOMSVGMatrix       createSVGMatrix();
   nsIDOMSVGRect         createSVGRect();
   nsIDOMSVGTransform    createSVGTransform();
   nsIDOMSVGTransform    createSVGTransformFromMatrix(in nsIDOMSVGMatrix matrix);
   nsIDOMElement         getElementById(in DOMString elementId);
 };