Bug 602759 part 17 - Remove unnecessary BeforeSetAttr overrides; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Sun, 25 Sep 2011 22:05:02 +0100
changeset 78872 dbde35bf04e94142be687c99b026bfe31a811fa0
parent 78871 b6bb849d7c9990febb1311c8e8394e030e5684bd
child 78873 2cd423eb039255187d493e179e33bcfca60550e9
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs602759
milestone9.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 602759 part 17 - Remove unnecessary BeforeSetAttr overrides; r=jwatt
content/svg/content/src/nsSVGGradientElement.cpp
content/svg/content/src/nsSVGGradientElement.h
content/svg/content/src/nsSVGGraphicElement.cpp
content/svg/content/src/nsSVGGraphicElement.h
content/svg/content/src/nsSVGPatternElement.cpp
content/svg/content/src/nsSVGPatternElement.h
--- a/content/svg/content/src/nsSVGGradientElement.cpp
+++ b/content/svg/content/src/nsSVGGradientElement.cpp
@@ -89,30 +89,16 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGGra
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGGradientElement::nsSVGGradientElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGGradientElementBase(aNodeInfo)
 {
 }
 
-nsresult
-nsSVGGradientElement::BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                    const nsAString* aValue, PRBool aNotify)
-{
-  if (aNamespaceID == kNameSpaceID_None &&
-      aName == nsGkAtoms::gradientTransform &&
-      !mGradientTransform &&
-      !(mGradientTransform = new SVGAnimatedTransformList()))
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  return nsSVGGradientElementBase::BeforeSetAttr(aNamespaceID, aName,
-                                                 aValue, aNotify);
-}
-
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 nsSVGElement::EnumAttributesInfo
 nsSVGGradientElement::GetEnumInfo()
 {
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
                             NS_ARRAY_LENGTH(sEnumInfo));
--- a/content/svg/content/src/nsSVGGradientElement.h
+++ b/content/svg/content/src/nsSVGGradientElement.h
@@ -87,19 +87,16 @@ protected:
   nsSVGEnum mEnumAttributes[2];
   static nsSVGEnumMapping sSpreadMethodMap[];
   static EnumInfo sEnumInfo[2];
 
   enum { HREF };
   nsSVGString mStringAttributes[1];
   static StringInfo sStringInfo[1];
 
-  virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                 const nsAString* aValue, PRBool aNotify);
-
   // nsIDOMSVGGradientElement values
   nsAutoPtr<mozilla::SVGAnimatedTransformList> mGradientTransform;
 };
 
 //---------------------Linear Gradients------------------------
 
 typedef nsSVGGradientElement nsSVGLinearGradientElementBase;
 
--- a/content/svg/content/src/nsSVGGraphicElement.cpp
+++ b/content/svg/content/src/nsSVGGraphicElement.cpp
@@ -215,22 +215,8 @@ nsSVGGraphicElement::SetAnimateMotionTra
 SVGAnimatedTransformList*
 nsSVGGraphicElement::GetAnimatedTransformList()
 {
   if (!mTransforms) {
     mTransforms = new SVGAnimatedTransformList();
   }
   return mTransforms;
 }
-
-nsresult
-nsSVGGraphicElement::BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                   const nsAString* aValue, PRBool aNotify)
-{
-  if (aNamespaceID == kNameSpaceID_None &&
-      aName == nsGkAtoms::transform &&
-      !mTransforms &&
-      !(mTransforms = new SVGAnimatedTransformList()))
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  return nsSVGGraphicElementBase::BeforeSetAttr(aNamespaceID, aName,
-                                                aValue, aNotify);
-}
--- a/content/svg/content/src/nsSVGGraphicElement.h
+++ b/content/svg/content/src/nsSVGGraphicElement.h
@@ -68,19 +68,16 @@ public:
   virtual mozilla::SVGAnimatedTransformList* GetAnimatedTransformList();
   virtual nsIAtom* GetTransformListAttrName() const {
     return nsGkAtoms::transform;
   }
 
 protected:
   // nsSVGElement overrides
   virtual PRBool IsEventName(nsIAtom* aName);
-  
-  virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                 const nsAString* aValue, PRBool aNotify);
 
   nsAutoPtr<mozilla::SVGAnimatedTransformList> mTransforms;
 
   // XXX maybe move this to property table, to save space on un-animated elems?
   nsAutoPtr<gfxMatrix> mAnimateMotionTransform;
 };
 
 #endif // __NS_SVGGRAPHICELEMENT_H__
--- a/content/svg/content/src/nsSVGPatternElement.cpp
+++ b/content/svg/content/src/nsSVGPatternElement.cpp
@@ -93,30 +93,16 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGPat
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGPatternElement::nsSVGPatternElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGPatternElementBase(aNodeInfo)
 {
 }
 
-nsresult
-nsSVGPatternElement::BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                   const nsAString* aValue, PRBool aNotify)
-{
-  if (aNamespaceID == kNameSpaceID_None &&
-      aName == nsGkAtoms::patternTransform &&
-      !mPatternTransform &&
-      !(mPatternTransform = new SVGAnimatedTransformList()))
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  return nsSVGPatternElementBase::BeforeSetAttr(aNamespaceID, aName,
-                                                aValue, aNotify);
-}
-
 //----------------------------------------------------------------------
 // nsIDOMNode method
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGPatternElement)
 
 //----------------------------------------------------------------------
 // nsIDOMSVGFitToViewBox methods
 
--- a/content/svg/content/src/nsSVGPatternElement.h
+++ b/content/svg/content/src/nsSVGPatternElement.h
@@ -95,19 +95,16 @@ public:
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual mozilla::SVGAnimatedTransformList* GetAnimatedTransformList();
   virtual nsIAtom* GetTransformListAttrName() const {
     return nsGkAtoms::patternTransform;
   }
 protected:
 
-  virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
-                                 const nsAString* aValue, PRBool aNotify);
-
   virtual LengthAttributesInfo GetLengthInfo();
   virtual EnumAttributesInfo GetEnumInfo();
   virtual nsSVGViewBox *GetViewBox();
   virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
   virtual StringAttributesInfo GetStringInfo();
 
   // nsIDOMSVGPatternElement values
   enum { X, Y, WIDTH, HEIGHT };