Bug 619516 Patch 2: Update clients of nsSVGPreserveAspectRatio with new class name. r=jwatt a=roc

This commit is contained in:
Daniel Holbert 2010-12-19 16:45:29 -08:00
parent 61a096d4a4
commit 725fb5d939
17 changed files with 58 additions and 44 deletions

View File

@ -167,7 +167,7 @@ nsSVGElement::Init()
viewBox->Init();
}
nsSVGPreserveAspectRatio *preserveAspectRatio =
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
@ -536,9 +536,9 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
}
foundMatch = PR_TRUE;
}
// Check for nsSVGPreserveAspectRatio attribute
// Check for SVGAnimatedPreserveAspectRatio attribute
} else if (aAttribute == nsGkAtoms::preserveAspectRatio) {
nsSVGPreserveAspectRatio *preserveAspectRatio =
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
rv = preserveAspectRatio->SetBaseValueString(aValue, this, PR_FALSE);
@ -759,7 +759,7 @@ nsSVGElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
}
// Check if this is a preserveAspectRatio attribute going away
} else if (aName == nsGkAtoms::preserveAspectRatio) {
nsSVGPreserveAspectRatio *preserveAspectRatio =
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
@ -2076,7 +2076,7 @@ nsSVGElement::DidAnimateViewBox()
}
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGElement::GetPreserveAspectRatio()
{
return nsnull;
@ -2088,7 +2088,8 @@ nsSVGElement::DidChangePreserveAspectRatio(PRBool aDoSetAttr)
if (!aDoSetAttr)
return;
nsSVGPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio();
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
NS_ASSERTION(preserveAspectRatio,
"DidChangePreserveAspectRatio on element with no preserveAspectRatio attrib");
@ -2413,8 +2414,10 @@ nsSVGElement::GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName)
// preserveAspectRatio:
if (aName == nsGkAtoms::preserveAspectRatio) {
nsSVGPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio();
return preserveAspectRatio ? preserveAspectRatio->ToSMILAttr(this) : nsnull;
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
return preserveAspectRatio ?
preserveAspectRatio->ToSMILAttr(this) : nsnull;
}
// NumberLists:

View File

@ -79,8 +79,6 @@ class SVGAnimatedPointList;
class SVGAnimatedPathSegList;
class SVGAnimatedPreserveAspectRatio;
}
// XXXdholbert TEMPORARY TYPEDEF
typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
typedef nsStyledElement nsSVGElementBase;
@ -99,6 +97,7 @@ public:
typedef mozilla::SVGAnimatedLengthList SVGAnimatedLengthList;
typedef mozilla::SVGAnimatedPointList SVGAnimatedPointList;
typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -466,7 +465,7 @@ protected:
// We assume all viewboxes and preserveAspectRatios are alike
// so we don't need to wrap the class
virtual nsSVGViewBox *GetViewBox();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
virtual NumberListAttributesInfo GetNumberListInfo();
virtual LengthListAttributesInfo GetLengthListInfo();
virtual StringAttributesInfo GetStringInfo();

View File

@ -5346,7 +5346,7 @@ protected:
virtual PRBool OperatesOnSRGB(nsSVGFilterInstance*,
PRInt32, Image*) { return PR_TRUE; }
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
virtual StringAttributesInfo GetStringInfo();
virtual void DidAnimateString(PRUint8 aAttrEnum);
@ -5354,7 +5354,7 @@ protected:
nsSVGString mStringAttributes[2];
static StringInfo sStringInfo[2];
nsSVGPreserveAspectRatio mPreserveAspectRatio;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
};
nsSVGElement::StringInfo nsSVGFEImageElement::sStringInfo[2] =
@ -5569,7 +5569,7 @@ nsSVGFEImageElement::ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
//----------------------------------------------------------------------
// nsSVGElement methods
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGFEImageElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -44,6 +44,8 @@
#include "imgIDecoderObserver.h"
#include "gfxContext.h"
using namespace mozilla;
nsSVGElement::LengthInfo nsSVGImageElement::sLengthInfo[4] =
{
{ &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X },
@ -258,7 +260,7 @@ nsSVGImageElement::GetLengthInfo()
NS_ARRAY_LENGTH(sLengthInfo));
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGImageElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -63,6 +63,8 @@ protected:
virtual ~nsSVGImageElement();
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
@ -99,7 +101,7 @@ protected:
nsresult LoadSVGImage(PRBool aForce, PRBool aNotify);
virtual LengthAttributesInfo GetLengthInfo();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
virtual StringAttributesInfo GetStringInfo();
virtual void DidAnimateString(PRUint8 aAttrEnum);
@ -107,7 +109,7 @@ protected:
nsSVGLength2 mLengthAttributes[4];
static LengthInfo sLengthInfo[4];
nsSVGPreserveAspectRatio mPreserveAspectRatio;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
enum { HREF };
nsSVGString mStringAttributes[1];

