Bug 846995 Part 1: Fix all the files that reference SVGAnimatedTransformList r=jwatt

This commit is contained in:
David Zbarsky 2013-03-19 22:31:44 -04:00
parent 1708ac5997
commit cc52e10127
14 changed files with 53 additions and 54 deletions

View File

@ -6,10 +6,10 @@
#include "DOMSVGTransform.h"
#include "mozilla/dom/SVGMatrix.h"
#include "SVGAnimatedTransformList.h"
#include "nsError.h"
#include "nsContentUtils.h"
#include "nsAttrValueInlines.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGAttrTearoffTable.h"
#include "mozilla/dom/SVGTransformBinding.h"
@ -292,7 +292,7 @@ DOMSVGTransform::RemovingFromList()
SVGTransform&
DOMSVGTransform::InternalItem()
{
SVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
nsSVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
return mIsAnimValItem && alist->mAnimVal ?
(*alist->mAnimVal)[mListIndex] :
alist->mBaseVal[mListIndex];
@ -308,7 +308,7 @@ DOMSVGTransform::InternalItem() const
bool
DOMSVGTransform::IndexIsValid()
{
SVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
nsSVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
return (mIsAnimValItem &&
mListIndex < alist->GetAnimValue().Length()) ||
(!mIsAnimValItem &&

View File

@ -6,7 +6,7 @@
#include "DOMSVGTransformList.h"
#include "DOMSVGTransform.h"
#include "mozilla/dom/SVGMatrix.h"
#include "SVGAnimatedTransformList.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGElement.h"
#include "nsContentUtils.h"
#include "mozilla/dom/SVGTransformListBinding.h"
@ -34,7 +34,7 @@ void UpdateListIndicesFromIndex(
namespace mozilla {
// We could use NS_IMPL_CYCLE_COLLECTION_1, except that in Unlink() we need to
// clear our DOMSVGAnimatedTransformList's weak ref to us to be safe. (The other
// clear our SVGAnimatedTransformList'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_UNLINK_BEGIN(DOMSVGTransformList)
@ -114,7 +114,7 @@ DOMSVGTransformList::InternalListLengthWillChange(uint32_t aNewLength)
SVGTransformList&
DOMSVGTransformList::InternalList() const
{
SVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
nsSVGAnimatedTransformList *alist = Element()->GetAnimatedTransformList();
return IsAnimValList() && alist->mAnimVal ?
*alist->mAnimVal :
alist->mBaseVal;

View File

@ -7,7 +7,7 @@
#ifndef MOZILLA_DOMSVGTRANSFORMLIST_H__
#define MOZILLA_DOMSVGTRANSFORMLIST_H__
#include "DOMSVGAnimatedTransformList.h"
#include "mozilla/dom/SVGAnimatedTransformList.h"
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDebug.h"
@ -33,7 +33,7 @@ class DOMSVGTransform;
* This class is used to create the DOM tearoff objects that wrap internal
* SVGTransformList objects.
*
* See the architecture comment in DOMSVGAnimatedTransformList.h.
* See the architecture comment in SVGAnimatedTransformList.h.
*/
class DOMSVGTransformList MOZ_FINAL : public nsISupports,
public nsWrapperCache
@ -44,7 +44,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGTransformList)
DOMSVGTransformList(DOMSVGAnimatedTransformList *aAList,
DOMSVGTransformList(dom::SVGAnimatedTransformList *aAList,
const SVGTransformList &aInternalList)
: mAList(aAList)
{
@ -162,7 +162,7 @@ private:
// of clearing our pointer to them when they die.
nsTArray<DOMSVGTransform*> mItems;
nsRefPtr<DOMSVGAnimatedTransformList> mAList;
nsRefPtr<dom::SVGAnimatedTransformList> mAList;
};
} // namespace mozilla

View File

@ -19,7 +19,6 @@ endif # !_MSC_VER
CPPSRCS = \
DOMSVGAnimatedLengthList.cpp \
DOMSVGAnimatedNumberList.cpp \
DOMSVGAnimatedTransformList.cpp \
DOMSVGLength.cpp \
DOMSVGLengthList.cpp \
DOMSVGNumber.cpp \
@ -34,6 +33,7 @@ CPPSRCS = \
nsDOMSVGZoomEvent.cpp \
nsISVGPoint.cpp \
nsSVGAngle.cpp \
nsSVGAnimatedTransformList.cpp \
nsSVGBoolean.cpp \
nsSVGClass.cpp \
nsSVGDataParser.cpp \
@ -156,6 +156,7 @@ include $(topsrcdir)/config/config.mk
FORCE_STATIC_LIB = 1
EXPORTS = \
nsSVGAnimatedTransformList.h \
nsSVGClass.h \
nsSVGElement.h \
nsSVGFeatures.h \
@ -173,6 +174,7 @@ EXPORTS_mozilla/dom = \
SVGAnimatedAngle.h \
SVGAnimatedBoolean.h \
SVGAnimatedLength.h \
SVGAnimatedTransformList.h \
SVGAnimateElement.h \
SVGAnimateTransformElement.h \
SVGAnimateMotionElement.h \

View File

@ -5,7 +5,7 @@
#include "mozilla/dom/SVGGradientElement.h"
#include "DOMSVGAnimatedTransformList.h"
#include "mozilla/dom/SVGAnimatedTransformList.h"
#include "mozilla/dom/SVGRadialGradientElementBinding.h"
#include "mozilla/dom/SVGLinearGradientElementBinding.h"
#include "mozilla/Util.h"
@ -89,12 +89,12 @@ SVGGradientElement::GradientUnits()
}
/* readonly attribute SVGAnimatedTransformList gradientTransform; */
already_AddRefed<DOMSVGAnimatedTransformList>
already_AddRefed<SVGAnimatedTransformList>
SVGGradientElement::GradientTransform()
{
// We're creating a DOM wrapper, so we must tell GetAnimatedTransformList
// to allocate the SVGAnimatedTransformList if it hasn't already done so:
return DOMSVGAnimatedTransformList::GetDOMWrapper(
return SVGAnimatedTransformList::GetDOMWrapper(
GetAnimatedTransformList(DO_ALLOCATE), this);
}
@ -190,11 +190,11 @@ SVGLinearGradientElement::Y2()
//----------------------------------------------------------------------
// nsSVGElement methods
SVGAnimatedTransformList*
nsSVGAnimatedTransformList*
SVGGradientElement::GetAnimatedTransformList(uint32_t aFlags)
{
if (!mGradientTransform && (aFlags & DO_ALLOCATE)) {
mGradientTransform = new SVGAnimatedTransformList();
mGradientTransform = new nsSVGAnimatedTransformList();
}
return mGradientTransform;
}

View File

@ -7,11 +7,11 @@
#define __NS_SVGGRADIENTELEMENT_H__
#include "nsIDOMSVGUnitTypes.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGElement.h"
#include "nsSVGLength2.h"
#include "nsSVGEnum.h"
#include "nsSVGString.h"
#include "SVGAnimatedTransformList.h"
static const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
static const unsigned short SVG_SPREADMETHOD_PAD = 1;
@ -30,11 +30,10 @@ NS_NewSVGRadialGradientElement(nsIContent** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
class DOMSVGAnimatedTransformList;
namespace dom {
class SVGAnimatedTransformList;
//--------------------- Gradients------------------------
typedef nsSVGElement SVGGradientElementBase;
@ -56,7 +55,7 @@ public:
// nsIContent
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
virtual SVGAnimatedTransformList*
virtual nsSVGAnimatedTransformList*
GetAnimatedTransformList(uint32_t aFlags = 0);
virtual nsIAtom* GetTransformListAttrName() const {
return nsGkAtoms::gradientTransform;
@ -64,7 +63,7 @@ public:
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedEnumeration> GradientUnits();
already_AddRefed<DOMSVGAnimatedTransformList> GradientTransform();
already_AddRefed<SVGAnimatedTransformList> GradientTransform();
already_AddRefed<nsIDOMSVGAnimatedEnumeration> SpreadMethod();
already_AddRefed<nsIDOMSVGAnimatedString> Href();
@ -82,7 +81,7 @@ protected:
static StringInfo sStringInfo[1];
// SVGGradientElement values
nsAutoPtr<SVGAnimatedTransformList> mGradientTransform;
nsAutoPtr<nsSVGAnimatedTransformList> mGradientTransform;
};
//---------------------Linear Gradients------------------------

View File

@ -5,9 +5,9 @@
#include "mozilla/Util.h"
#include "DOMSVGAnimatedTransformList.h"
#include "nsCOMPtr.h"
#include "nsGkAtoms.h"
#include "mozilla/dom/SVGAnimatedTransformList.h"
#include "mozilla/dom/SVGPatternElement.h"
#include "mozilla/dom/SVGPatternElementBinding.h"
@ -102,12 +102,12 @@ SVGPatternElement::PatternContentUnits()
return mEnumAttributes[PATTERNCONTENTUNITS].ToDOMAnimatedEnum(this);
}
already_AddRefed<DOMSVGAnimatedTransformList>
already_AddRefed<SVGAnimatedTransformList>
SVGPatternElement::PatternTransform()
{
// We're creating a DOM wrapper, so we must tell GetAnimatedTransformList
// to allocate the SVGAnimatedTransformList if it hasn't already done so:
return DOMSVGAnimatedTransformList::GetDOMWrapper(
return SVGAnimatedTransformList::GetDOMWrapper(
GetAnimatedTransformList(DO_ALLOCATE), this);
}
@ -165,11 +165,11 @@ SVGPatternElement::IsAttributeMapped(const nsIAtom* name) const
//----------------------------------------------------------------------
// nsSVGElement methods
SVGAnimatedTransformList*
nsSVGAnimatedTransformList*
SVGPatternElement::GetAnimatedTransformList(uint32_t aFlags)
{
if (!mPatternTransform && (aFlags & DO_ALLOCATE)) {
mPatternTransform = new SVGAnimatedTransformList();
mPatternTransform = new nsSVGAnimatedTransformList();
}
return mPatternTransform;
}

View File

@ -59,7 +59,7 @@ public:
// nsSVGSVGElement methods:
virtual bool HasValidDimensions() const;
virtual mozilla::SVGAnimatedTransformList*
virtual nsSVGAnimatedTransformList*
GetAnimatedTransformList(uint32_t aFlags = 0);
virtual nsIAtom* GetTransformListAttrName() const {
return nsGkAtoms::patternTransform;
@ -70,7 +70,7 @@ public:
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternUnits();
already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternContentUnits();
already_AddRefed<DOMSVGAnimatedTransformList> PatternTransform();
already_AddRefed<SVGAnimatedTransformList> PatternTransform();
already_AddRefed<SVGAnimatedLength> X();
already_AddRefed<SVGAnimatedLength> Y();
already_AddRefed<SVGAnimatedLength> Width();

View File

@ -25,7 +25,7 @@ namespace mozilla {
*/
class SVGTransformList
{
friend class SVGAnimatedTransformList;
friend class nsSVGAnimatedTransformList;
friend class DOMSVGTransformList;
friend class DOMSVGTransform;

View File

@ -3,10 +3,10 @@
* 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 "mozilla/dom/SVGAnimatedTransformList.h"
#include "mozilla/dom/SVGTransformableElement.h"
#include "mozilla/dom/SVGMatrix.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "DOMSVGAnimatedTransformList.h"
#include "nsContentUtils.h"
#include "nsIDOMMutationEvent.h"
#include "nsIFrame.h"
@ -23,12 +23,12 @@ namespace dom {
NS_IMPL_ISUPPORTS_INHERITED0(SVGTransformableElement, nsSVGElement)
already_AddRefed<DOMSVGAnimatedTransformList>
already_AddRefed<SVGAnimatedTransformList>
SVGTransformableElement::Transform()
{
// We're creating a DOM wrapper, so we must tell GetAnimatedTransformList
// to allocate the SVGAnimatedTransformList if it hasn't already done so:
return DOMSVGAnimatedTransformList::GetDOMWrapper(
return SVGAnimatedTransformList::GetDOMWrapper(
GetAnimatedTransformList(DO_ALLOCATE), this).get();
}
@ -139,11 +139,11 @@ SVGTransformableElement::SetAnimateMotionTransform(const gfxMatrix* aMatrix)
DidAnimateTransformList();
}
SVGAnimatedTransformList*
nsSVGAnimatedTransformList*
SVGTransformableElement::GetAnimatedTransformList(uint32_t aFlags)
{
if (!mTransforms && (aFlags & DO_ALLOCATE)) {
mTransforms = new SVGAnimatedTransformList();
mTransforms = new nsSVGAnimatedTransformList();
}
return mTransforms;
}

View File

@ -6,17 +6,16 @@
#ifndef SVGTransformableElement_h
#define SVGTransformableElement_h
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGElement.h"
#include "gfxMatrix.h"
#include "SVGAnimatedTransformList.h"
class nsIDOMSVGRect;
namespace mozilla {
class DOMSVGAnimatedTransformList;
namespace dom {
class SVGAnimatedTransformList;
class SVGGraphicsElement;
class SVGMatrix;
@ -30,7 +29,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// WebIDL
already_AddRefed<DOMSVGAnimatedTransformList> Transform();
already_AddRefed<SVGAnimatedTransformList> Transform();
nsSVGElement* GetNearestViewportElement();
nsSVGElement* GetFarthestViewportElement();
already_AddRefed<nsIDOMSVGRect> GetBBox(ErrorResult& rv);
@ -54,7 +53,7 @@ public:
virtual const gfxMatrix* GetAnimateMotionTransform() const;
virtual void SetAnimateMotionTransform(const gfxMatrix* aMatrix);
virtual SVGAnimatedTransformList*
virtual nsSVGAnimatedTransformList*
GetAnimatedTransformList(uint32_t aFlags = 0);
virtual nsIAtom* GetTransformListAttrName() const {
return nsGkAtoms::transform;
@ -63,7 +62,7 @@ public:
protected:
// nsSVGElement overrides
nsAutoPtr<SVGAnimatedTransformList> mTransforms;
nsAutoPtr<nsSVGAnimatedTransformList> mTransforms;
// XXX maybe move this to property table, to save space on un-animated elems?
nsAutoPtr<gfxMatrix> mAnimateMotionTransform;

View File

@ -24,6 +24,7 @@
#include "nsCSSProps.h"
#include "nsCSSParser.h"
#include "nsEventListenerManager.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGLength2.h"
#include "nsSVGNumber2.h"
#include "nsSVGNumberPair.h"
@ -38,7 +39,6 @@
#include "SVGAnimatedLengthList.h"
#include "SVGAnimatedPointList.h"
#include "SVGAnimatedPathSegList.h"
#include "SVGAnimatedTransformList.h"
#include "SVGContentUtils.h"
#include "nsIFrame.h"
#include <stdarg.h>
@ -589,8 +589,8 @@ nsSVGElement::ParseAttribute(int32_t aNamespaceID,
// Check for SVGAnimatedTransformList attribute
} else if (GetTransformListAttrName() == aAttribute) {
// The transform attribute is being set, so we must ensure that the
// SVGAnimatedTransformList is/has been allocated:
SVGAnimatedTransformList *transformList =
// nsSVGAnimatedTransformList is/has been allocated:
nsSVGAnimatedTransformList *transformList =
GetAnimatedTransformList(DO_ALLOCATE);
rv = transformList->SetBaseValueString(aValue);
if (NS_FAILED(rv)) {
@ -808,7 +808,7 @@ nsSVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsIAtom* aName,
// Check if this is a transform list attribute going away
if (GetTransformListAttrName() == aName) {
SVGAnimatedTransformList *transformList = GetAnimatedTransformList();
nsSVGAnimatedTransformList *transformList = GetAnimatedTransformList();
if (transformList) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
transformList->ClearBaseValue();

View File

@ -52,7 +52,7 @@ class SVGUserUnitList;
class SVGAnimatedPointList;
class SVGAnimatedPathSegList;
class SVGAnimatedPreserveAspectRatio;
class SVGAnimatedTransformList;
class nsSVGAnimatedTransformList;
class SVGStringList;
class DOMSVGStringList;
}
@ -77,7 +77,7 @@ public:
typedef mozilla::SVGAnimatedPointList SVGAnimatedPointList;
typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
typedef mozilla::SVGAnimatedTransformList SVGAnimatedTransformList;
typedef mozilla::nsSVGAnimatedTransformList nsSVGAnimatedTransformList;
typedef mozilla::SVGStringList SVGStringList;
// nsISupports
@ -262,18 +262,18 @@ public:
return nullptr;
}
/**
* Get the SVGAnimatedTransformList for this element.
* Get the nsSVGAnimatedTransformList for this element.
*
* Despite the fact that animated transform lists are used for a variety of
* attributes, no SVG element uses more than one.
*
* It's relatively uncommon for elements to have their transform attribute
* set, so to save memory the SVGAnimatedTransformList is not allocated until
* set, so to save memory the nsSVGAnimatedTransformList is not allocated until
* the attribute is set/animated or its DOM wrapper is created. Callers that
* require the SVGAnimatedTransformList to be allocated and for this method
* require the nsSVGAnimatedTransformList to be allocated and for this method
* to return non-null must pass the DO_ALLOCATE flag.
*/
virtual SVGAnimatedTransformList* GetAnimatedTransformList(
virtual nsSVGAnimatedTransformList* GetAnimatedTransformList(
uint32_t aFlags = 0) {
return nullptr;
}

View File

@ -667,8 +667,7 @@ DOMInterfaces = {
},
'SVGAnimatedTransformList': {
'nativeType': 'mozilla::DOMSVGAnimatedTransformList',
'headerFile': 'DOMSVGAnimatedTransformList.h'
# 'nativeOwnership': 'refcounted',
},
'SVGAnimationElement': {