Bug 837039 - Fix SVGMatrix failure codes r=longsonr
☠☠ backed out by 1911bdd5b548 ☠ ☠
authorDavid Zbarsky <dzbarsky@gmail.com>
Fri, 01 Feb 2013 04:55:46 -0500
changeset 130441 6a6ba49340e700b856f14a55e62a74cf70d892de
parent 130440 90aa16284fae57d638742963b5b51969fa022ad0
child 130442 c46098d2964c681782c3d76ec4753993a8ce96d5
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs837039
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 837039 - Fix SVGMatrix failure codes r=longsonr
content/svg/content/src/SVGMatrix.cpp
--- a/content/svg/content/src/SVGMatrix.cpp
+++ b/content/svg/content/src/SVGMatrix.cpp
@@ -125,17 +125,17 @@ SVGMatrix::Multiply(SVGMatrix& aMatrix)
   nsCOMPtr<SVGMatrix> matrix = new SVGMatrix(aMatrix.Matrix() * Matrix());
   return matrix.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGMatrix::Inverse(ErrorResult& rv)
 {
   if (Matrix().IsSingular()) {
-    rv.Throw(NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE);
+    rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
   nsRefPtr<SVGMatrix> matrix = new SVGMatrix(gfxMatrix(Matrix()).Invert());
   return matrix.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGMatrix::Translate(float x, float y)
@@ -167,17 +167,17 @@ SVGMatrix::Rotate(float angle)
     new SVGMatrix(gfxMatrix(Matrix()).Rotate(angle*radPerDegree));
   return matrix.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGMatrix::RotateFromVector(float x, float y, ErrorResult& rv)
 {
   if (x == 0.0 || y == 0.0) {
-    rv.Throw(NS_ERROR_RANGE_ERR);
+    rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
 
   nsRefPtr<SVGMatrix> matrix =
     new SVGMatrix(gfxMatrix(Matrix()).Rotate(atan2(y, x)));
   return matrix.forget();
 }
 
@@ -199,34 +199,34 @@ SVGMatrix::FlipY()
   return matrix.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGMatrix::SkewX(float angle, ErrorResult& rv)
 {
   double ta = tan( angle*radPerDegree );
   if (!NS_finite(ta)) {
-    rv.Throw(NS_ERROR_RANGE_ERR);
+    rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
 
   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<SVGMatrix> matrix = new SVGMatrix(skewMx);
   return matrix.forget();
 }
 
 already_AddRefed<SVGMatrix>
 SVGMatrix::SkewY(float angle, ErrorResult& rv)
 {
   double ta = tan( angle*radPerDegree );
   if (!NS_finite(ta)) {
-    rv.Throw(NS_ERROR_RANGE_ERR);
+    rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
 
   const gfxMatrix& mx = Matrix();
   gfxMatrix skewMx((float) (mx.xx + mx.xy*ta), (float) (mx.yx + mx.yy*ta),
                    mx.xy, mx.yy,
                    mx.x0, mx.y0);