Bug 817442 Part 9: Remove nsIDOMSVGMatrix r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 22 Dec 2012 23:54:24 -0500
changeset 126036 29225925d6e4fcec7a48a8f6183b03e4cf1a9f4b
parent 126035 ef22f0b8e4663b87b75104c1f81ce561db6d872a
child 126037 6516c71accd0830ca0ca89a49746d496a9b7de59
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 9: Remove nsIDOMSVGMatrix r=bz
content/svg/content/src/DOMSVGMatrix.cpp
content/svg/content/src/DOMSVGMatrix.h
content/svg/content/src/DOMSVGPoint.cpp
content/svg/content/src/nsSVGGraphicElement.cpp
content/svg/content/src/nsSVGSVGElement.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGLength.idl
dom/interfaces/svg/nsIDOMSVGLocatable.idl
dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
dom/interfaces/svg/nsIDOMSVGMatrix.idl
dom/interfaces/svg/nsIDOMSVGPoint.idl
dom/interfaces/svg/nsIDOMSVGSVGElement.idl
--- a/content/svg/content/src/DOMSVGMatrix.cpp
+++ b/content/svg/content/src/DOMSVGMatrix.cpp
@@ -35,385 +35,192 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGMatrix)
 NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGMatrix)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGMatrix)
 
-} // namespace mozilla
-DOMCI_DATA(SVGMatrix, mozilla::DOMSVGMatrix)
-namespace mozilla {
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGMatrix)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(mozilla::DOMSVGMatrix) // pseudo-interface
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGMatrix)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGMatrix)
 NS_INTERFACE_MAP_END
 
 DOMSVGTransform*
 DOMSVGMatrix::GetParentObject() const
 {
   return mTransform;
 }
 
 JSObject*
 DOMSVGMatrix::WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)
 {
   return mozilla::dom::SVGMatrixBinding::Wrap(aCx, aScope, this, aTriedToWrap);
 }
 