View File

@ -44,6 +44,8 @@
#include "nsSVGMarkerElement.h"
#include "gfxMatrix.h"
using namespace mozilla;
nsSVGElement::LengthInfo nsSVGMarkerElement::sLengthInfo[4] =
{
{ &nsGkAtoms::refX, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X },
@ -371,7 +373,7 @@ nsSVGMarkerElement::GetViewBox()
return &mViewBox;
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGMarkerElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -111,6 +111,8 @@ protected:
nsSVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo);
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
@ -157,7 +159,7 @@ protected:
virtual AngleAttributesInfo GetAngleInfo();
virtual EnumAttributesInfo GetEnumInfo();
virtual nsSVGViewBox *GetViewBox();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
enum { REFX, REFY, MARKERWIDTH, MARKERHEIGHT };
nsSVGLength2 mLengthAttributes[4];
@ -173,7 +175,7 @@ protected:
static AngleInfo sAngleInfo[1];
nsSVGViewBox mViewBox;
nsSVGPreserveAspectRatio mPreserveAspectRatio;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
// derived properties (from 'orient') handled separately
nsSVGOrientType mOrientType;

View File

@ -44,6 +44,8 @@
#include "nsSVGPatternElement.h"
#include "nsIFrame.h"
using namespace mozilla;
//--------------------- Patterns ------------------------
nsSVGElement::LengthInfo nsSVGPatternElement::sLengthInfo[4] =
@ -271,7 +273,7 @@ nsSVGPatternElement::GetViewBox()
return &mViewBox;
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGPatternElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -68,6 +68,8 @@ protected:
nsSVGPatternElement(already_AddRefed<nsINodeInfo> aNodeInfo);
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
@ -98,7 +100,7 @@ protected:
virtual LengthAttributesInfo GetLengthInfo();
virtual EnumAttributesInfo GetEnumInfo();
virtual nsSVGViewBox *GetViewBox();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
virtual StringAttributesInfo GetStringInfo();
virtual void DidAnimateTransform();
@ -121,7 +123,7 @@ protected:
// nsIDOMSVGFitToViewbox properties
nsSVGViewBox mViewBox;
nsSVGPreserveAspectRatio mPreserveAspectRatio;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
// helper
nsresult CreateTransformList();

View File

@ -243,7 +243,4 @@ public:
} // namespace mozilla
// XXXdholbert TEMPORARY TYPEDEF
typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
#endif //__NS_SVGPRESERVEASPECTRATIO_H__

View File

@ -1228,7 +1228,7 @@ nsSVGSVGElement::DidAnimatePreserveAspectRatio()
InvalidateTransformNotifyFrame();
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGSVGElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -139,6 +139,7 @@ protected:
mozilla::dom::FromParser aFromParser);
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
@ -280,12 +281,12 @@ protected:
static EnumInfo sEnumInfo[1];
virtual nsSVGViewBox *GetViewBox();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
nsSVGViewBox mViewBox;
nsSVGPreserveAspectRatio mPreserveAspectRatio;
nsSVGViewBox mViewBox;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
nsSVGSVGElement *mCoordCtx;
nsSVGSVGElement *mCoordCtx;
// The size of the rectangular SVG viewport into which we render. This is
// not (necessarily) the same as the content area. See:

