Bug 775730 - Address missed review comments. r=dholbert
authorRobert Longson <longsonr@gmail.com>
Wed, 25 Dec 2013 08:33:48 +0000
changeset 161793 db720cc7a830d2d4390d2e2f7a0a788bdc73993c
parent 161792 e013459d680e2827ca8e5665080530928a0308a7
child 161794 d706ebf6e5b14efb2e69df6dfb223ffa81976721
push id37984
push userlongsonr@gmail.com
push dateWed, 25 Dec 2013 08:34:16 +0000
treeherdermozilla-inbound@db720cc7a830 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs775730
milestone29.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 775730 - Address missed review comments. r=dholbert
content/svg/content/src/DOMSVGLength.cpp
content/svg/content/src/DOMSVGLengthList.cpp
content/svg/content/src/DOMSVGNumber.cpp
content/svg/content/src/DOMSVGNumberList.cpp
content/svg/content/src/DOMSVGPathSeg.cpp
content/svg/content/src/DOMSVGPathSegList.cpp
content/svg/content/src/DOMSVGPoint.cpp
content/svg/content/src/DOMSVGPointList.cpp
content/svg/content/src/DOMSVGStringList.cpp
content/svg/content/src/DOMSVGTransformList.cpp
content/svg/content/src/SVGTransform.cpp
content/svg/content/src/nsSVGTransform.cpp
--- a/content/svg/content/src/DOMSVGLength.cpp
+++ b/content/svg/content/src/DOMSVGLength.cpp
@@ -54,33 +54,34 @@ NS_INTERFACE_MAP_END
 // DidChangeLengthList.
 class MOZ_STACK_CLASS AutoChangeLengthNotifier
 {
 public:
   AutoChangeLengthNotifier(DOMSVGLength* aLength MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mLength(aLength)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mLength, "Expecting non-null length");
     MOZ_ASSERT(mLength->HasOwner(),
                "Expecting list to have an owner for notification");
     mEmptyOrOldValue =
       mLength->Element()->WillChangeLengthList(mLength->mAttrEnum);
   }
 
   ~AutoChangeLengthNotifier()
   {
     mLength->Element()->DidChangeLengthList(mLength->mAttrEnum,
                                             mEmptyOrOldValue);
     if (mLength->mList->IsAnimating()) {
       mLength->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGLength* mLength;
+  DOMSVGLength* const mLength;
   nsAttrValue   mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 DOMSVGLength::DOMSVGLength(DOMSVGLengthList *aList,
                            uint8_t aAttrEnum,
                            uint32_t aListIndex,
                            bool aIsAnimValItem)
@@ -157,21 +158,23 @@ DOMSVGLength::SetValue(float aUserUnitVa
   // unit as it is.
 
   if (HasOwner()) {
     if (InternalItem().GetValueInUserUnits(Element(), Axis()) ==
         aUserUnitValue) {
       return NS_OK;
     }
     float uuPerUnit = InternalItem().GetUserUnitsPerUnit(Element(), Axis());
-    float newValue = aUserUnitValue / uuPerUnit;
-    if (uuPerUnit > 0 && NS_finite(newValue)) {
-      AutoChangeLengthNotifier notifier(this);
-      InternalItem().SetValueAndUnit(newValue, InternalItem().GetUnit());
-      return NS_OK;
+    if (uuPerUnit > 0) {
+      float newValue = aUserUnitValue / uuPerUnit;
+      if (NS_finite(newValue)) {
+        AutoChangeLengthNotifier notifier(this);
+        InternalItem().SetValueAndUnit(newValue, InternalItem().GetUnit());
+        return NS_OK;
+      }
     }
   } else if (mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER ||
              mUnit == nsIDOMSVGLength::SVG_LENGTHTYPE_PX) {
     mValue = aUserUnitValue;
     return NS_OK;
   }
   // else [SVGWG issue] Can't convert user unit value to this length's unit
   // ReportToConsole
--- a/content/svg/content/src/DOMSVGLengthList.cpp
+++ b/content/svg/content/src/DOMSVGLengthList.cpp
@@ -80,31 +80,32 @@ DOMSVGLengthList::WrapObject(JSContext *
 // DidChangeLengthList.
 class MOZ_STACK_CLASS AutoChangeLengthListNotifier
 {
 public:
   AutoChangeLengthListNotifier(DOMSVGLengthList* aLengthList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mLengthList(aLengthList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mLengthList, "Expecting non-null lengthList");
     mEmptyOrOldValue =
       mLengthList->Element()->WillChangeLengthList(mLengthList->AttrEnum());
   }
 
   ~AutoChangeLengthListNotifier()
   {
     mLengthList->Element()->DidChangeLengthList(mLengthList->AttrEnum(),
                                                 mEmptyOrOldValue);
     if (mLengthList->IsAnimating()) {
       mLengthList->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGLengthList* mLengthList;
+  DOMSVGLengthList* const mLengthList;
   nsAttrValue       mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 void
 DOMSVGLengthList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
--- a/content/svg/content/src/DOMSVGNumber.cpp
+++ b/content/svg/content/src/DOMSVGNumber.cpp
@@ -9,17 +9,17 @@
 #include "SVGAnimatedNumberList.h"
 #include "nsSVGElement.h"
 #include "nsIDOMSVGNumber.h"
 #include "nsError.h"
 #include "nsContentUtils.h" // for NS_ENSURE_FINITE
 
 // See the architecture comment in DOMSVGAnimatedNumberList.h.
 
-using namespace mozilla;
+namespace mozilla {
 
 // We could use NS_IMPL_CYCLE_COLLECTION_1, except that in Unlink() we need to
 // clear our list's weak ref to us to be safe. (The other option would be to
 // not unlink and rely on the breaking of the other edges in the cycle, as
 // NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGNumber)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGNumber)
@@ -30,62 +30,60 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DO
 NS_IMPL_CYCLE_COLLECTION_UNLINK(mList)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGNumber)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGNumber)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGNumber)
-
-DOMCI_DATA(SVGNumber, DOMSVGNumber)
+}
+DOMCI_DATA(SVGNumber, mozilla::DOMSVGNumber)
 
+namespace mozilla {
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGNumber)
-  NS_INTERFACE_MAP_ENTRY(DOMSVGNumber) // pseudo-interface
+  NS_INTERFACE_MAP_ENTRY(mozilla::DOMSVGNumber) // pseudo-interface
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGNumber)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGNumber)
 NS_INTERFACE_MAP_END
 
-namespace mozilla {
-
 //----------------------------------------------------------------------
 // Helper class: AutoChangeNumberNotifier
 // Stack-based helper class to pair calls to WillChangeNumberList and
 // DidChangeNumberList.
 class MOZ_STACK_CLASS AutoChangeNumberNotifier
 {
 public:
   AutoChangeNumberNotifier(DOMSVGNumber* aNumber MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mNumber(aNumber)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mNumber, "Expecting non-null number");
     MOZ_ASSERT(mNumber->HasOwner(),
                "Expecting list to have an owner for notification");
     mEmptyOrOldValue =
       mNumber->Element()->WillChangeNumberList(mNumber->mAttrEnum);
   }
 
   ~AutoChangeNumberNotifier()
   {
     mNumber->Element()->DidChangeNumberList(mNumber->mAttrEnum,
                                             mEmptyOrOldValue);
     if (mNumber->mList->IsAnimating()) {
       mNumber->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGNumber* mNumber;
+  DOMSVGNumber* const mNumber;
   nsAttrValue   mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
-}
-
 DOMSVGNumber::DOMSVGNumber(DOMSVGNumberList *aList,
                            uint8_t aAttrEnum,
                            uint32_t aListIndex,
                            bool aIsAnimValItem)
   : mList(aList)
   , mListIndex(aListIndex)
   , mAttrEnum(aAttrEnum)
   , mIsAnimValItem(aIsAnimValItem)
@@ -185,8 +183,9 @@ DOMSVGNumber::IndexIsValid()
   SVGAnimatedNumberList *alist = Element()->GetAnimatedNumberList(mAttrEnum);
   return (mIsAnimValItem &&
           mListIndex < alist->GetAnimValue().Length()) ||
          (!mIsAnimValItem &&
           mListIndex < alist->GetBaseValue().Length());
 }
 #endif
 
+} // namespace mozilla
--- a/content/svg/content/src/DOMSVGNumberList.cpp
+++ b/content/svg/content/src/DOMSVGNumberList.cpp
@@ -81,31 +81,32 @@ DOMSVGNumberList::WrapObject(JSContext *
 // DidChangeNumberList.
 class MOZ_STACK_CLASS AutoChangeNumberListNotifier
 {
 public:
   AutoChangeNumberListNotifier(DOMSVGNumberList* aNumberList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mNumberList(aNumberList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mNumberList, "Expecting non-null numberList");
     mEmptyOrOldValue =
       mNumberList->Element()->WillChangeNumberList(mNumberList->AttrEnum());
   }
 
   ~AutoChangeNumberListNotifier()
   {
     mNumberList->Element()->DidChangeNumberList(mNumberList->AttrEnum(),
                                                 mEmptyOrOldValue);
     if (mNumberList->IsAnimating()) {
       mNumberList->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGNumberList* mNumberList;
+  DOMSVGNumberList* const mNumberList;
   nsAttrValue       mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 void
 DOMSVGNumberList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
--- a/content/svg/content/src/DOMSVGPathSeg.cpp
+++ b/content/svg/content/src/DOMSVGPathSeg.cpp
@@ -6,17 +6,17 @@
 #include "DOMSVGPathSeg.h"
 #include "DOMSVGPathSegList.h"
 #include "SVGAnimatedPathSegList.h"
 #include "nsSVGElement.h"
 #include "nsError.h"
 
 // See the architecture comment in DOMSVGPathSegList.h.
 
-using namespace mozilla;
+namespace mozilla {
 
 // We could use NS_IMPL_CYCLE_COLLECTION_1, except that in Unlink() we need to
 // clear our list's weak ref to us to be safe. (The other option would be to
 // not unlink and rely on the breaking of the other edges in the cycle, as
 // NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGPathSeg)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPathSeg)
@@ -35,51 +35,48 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSeg)
 NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGPathSeg, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGPathSeg, Release)
 
-namespace mozilla {
-
 //----------------------------------------------------------------------
 // Helper class: AutoChangePathSegNotifier
 // Stack-based helper class to pair calls to WillChangePathSegList
 // and DidChangePathSegList.
 class MOZ_STACK_CLASS AutoChangePathSegNotifier
 {
 public:
   AutoChangePathSegNotifier(DOMSVGPathSeg* aPathSeg MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mPathSeg(aPathSeg)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mPathSeg, "Expecting non-null pathSeg");
     MOZ_ASSERT(mPathSeg->HasOwner(),
                "Expecting list to have an owner for notification");
     mEmptyOrOldValue =
       mPathSeg->Element()->WillChangePathSegList();
   }
 
   ~AutoChangePathSegNotifier()
   {
     mPathSeg->Element()->DidChangePathSegList(mEmptyOrOldValue);
     if (mPathSeg->mList->AttrIsAnimating()) {
       mPathSeg->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGPathSeg* mPathSeg;
+  DOMSVGPathSeg* const mPathSeg;
   nsAttrValue    mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
-}
-
 DOMSVGPathSeg::DOMSVGPathSeg(DOMSVGPathSegList *aList,
                              uint32_t aListIndex,
                              bool aIsAnimValItem)
   : mList(aList)
   , mListIndex(aListIndex)
   , mIsAnimValItem(aIsAnimValItem)
 {
   SetIsDOMBinding();
@@ -381,8 +378,9 @@ DOMSVGPathSeg::CreateFor(DOMSVGPathSegLi
   case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
     return new DOMSVGPathSegCurvetoQuadraticSmoothRel(aList, aListIndex, aIsAnimValItem);
   default:
     NS_NOTREACHED("Invalid path segment type");
     return nullptr;
   }
 }
 
+} // namespace mozilla
--- a/content/svg/content/src/DOMSVGPathSegList.cpp
+++ b/content/svg/content/src/DOMSVGPathSegList.cpp
@@ -56,30 +56,31 @@ NS_INTERFACE_MAP_END
 // DidChangePathSegList.
 class MOZ_STACK_CLASS AutoChangePathSegListNotifier
 {
 public:
   AutoChangePathSegListNotifier(DOMSVGPathSegList* aPathSegList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mPathSegList(aPathSegList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mPathSegList, "Expecting non-null pathSegList");
     mEmptyOrOldValue =
       mPathSegList->Element()->WillChangePathSegList();
   }
 
   ~AutoChangePathSegListNotifier()
   {
     mPathSegList->Element()->DidChangePathSegList(mEmptyOrOldValue);
     if (mPathSegList->AttrIsAnimating()) {
       mPathSegList->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGPathSegList* mPathSegList;
+  DOMSVGPathSegList* const mPathSegList;
   nsAttrValue        mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 /* static */ already_AddRefed<DOMSVGPathSegList>
 DOMSVGPathSegList::GetDOMWrapper(void *aList,
                                  nsSVGElement *aElement,
                                  bool aIsAnimValList)
--- a/content/svg/content/src/DOMSVGPoint.cpp
+++ b/content/svg/content/src/DOMSVGPoint.cpp
@@ -22,32 +22,33 @@ namespace mozilla {
 // DidChangePointList.
 class MOZ_STACK_CLASS AutoChangePointNotifier
 {
 public:
   AutoChangePointNotifier(DOMSVGPoint* aPoint MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mPoint(aPoint)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mPoint, "Expecting non-null point");
     MOZ_ASSERT(mPoint->HasOwner(),
                "Expecting list to have an owner for notification");
     mEmptyOrOldValue =
       mPoint->Element()->WillChangePointList();
   }
 
   ~AutoChangePointNotifier()
   {
     mPoint->Element()->DidChangePointList(mEmptyOrOldValue);
     if (mPoint->mList->AttrIsAnimating()) {
       mPoint->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGPoint* mPoint;
+  DOMSVGPoint* const mPoint;
   nsAttrValue  mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 }
 
 float
 DOMSVGPoint::X()
--- a/content/svg/content/src/DOMSVGPointList.cpp
+++ b/content/svg/content/src/DOMSVGPointList.cpp
@@ -74,30 +74,31 @@ NS_INTERFACE_MAP_END
 // DidChangePointList.
 class MOZ_STACK_CLASS AutoChangePointListNotifier
 {
 public:
   AutoChangePointListNotifier(DOMSVGPointList* aPointList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mPointList(aPointList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mPointList, "Expecting non-null pointList");
     mEmptyOrOldValue =
       mPointList->Element()->WillChangePointList();
   }
 
   ~AutoChangePointListNotifier()
   {
     mPointList->Element()->DidChangePointList(mEmptyOrOldValue);
     if (mPointList->AttrIsAnimating()) {
       mPointList->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGPointList* mPointList;
+  DOMSVGPointList* const mPointList;
   nsAttrValue      mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 
 /* static */ already_AddRefed<DOMSVGPointList>
 DOMSVGPointList::GetDOMWrapper(void *aList,
                                nsSVGElement *aElement,
--- a/content/svg/content/src/DOMSVGStringList.cpp
+++ b/content/svg/content/src/DOMSVGStringList.cpp
@@ -43,29 +43,30 @@ NS_INTERFACE_MAP_END
 // DidChangeStringListList.
 class MOZ_STACK_CLASS AutoChangeStringListNotifier
 {
 public:
   AutoChangeStringListNotifier(DOMSVGStringList* aStringList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mStringList(aStringList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mStringList, "Expecting non-null stringList");
     mEmptyOrOldValue =
       mStringList->mElement->WillChangeStringList(mStringList->mIsConditionalProcessingAttribute,
                                                   mStringList->mAttrEnum);
   }
 
   ~AutoChangeStringListNotifier()
   {
     mStringList->mElement->DidChangeStringList(mStringList->mIsConditionalProcessingAttribute,
                                                mStringList->mAttrEnum, mEmptyOrOldValue);
   }
 
 private:
-  DOMSVGStringList* mStringList;
+  DOMSVGStringList* const mStringList;
   nsAttrValue       mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 /* static */ already_AddRefed<DOMSVGStringList>
 DOMSVGStringList::GetDOMWrapper(SVGStringList *aList,
                                 nsSVGElement *aElement,
                                 bool aIsConditionalProcessingAttribute,
--- a/content/svg/content/src/DOMSVGTransformList.cpp
+++ b/content/svg/content/src/DOMSVGTransformList.cpp
@@ -82,30 +82,31 @@ DOMSVGTransformList::WrapObject(JSContex
 // DidChangeTransformList.
 class MOZ_STACK_CLASS AutoChangeTransformListNotifier
 {
 public:
   AutoChangeTransformListNotifier(DOMSVGTransformList* aTransformList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mTransformList(aTransformList)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mTransformList, "Expecting non-null transformList");
     mEmptyOrOldValue =
       mTransformList->Element()->WillChangeTransformList();
   }
 
   ~AutoChangeTransformListNotifier()
   {
     mTransformList->Element()->DidChangeTransformList(mEmptyOrOldValue);
     if (mTransformList->IsAnimating()) {
       mTransformList->Element()->AnimationNeedsResample();
     }
   }
 
 private:
-  DOMSVGTransformList* mTransformList;
+  DOMSVGTransformList* const mTransformList;
   nsAttrValue          mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 void
 DOMSVGTransformList::InternalListLengthWillChange(uint32_t aNewLength)
 {
   uint32_t oldLength = mItems.Length();
--- a/content/svg/content/src/SVGTransform.cpp
+++ b/content/svg/content/src/SVGTransform.cpp
@@ -9,17 +9,17 @@
 #include "mozilla/dom/SVGTransform.h"
 #include "mozilla/dom/SVGMatrix.h"
 #include "mozilla/dom/SVGTransformBinding.h"
 #include "nsError.h"
 #include "nsSVGAnimatedTransformList.h"
 #include "nsSVGAttrTearoffTable.h"
 
 namespace {
-  const double radPerDegree = 2.0 * M_PI / 360.0;
+  const double kRadPerDegree = 2.0 * M_PI / 360.0;
 }
 
 namespace mozilla {
 namespace dom {
 
 static nsSVGAttrTearoffTable<SVGTransform, SVGMatrix>&
 SVGMatrixTearoffTable()
 {
@@ -71,16 +71,17 @@ SVGTransform::WrapObject(JSContext* aCx,
 // and DidChangeTransformList.
 class MOZ_STACK_CLASS AutoChangeTransformNotifier
 {
 public:
   AutoChangeTransformNotifier(SVGTransform* aTransform MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mTransform(aTransform)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+    MOZ_ASSERT(mTransform, "Expecting non-null transform");
     if (mTransform->HasOwner()) {
       mEmptyOrOldValue =
         mTransform->Element()->WillChangeTransformList();
     }
   }
 
   ~AutoChangeTransformNotifier()
   {
@@ -88,17 +89,17 @@ public:
       mTransform->Element()->DidChangeTransformList(mEmptyOrOldValue);
       if (mTransform->mList->IsAnimating()) {
         mTransform->Element()->AnimationNeedsResample();
       }
     }
   }
 
 private:
-  SVGTransform* mTransform;
+  SVGTransform* const mTransform;
   nsAttrValue   mEmptyOrOldValue;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 //----------------------------------------------------------------------
 // Ctors:
 
 SVGTransform::SVGTransform(DOMSVGTransformList *aList,
@@ -256,45 +257,47 @@ SVGTransform::SetSkewX(float angle, Erro
     return;
   }
 
   if (Transform().Type() == SVG_TRANSFORM_SKEWX &&
       Transform().Angle() == angle) {
     return;
   }
 
-  if (!NS_finite(tan(angle * radPerDegree))) {
+  if (!NS_finite(tan(angle * kRadPerDegree))) {
     rv.Throw(NS_ERROR_RANGE_ERR);
     return;
   }
 
   AutoChangeTransformNotifier notifier(this);
-  Transform().SetSkewX(angle);
+  DebugOnly<nsresult> result = Transform().SetSkewX(angle);
+  MOZ_ASSERT(NS_SUCCEEDED(result), "SetSkewX unexpectedly failed");
 }
 
 void
 SVGTransform::SetSkewY(float angle, ErrorResult& rv)
 {
   if (mIsAnimValItem) {
     rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return;
   }
 
   if (Transform().Type() == SVG_TRANSFORM_SKEWY &&
       Transform().Angle() == angle) {
     return;
   }
 
-  if (!NS_finite(tan(angle * radPerDegree))) {
+  if (!NS_finite(tan(angle * kRadPerDegree))) {
     rv.Throw(NS_ERROR_RANGE_ERR);
     return;
   }
 
   AutoChangeTransformNotifier notifier(this);
-  Transform().SetSkewY(angle);
+  DebugOnly<nsresult> result = Transform().SetSkewY(angle);
+  MOZ_ASSERT(NS_SUCCEEDED(result), "SetSkewY unexpectedly failed");
 }
 
 //----------------------------------------------------------------------
 // List management methods:
 
 void
 SVGTransform::InsertingIntoList(DOMSVGTransformList *aList,
                                 uint32_t aListIndex,
--- a/content/svg/content/src/nsSVGTransform.cpp
+++ b/content/svg/content/src/nsSVGTransform.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsError.h"
 #include "nsSVGTransform.h"
 #include "nsContentUtils.h" // for NS_ENSURE_FINITE
 #include "nsTextFormatter.h"
 
 namespace {
-  const double radPerDegree = 2.0 * M_PI / 360.0;
+  const double kRadPerDegree = 2.0 * M_PI / 360.0;
 }
 
 namespace mozilla {
 
 void
 nsSVGTransform::GetValueAsString(nsAString& aValue) const
 {
   PRUnichar buf[256];
@@ -110,42 +110,42 @@ nsSVGTransform::SetScale(float aSx, floa
 }
 
 void
 nsSVGTransform::SetRotate(float aAngle, float aCx, float aCy)
 {
   mType    = SVG_TRANSFORM_ROTATE;
   mMatrix.Reset();
   mMatrix.Translate(gfxPoint(aCx, aCy));
-  mMatrix.Rotate(aAngle*radPerDegree);
+  mMatrix.Rotate(aAngle*kRadPerDegree);
   mMatrix.Translate(gfxPoint(-aCx, -aCy));
   mAngle   = aAngle;
   mOriginX = aCx;
   mOriginY = aCy;
 }
 
 nsresult
 nsSVGTransform::SetSkewX(float aAngle)
 {
-  double ta = tan(aAngle*radPerDegree);
+  double ta = tan(aAngle*kRadPerDegree);
   NS_ENSURE_FINITE(ta, NS_ERROR_RANGE_ERR);
 
   mType    = SVG_TRANSFORM_SKEWX;
   mMatrix.Reset();
   mMatrix.xy = ta;
   mAngle   = aAngle;
   mOriginX = 0.f;
   mOriginY = 0.f;
   return NS_OK;
 }
 
 nsresult
 nsSVGTransform::SetSkewY(float aAngle)
 {
-  double ta = tan(aAngle*radPerDegree);
+  double ta = tan(aAngle*kRadPerDegree);
   NS_ENSURE_FINITE(ta, NS_ERROR_RANGE_ERR);
 
   mType    = SVG_TRANSFORM_SKEWY;
   mMatrix.Reset();
   mMatrix.yx = ta;
   mAngle   = aAngle;
   mOriginX = 0.f;
   mOriginY = 0.f;