-//----------------------------------------------------------------------
-// nsIDOMSVGMatrix methods:
-
-/* attribute float a; */
-NS_IMETHODIMP DOMSVGMatrix::GetA(float *aA)
-{
-  *aA = A();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetA(float aA, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.xx = aA;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetA(float aA)
-{
-  NS_ENSURE_FINITE(aA, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetA(aA, rv);
-  return rv.ErrorCode();
-}
-
-/* attribute float b; */
-NS_IMETHODIMP DOMSVGMatrix::GetB(float *aB)
-{
-  *aB = B();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetB(float aB, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.yx = aB;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetB(float aB)
-{
-  NS_ENSURE_FINITE(aB, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetB(aB, rv);
-  return rv.ErrorCode();
-}
-
-/* attribute float c; */
-NS_IMETHODIMP DOMSVGMatrix::GetC(float *aC)
-{
-  *aC = C();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetC(float aC, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.xy = aC;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetC(float aC)
-{
-  NS_ENSURE_FINITE(aC, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetC(aC, rv);
-  return rv.ErrorCode();
-}
-
-/* attribute float d; */
-NS_IMETHODIMP DOMSVGMatrix::GetD(float *aD)
-{
-  *aD = D();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetD(float aD, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.yy = aD;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetD(float aD)
-{
-  NS_ENSURE_FINITE(aD, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetD(aD, rv);
-  return rv.ErrorCode();
-}
-
-/* attribute float e; */
-NS_IMETHODIMP DOMSVGMatrix::GetE(float *aE)
-{
-  *aE = E();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetE(float aE, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.x0 = aE;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetE(float aE)
-{
-  NS_ENSURE_FINITE(aE, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetE(aE, rv);
-  return rv.ErrorCode();
-}
-
-/* attribute float f; */
-NS_IMETHODIMP DOMSVGMatrix::GetF(float *aF)
-{
-  *aF = F();
-  return NS_OK;
-}
-
 void
 DOMSVGMatrix::SetF(float aF, ErrorResult& rv)
 {
   if (IsAnimVal()) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   gfxMatrix mx = Matrix();
   mx.y0 = aF;
   SetMatrix(mx);
 }
 
-NS_IMETHODIMP DOMSVGMatrix::SetF(float aF)
-{
-  NS_ENSURE_FINITE(aF, NS_ERROR_ILLEGAL_VALUE);
-  ErrorResult rv;
-  SetF(aF, rv);
-  return rv.ErrorCode();
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::Multiply(DOMSVGMatrix& aMatrix)
 {
   nsCOMPtr<DOMSVGMatrix> matrix = new DOMSVGMatrix(aMatrix.Matrix() * Matrix());
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix multiply (in nsIDOMSVGMatrix secondMatrix); */
-NS_IMETHODIMP DOMSVGMatrix::Multiply(nsIDOMSVGMatrix *secondMatrix,
-                                     nsIDOMSVGMatrix **_retval)
-{
-  *_retval = nullptr;
-  nsCOMPtr<DOMSVGMatrix> domMatrix = do_QueryInterface(secondMatrix);
-  if (!domMatrix)
-    return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
-
-  *_retval = Multiply(*domMatrix).get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::Inverse(ErrorResult& rv)
 {
   if (Matrix().IsSingular()) {
     rv.Throw(NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE);
     return nullptr;
   }
   nsRefPtr<DOMSVGMatrix> matrix = new DOMSVGMatrix(gfxMatrix(Matrix()).Invert());
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix inverse (); */
-NS_IMETHODIMP DOMSVGMatrix::Inverse(nsIDOMSVGMatrix **_retval)
-{
-  ErrorResult rv;
-  *_retval = Inverse(rv).get();
-  return rv.ErrorCode();
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::Translate(float x, float y)
 {
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(Matrix()).Translate(gfxPoint(x, y)));
   return matrix.forget();
 }
 
-
-/* nsIDOMSVGMatrix translate (in float x, in float y); */
-NS_IMETHODIMP DOMSVGMatrix::Translate(float x, float y,
-                                      nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(x) || !NS_finite(y)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  *_retval = Translate(x, y).get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::Scale(float scaleFactor)
 {
   return ScaleNonUniform(scaleFactor, scaleFactor);
 }
 
- /* nsIDOMSVGMatrix scale (in float scaleFactor); */
-NS_IMETHODIMP DOMSVGMatrix::Scale(float scaleFactor, nsIDOMSVGMatrix **_retval)
-{
-  return ScaleNonUniform(scaleFactor, scaleFactor, _retval);
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::ScaleNonUniform(float scaleFactorX,
                               float scaleFactorY)
 {
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(Matrix()).Scale(scaleFactorX, scaleFactorY));
   return matrix.forget();
 }
 
-
- /* nsIDOMSVGMatrix scaleNonUniform (in float scaleFactorX,
- *                                  in float scaleFactorY); */
-NS_IMETHODIMP DOMSVGMatrix::ScaleNonUniform(float scaleFactorX,
-                                            float scaleFactorY,
-                                            nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(scaleFactorX) || !NS_finite(scaleFactorY)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  *_retval = ScaleNonUniform(scaleFactorX, scaleFactorY).get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::Rotate(float angle)
 {
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(Matrix()).Rotate(angle*radPerDegree));
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix rotate (in float angle); */
-NS_IMETHODIMP DOMSVGMatrix::Rotate(float angle, nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(angle)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  *_retval = Rotate(angle).get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::RotateFromVector(float x, float y, ErrorResult& rv)
 {
   if (x == 0.0 || y == 0.0) {
     rv.Throw(NS_ERROR_RANGE_ERR);
     return nullptr;
   }
 
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(Matrix()).Rotate(atan2(y, x)));
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix rotateFromVector (in float x, in float y); */
-NS_IMETHODIMP DOMSVGMatrix::RotateFromVector(float x, float y,
-                                             nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(x) || !NS_finite(y)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-
-  ErrorResult rv;
-  *_retval = RotateFromVector(x, y, rv).get();
-  return rv.ErrorCode();
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::FlipX()
 {
   const gfxMatrix& mx = Matrix();
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(-mx.xx, -mx.yx, mx.xy, mx.yy, mx.x0, mx.y0));
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix flipX (); */
-NS_IMETHODIMP DOMSVGMatrix::FlipX(nsIDOMSVGMatrix **_retval)
-{
-  *_retval = FlipX().get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::FlipY()
 {
   const gfxMatrix& mx = Matrix();
   nsRefPtr<DOMSVGMatrix> matrix =
     new DOMSVGMatrix(gfxMatrix(mx.xx, mx.yx, -mx.xy, -mx.yy, mx.x0, mx.y0));
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix flipY (); */
-NS_IMETHODIMP DOMSVGMatrix::FlipY(nsIDOMSVGMatrix **_retval)
-{
-  *_retval = FlipY().get();
-  return NS_OK;
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::SkewX(float angle, ErrorResult& rv)
 {
   double ta = tan( angle*radPerDegree );
   if (!NS_finite(ta)) {
     rv.Throw(NS_ERROR_RANGE_ERR);
     return nullptr;
   }
@@ -421,29 +228,16 @@ DOMSVGMatrix::SkewX(float angle, ErrorRe
   const gfxMatrix& mx = Matrix();
   gfxMatrix skewMx(mx.xx, mx.yx,
                    (float) (mx.xy + mx.xx*ta), (float) (mx.yy + mx.yx*ta),
                    mx.x0, mx.y0);
   nsRefPtr<DOMSVGMatrix> matrix = new DOMSVGMatrix(skewMx);
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix skewX (in float angle); */
-NS_IMETHODIMP DOMSVGMatrix::SkewX(float angle, nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(angle)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-
-  ErrorResult rv;
-  *_retval = SkewX(angle, rv).get();
-  return rv.ErrorCode();
-}
-
 already_AddRefed<DOMSVGMatrix>
 DOMSVGMatrix::SkewY(float angle, ErrorResult& rv)
 {
   double ta = tan( angle*radPerDegree );
   if (!NS_finite(ta)) {
     rv.Throw(NS_ERROR_RANGE_ERR);
     return nullptr;
   }
@@ -452,23 +246,10 @@ DOMSVGMatrix::SkewY(float angle, ErrorRe
   gfxMatrix skewMx((float) (mx.xx + mx.xy*ta), (float) (mx.yx + mx.yy*ta),
                    mx.xy, mx.yy,
                    mx.x0, mx.y0);
 
   nsRefPtr<DOMSVGMatrix> matrix = new DOMSVGMatrix(skewMx);
   return matrix.forget();
 }
 
-/* nsIDOMSVGMatrix skewY (in float angle); */
-NS_IMETHODIMP DOMSVGMatrix::SkewY(float angle, nsIDOMSVGMatrix **_retval)
-{
-  if (!NS_finite(angle)) {
-    *_retval = nullptr;
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
+} // namespace mozilla
 
-  ErrorResult rv;
-  *_retval = SkewY(angle, rv).get();
-  return rv.ErrorCode();
-}
-
-
-} // namespace mozilla
--- a/content/svg/content/src/DOMSVGMatrix.h
+++ b/content/svg/content/src/DOMSVGMatrix.h
@@ -36,17 +36,16 @@
 
 #ifndef MOZILLA_DOMSVGMATRIX_H__
 #define MOZILLA_DOMSVGMATRIX_H__
 
 #include "DOMSVGTransform.h"
 #include "gfxMatrix.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
-#include "nsIDOMSVGMatrix.h"
 #include "nsWrapperCache.h"
 #include "mozilla/Attributes.h"
 
 // We make DOMSVGMatrix a pseudo-interface to allow us to QI to it in order
 // to check that the objects that scripts pass in are our *native* matrix
 // objects.
 //
 // {633419E5-7E88-4C3E-8A9A-856F635E90A3}
@@ -54,24 +53,23 @@
   { 0x633419E5, 0x7E88, 0x4C3E, \
     { 0x8A, 0x9A, 0x85, 0x6F, 0x63, 0x5E, 0x90, 0xA3 } }
 
 namespace mozilla {
 
 /**
  * DOM wrapper for an SVG matrix.
  */
-class DOMSVGMatrix MOZ_FINAL : public nsIDOMSVGMatrix,
+class DOMSVGMatrix MOZ_FINAL : public nsISupports,
                                public nsWrapperCache
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGMATRIX_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGMatrix)
-  NS_DECL_NSIDOMSVGMATRIX
 
   /**
    * Ctor for DOMSVGMatrix objects that belong to a DOMSVGTransform.
    */
   DOMSVGMatrix(DOMSVGTransform& aTransform) : mTransform(&aTransform) {
     SetIsDOMBinding();
   }
 
--- a/content/svg/content/src/DOMSVGPoint.cpp
+++ b/content/svg/content/src/DOMSVGPoint.cpp
@@ -5,17 +5,16 @@
 
 #include "DOMSVGPoint.h"
 #include "DOMSVGPointList.h"
 #include "SVGPoint.h"
 #include "SVGAnimatedPointList.h"
 #include "nsSVGElement.h"
 #include "nsIDOMSVGPoint.h"
 #include "nsError.h"
-#include "nsIDOMSVGMatrix.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 #include "DOMSVGMatrix.h"
 #include "mozilla/dom/SVGPointBinding.h"
 
 // See the architecture comment in DOMSVGPointList.h.
 
 using namespace mozilla;
 
@@ -154,17 +153,17 @@ DOMSVGPoint::SetY(float aY, ErrorResult&
       Element()->AnimationNeedsResample();
     }
     return;
   }
   mPt.mY = aY;
 }
 
 NS_IMETHODIMP
-DOMSVGPoint::MatrixTransform(nsIDOMSVGMatrix *matrix,
+DOMSVGPoint::MatrixTransform(nsISupports *matrix,
                              nsIDOMSVGPoint **_retval)
 {
   nsCOMPtr<DOMSVGMatrix> domMatrix = do_QueryInterface(matrix);
   if (!domMatrix) {
     *_retval = nullptr;
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
   }
   *_retval = MatrixTransform(*domMatrix).get();
--- a/content/svg/content/src/nsSVGGraphicElement.cpp
+++ b/content/svg/content/src/nsSVGGraphicElement.cpp
@@ -70,56 +70,57 @@ NS_IMETHODIMP nsSVGGraphicElement::GetBB
 
   nsISVGChildFrame* svgframe = do_QueryFrame(frame);
   if (svgframe) {
     return NS_NewSVGRect(_retval, nsSVGUtils::GetBBox(frame));
   }
   return NS_ERROR_FAILURE;
 }
 
-/* nsIDOMSVGMatrix getCTM (); */
-NS_IMETHODIMP nsSVGGraphicElement::GetCTM(nsIDOMSVGMatrix * *aCTM)
+/* DOMSVGMatrix getCTM (); */
+NS_IMETHODIMP nsSVGGraphicElement::GetCTM(nsISupports * *aCTM)
 {
   gfxMatrix m = SVGContentUtils::GetCTM(this, false);
   *aCTM = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   NS_IF_ADDREF(*aCTM);
   return NS_OK;
 }
 
-/* nsIDOMSVGMatrix getScreenCTM (); */
-NS_IMETHODIMP nsSVGGraphicElement::GetScreenCTM(nsIDOMSVGMatrix * *aCTM)
+/* DOMSVGMatrix getScreenCTM (); */
+NS_IMETHODIMP nsSVGGraphicElement::GetScreenCTM(nsISupports * *aCTM)
 {
   gfxMatrix m = SVGContentUtils::GetCTM(this, true);
   *aCTM = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   NS_IF_ADDREF(*aCTM);
   return NS_OK;
 }
 
-/* nsIDOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
-NS_IMETHODIMP nsSVGGraphicElement::GetTransformToElement(nsIDOMSVGElement *element, nsIDOMSVGMatrix **_retval)
+/* DOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
+NS_IMETHODIMP nsSVGGraphicElement::GetTransformToElement(nsIDOMSVGElement *element, nsISupports **_retval)
 {
   if (!element)
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
 
   nsresult rv;
   *_retval = nullptr;
-  nsCOMPtr<nsIDOMSVGMatrix> ourScreenCTM;
-  nsCOMPtr<nsIDOMSVGMatrix> targetScreenCTM;
-  nsCOMPtr<nsIDOMSVGMatrix> tmp;
+  nsCOMPtr<DOMSVGMatrix> ourScreenCTM;
+  nsCOMPtr<DOMSVGMatrix> targetScreenCTM;
   nsCOMPtr<nsIDOMSVGLocatable> target = do_QueryInterface(element, &rv);
   if (NS_FAILED(rv)) return rv;
 
   // the easiest way to do this (if likely to increase rounding error):
   GetScreenCTM(getter_AddRefs(ourScreenCTM));
   if (!ourScreenCTM) return NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE;
   target->GetScreenCTM(getter_AddRefs(targetScreenCTM));
   if (!targetScreenCTM) return NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE;
-  rv = targetScreenCTM->Inverse(getter_AddRefs(tmp));
-  if (NS_FAILED(rv)) return rv;
-  return tmp->Multiply(ourScreenCTM, _retval);  // addrefs, so we don't
+  ErrorResult result;
+  nsCOMPtr<DOMSVGMatrix> tmp = targetScreenCTM->Inverse(result);
+  if (result.Failed()) return result.ErrorCode();
+  *_retval = tmp->Multiply(*ourScreenCTM).get(); // addrefs, so we don't
+  return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // nsIDOMSVGTransformable methods
 /* readonly attribute nsISupports transform; */
 
 NS_IMETHODIMP nsSVGGraphicElement::GetTransform(nsISupports **aTransform)
 {
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -114,30 +114,30 @@ nsSVGTranslatePoint::DOMVal::SetY(float 
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   ErrorResult rv;
   SetY(aY, rv);
   return rv.ErrorCode();
 }
 
+/* nsIDOMSVGPoint matrixTransform (in DOMSVGMatrix matrix); */
 NS_IMETHODIMP
-nsSVGTranslatePoint::DOMVal::MatrixTransform(nsIDOMSVGMatrix *matrix,
+nsSVGTranslatePoint::DOMVal::MatrixTransform(nsISupports *matrix,
                                              nsIDOMSVGPoint **_retval)
 {
   nsCOMPtr<DOMSVGMatrix> domMatrix = do_QueryInterface(matrix);
   if (!domMatrix) {
     *_retval = nullptr;
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
   }
   *_retval = MatrixTransform(*domMatrix).get();
   return NS_OK;
 }
 
-/* nsIDOMSVGPoint matrixTransform (in nsIDOMSVGMatrix matrix); */
 already_AddRefed<nsISVGPoint>
 nsSVGTranslatePoint::DOMVal::MatrixTransform(DOMSVGMatrix& matrix)
 {
   float a = matrix.A(), b = matrix.B(), c = matrix.C();
   float d = matrix.D(), e = matrix.E(), f = matrix.F();
   float x = mVal->GetX();
   float y = mVal->GetY();
 
@@ -575,19 +575,19 @@ nsSVGSVGElement::CreateSVGAngle(nsISuppo
 /* nsIDOMSVGPoint createSVGPoint (); */
 NS_IMETHODIMP
 nsSVGSVGElement::CreateSVGPoint(nsIDOMSVGPoint **_retval)
 {
   NS_ADDREF(*_retval = new DOMSVGPoint(0, 0));
   return NS_OK;
 }
 
-/* nsIDOMSVGMatrix createSVGMatrix (); */
+/* DOMSVGMatrix createSVGMatrix (); */
 NS_IMETHODIMP
-nsSVGSVGElement::CreateSVGMatrix(nsIDOMSVGMatrix **_retval)
+nsSVGSVGElement::CreateSVGMatrix(nsISupports **_retval)
 {
   NS_ADDREF(*_retval = new DOMSVGMatrix());
   return NS_OK;
 }
 
 /* nsIDOMSVGRect createSVGRect (); */
 NS_IMETHODIMP
 nsSVGSVGElement::CreateSVGRect(nsIDOMSVGRect **_retval)
@@ -598,19 +598,19 @@ nsSVGSVGElement::CreateSVGRect(nsIDOMSVG
 /* DOMSVGTransform createSVGTransform (); */
 NS_IMETHODIMP
 nsSVGSVGElement::CreateSVGTransform(nsISupports **_retval)
 {
   NS_ADDREF(*_retval = new DOMSVGTransform());
   return NS_OK;
 }
 
-/* DOMSVGTransform createSVGTransformFromMatrix (in nsIDOMSVGMatrix matrix); */
+/* DOMSVGTransform createSVGTransformFromMatrix (in DOMSVGMatrix matrix); */
 NS_IMETHODIMP
-nsSVGSVGElement::CreateSVGTransformFromMatrix(nsIDOMSVGMatrix *matrix,
+nsSVGSVGElement::CreateSVGTransformFromMatrix(nsISupports *matrix,
                                               nsISupports **_retval)
 {
   nsCOMPtr<DOMSVGMatrix> domItem = do_QueryInterface(matrix);
   if (!domItem) {
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
   }
 
   NS_ADDREF(*_retval = new DOMSVGTransform(domItem->Matrix()));
@@ -684,60 +684,62 @@ nsSVGSVGElement::GetBBox(nsIDOMSVGRect *
 
   nsISVGChildFrame* svgframe = do_QueryFrame(frame);
   if (svgframe) {
     return NS_NewSVGRect(_retval, nsSVGUtils::GetBBox(frame));
   }
   return NS_ERROR_NOT_IMPLEMENTED; // XXX: outer svg
 }
 
-/* nsIDOMSVGMatrix getCTM (); */
+/* DOMSVGMatrix getCTM (); */
 NS_IMETHODIMP
-nsSVGSVGElement::GetCTM(nsIDOMSVGMatrix * *aCTM)
+nsSVGSVGElement::GetCTM(nsISupports * *aCTM)
 {
   gfxMatrix m = SVGContentUtils::GetCTM(this, false);
   *aCTM = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   NS_IF_ADDREF(*aCTM);
   return NS_OK;
 }
 
-/* nsIDOMSVGMatrix getScreenCTM (); */
+/* DOMSVGMatrix getScreenCTM (); */
 NS_IMETHODIMP
-nsSVGSVGElement::GetScreenCTM(nsIDOMSVGMatrix **aCTM)
+nsSVGSVGElement::GetScreenCTM(nsISupports **aCTM)
 {
   gfxMatrix m = SVGContentUtils::GetCTM(this, true);
   *aCTM = m.IsSingular() ? nullptr : new DOMSVGMatrix(m);
   NS_IF_ADDREF(*aCTM);
   return NS_OK;
 }
 
-/* nsIDOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
+/* DOMSVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
 NS_IMETHODIMP
 nsSVGSVGElement::GetTransformToElement(nsIDOMSVGElement *element,
-                                       nsIDOMSVGMatrix **_retval)
+                                       nsISupports **_retval)
 {
   if (!element)
     return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
 
   nsresult rv;
   *_retval = nullptr;
-  nsCOMPtr<nsIDOMSVGMatrix> ourScreenCTM;
-  nsCOMPtr<nsIDOMSVGMatrix> targetScreenCTM;
-  nsCOMPtr<nsIDOMSVGMatrix> tmp;
+  nsCOMPtr<DOMSVGMatrix> ourScreenCTM;
+  nsCOMPtr<DOMSVGMatrix> targetScreenCTM;
   nsCOMPtr<nsIDOMSVGLocatable> target = do_QueryInterface(element, &rv);
   if (NS_FAILED(rv)) return rv;
 
   // the easiest way to do this (if likely to increase rounding error):
   GetScreenCTM(getter_AddRefs(ourScreenCTM));
   if (!ourScreenCTM) return NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE;
   target->GetScreenCTM(getter_AddRefs(targetScreenCTM));
   if (!targetScreenCTM) return NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE;
-  rv = targetScreenCTM->Inverse(getter_AddRefs(tmp));
+  ErrorResult result;
+  nsCOMPtr<DOMSVGMatrix> tmp = targetScreenCTM->Inverse(result);
+  if (result.Failed()) return result.ErrorCode();
   if (NS_FAILED(rv)) return rv;
-  return tmp->Multiply(ourScreenCTM, _retval);  // addrefs, so we don't
+  *_retval = tmp->Multiply(*ourScreenCTM).get();  // addrefs, so we don't
+  return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // nsIDOMSVGZoomAndPan methods
 
 /* attribute unsigned short zoomAndPan; */
 NS_IMETHODIMP
 nsSVGSVGElement::GetZoomAndPan(uint16_t *aZoomAndPan)
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -346,17 +346,16 @@
 #include "nsIDOMSVGGradientElement.h"
 #include "nsIDOMSVGImageElement.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMSVGLengthList.h"
 #include "nsIDOMSVGLineElement.h"
 #include "nsIDOMSVGLocatable.h"
 #include "nsIDOMSVGMarkerElement.h"
 #include "nsIDOMSVGMaskElement.h"
-#include "nsIDOMSVGMatrix.h"
 #include "nsIDOMSVGMetadataElement.h"
 #include "nsIDOMSVGNumber.h"
 #include "nsIDOMSVGNumberList.h"
 #include "nsIDOMSVGPathElement.h"
 #include "nsIDOMSVGPatternElement.h"
 #include "nsIDOMSVGPoint.h"
 #include "nsIDOMSVGPolygonElement.h"
 #include "nsIDOMSVGPolylineElement.h"
@@ -1234,18 +1233,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedString, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGEvent, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGLength, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGLengthList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGMatrix, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumberList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGPoint, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -3520,20 +3517,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(SVGLength, nsIDOMSVGLength)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLength)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGLengthList, nsIDOMSVGLengthList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLengthList)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SVGMatrix, nsIDOMSVGMatrix)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMatrix)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGNumber, nsIDOMSVGNumber)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumber)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGNumberList, nsIDOMSVGNumberList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumberList)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -261,17 +261,16 @@ DOMCI_CLASS(SVGAnimatedLength)
 DOMCI_CLASS(SVGAnimatedLengthList)
 DOMCI_CLASS(SVGAnimatedNumber)
 DOMCI_CLASS(SVGAnimatedNumberList)
 DOMCI_CLASS(SVGAnimatedRect)
 DOMCI_CLASS(SVGAnimatedString)
 DOMCI_CLASS(SVGEvent)
 DOMCI_CLASS(SVGLength)
 DOMCI_CLASS(SVGLengthList)
-DOMCI_CLASS(SVGMatrix)
 DOMCI_CLASS(SVGNumber)
 DOMCI_CLASS(SVGNumberList)
 DOMCI_CLASS(SVGPoint)
 DOMCI_CLASS(SVGRect)
 DOMCI_CLASS(SVGStringList)
 DOMCI_CLASS(SVGZoomEvent)
 
 // Canvas
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -49,17 +49,16 @@ XPIDLSRCS	= \
 		nsIDOMSVGGradientElement.idl \
 		nsIDOMSVGImageElement.idl \
 		nsIDOMSVGLength.idl \
 		nsIDOMSVGLengthList.idl \
 		nsIDOMSVGLineElement.idl \
 		nsIDOMSVGLocatable.idl \
 		nsIDOMSVGMarkerElement.idl \
 		nsIDOMSVGMaskElement.idl \
-		nsIDOMSVGMatrix.idl \
 		nsIDOMSVGMetadataElement.idl \
 		nsIDOMSVGMpathElement.idl \
 		nsIDOMSVGNumber.idl \
 		nsIDOMSVGNumberList.idl \
 		nsIDOMSVGPathElement.idl \
 		nsIDOMSVGPatternElement.idl \
 		nsIDOMSVGPoint.idl \
 		nsIDOMSVGPolygonElement.idl \
--- a/dom/interfaces/svg/nsIDOMSVGLength.idl
+++ b/dom/interfaces/svg/nsIDOMSVGLength.idl
@@ -1,17 +1,15 @@
 /* -*- 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 nsIDOMSVGMatrix;
-
 [scriptable, uuid(2596325c-aed0-487e-96a1-0a6d589b9c6b)]
 interface nsIDOMSVGLength : nsISupports
 { 
   // Length Unit Types
   const unsigned short SVG_LENGTHTYPE_UNKNOWN    = 0;
   const unsigned short SVG_LENGTHTYPE_NUMBER     = 1;
   const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2;
   const unsigned short SVG_LENGTHTYPE_EMS        = 3;
--- a/dom/interfaces/svg/nsIDOMSVGLocatable.idl
+++ b/dom/interfaces/svg/nsIDOMSVGLocatable.idl
@@ -1,23 +1,25 @@
 /* -*- 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 nsIDOMSVGRect;
-interface nsIDOMSVGMatrix;
 interface nsIDOMSVGElement;
 
 [scriptable, uuid(9cf4fc9c-90b2-4d66-88f5-35049b558aee)]
 interface nsIDOMSVGLocatable : nsISupports
 { 
   readonly attribute nsIDOMSVGElement  nearestViewportElement;
   readonly attribute nsIDOMSVGElement  farthestViewportElement;
   
   nsIDOMSVGRect   getBBox();
-  nsIDOMSVGMatrix getCTM();
-  nsIDOMSVGMatrix getScreenCTM();
-  nsIDOMSVGMatrix getTransformToElement(in nsIDOMSVGElement element);
+  // SVGMatrix
+  nsISupports     getCTM();
+  // SVGMatrix
+  nsISupports     getScreenCTM();
+  // SVGMatrix
+  nsISupports     getTransformToElement(in nsIDOMSVGElement element);
       // raises( SVGException );
 };
--- a/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
@@ -3,17 +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/. */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
 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
  *
  */
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGMatrix.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"
-
-[scriptable, builtinclass, uuid(ec2da3ef-5a99-49ed-aaef-b5af916c14ac)]
-interface nsIDOMSVGMatrix : nsISupports
-{
-  attribute float a;
-      // raises DOMException on setting
-  attribute float b;
-      // raises DOMException on setting
-  attribute float c;
-      // raises DOMException on setting
-  attribute float d;
-      // raises DOMException on setting
-  attribute float e;
-      // raises DOMException on setting
-  attribute float f;
-      // raises DOMException on setting
-
-  nsIDOMSVGMatrix multiply(in nsIDOMSVGMatrix secondMatrix);
-  nsIDOMSVGMatrix inverse();
-      // raises( SVGException );
-  nsIDOMSVGMatrix translate(in float x, in float y);
-  nsIDOMSVGMatrix scale(in float scaleFactor);
-  nsIDOMSVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);
-  nsIDOMSVGMatrix rotate(in float angle);
-  nsIDOMSVGMatrix rotateFromVector(in float x, in float y);
-      // raises( SVGException );
-  nsIDOMSVGMatrix flipX();
-  nsIDOMSVGMatrix flipY();
-  nsIDOMSVGMatrix skewX(in float angle);
-  nsIDOMSVGMatrix skewY(in float angle);
-};
--- a/dom/interfaces/svg/nsIDOMSVGPoint.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPoint.idl
@@ -1,19 +1,19 @@
 /* -*- 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 nsIDOMSVGMatrix;
 
 [scriptable, uuid(45f18f8f-1315-4447-a7d5-8aeca77bdcaf)]
 interface nsIDOMSVGPoint : nsISupports
 {
   attribute float x;
       // raises DOMException on setting
   attribute float y;
       // raises DOMException on setting
 
-  nsIDOMSVGPoint matrixTransform(in nsIDOMSVGMatrix matrix);
+  //                                SVGMatrix
+  nsIDOMSVGPoint matrixTransform(in nsISupports matrix);
 };
--- 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 nsIDOMSVGMatrix;
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 %}
 
@@ -72,16 +71,17 @@ interface nsIDOMSVGSVGElement
   boolean       checkIntersection(in nsIDOMSVGElement element, in nsIDOMSVGRect rect);
   boolean       checkEnclosure(in nsIDOMSVGElement element, in nsIDOMSVGRect rect);
   void          deSelectAll();
   nsIDOMSVGNumber       createSVGNumber();
   nsIDOMSVGLength       createSVGLength();
   // SVGAngle
   nsISupports           createSVGAngle();
   nsIDOMSVGPoint        createSVGPoint();
-  nsIDOMSVGMatrix       createSVGMatrix();
+  // SVGMatrix
+  nsISupports           createSVGMatrix();
   nsIDOMSVGRect         createSVGRect();
   // SVGTransform
   nsISupports           createSVGTransform();
-  // SVGTransform
-  nsISupports           createSVGTransformFromMatrix(in nsIDOMSVGMatrix matrix);
+  // SVGTransform                                       SVGMatrix
+  nsISupports           createSVGTransformFromMatrix(in nsISupports matrix);
   nsIDOMElement         getElementById(in DOMString elementId);
 };