View File

@ -41,6 +41,7 @@
#include "nsIDOMSVGFitToViewBox.h"
#include "nsGkAtoms.h"
using namespace mozilla;
typedef nsSVGStylableElement nsSVGSymbolElementBase;
class nsSVGSymbolElement : public nsSVGSymbolElementBase,
@ -72,10 +73,10 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
protected:
virtual nsSVGViewBox *GetViewBox();
virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio();
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
nsSVGViewBox mViewBox;
nsSVGPreserveAspectRatio mPreserveAspectRatio;
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
};
NS_IMPL_NS_NEW_SVG_ELEMENT(Symbol)
@ -159,7 +160,7 @@ nsSVGSymbolElement::GetViewBox()
return &mViewBox;
}
nsSVGPreserveAspectRatio *
SVGAnimatedPreserveAspectRatio *
nsSVGSymbolElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;

View File

@ -56,6 +56,7 @@
#include "gfxPattern.h"
#include "gfxMatrix.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Implementation
@ -383,7 +384,7 @@ nsSVGPatternFrame::GetViewBox()
return patternElement->mViewBox;
}
const nsSVGPreserveAspectRatio &
const SVGAnimatedPreserveAspectRatio &
nsSVGPatternFrame::GetPreserveAspectRatio()
{
nsSVGPatternElement *patternElement =

View File

@ -49,11 +49,9 @@ class nsSVGElement;
class gfxContext;
class gfxASurface;
// XXXdholbert TEMPORARY TYPEDEF
namespace mozilla {
class SVGAnimatedPreserveAspectRatio;
}
typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
} // namespace mozilla
typedef nsSVGPaintServerFrame nsSVGPatternFrameBase;
@ -78,6 +76,8 @@ public:
const gfxRect *aOverrideBounds);
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
// nsSVGContainerFrame methods:
virtual gfxMatrix GetCanvasTM();
@ -127,7 +127,7 @@ protected:
gfxMatrix GetPatternTransform();
const nsSVGViewBox &GetViewBox();
const nsSVGPreserveAspectRatio &GetPreserveAspectRatio();
const SVGAnimatedPreserveAspectRatio &GetPreserveAspectRatio();
nsresult PaintPattern(gfxASurface **surface,

View File

@ -91,6 +91,7 @@
#include "mozilla/dom/Element.h"
#include "gfxUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
gfxASurface *nsSVGUtils::gThebesComputationalSurface = nsnull;
@ -779,7 +780,7 @@ nsSVGUtils::GetViewBoxTransform(nsSVGElement* aElement,
float aViewportWidth, float aViewportHeight,
float aViewboxX, float aViewboxY,
float aViewboxWidth, float aViewboxHeight,
const nsSVGPreserveAspectRatio &aPreserveAspectRatio)
const SVGAnimatedPreserveAspectRatio &aPreserveAspectRatio)
{
NS_ASSERTION(aViewboxWidth > 0, "viewBox width must be greater than zero!");
NS_ASSERTION(aViewboxHeight > 0, "viewBox height must be greater than zero!");

View File

@ -86,9 +86,6 @@ class Element;
} // namespace dom
} // namespace mozilla
// XXXdholbert TEMPORARY TYPEDEF
typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
@ -222,6 +219,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGFilterProperty, NS_ISVGFILTERPROPERTY_IID)
class nsSVGUtils
{
public:
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
/*
* Get the parent element of an nsIContent
*/
@ -386,7 +385,7 @@ public:
float aViewportWidth, float aViewportHeight,
float aViewboxX, float aViewboxY,
float aViewboxWidth, float aViewboxHeight,
const nsSVGPreserveAspectRatio &aPreserveAspectRatio);
const SVGAnimatedPreserveAspectRatio &aPreserveAspectRatio);
/* Paint SVG frame with SVG effects - aDirtyRect is the area being
* redrawn, in device pixel coordinates relative to the outer svg */