author | Daniel Holbert <dholbert@cs.stanford.edu> |
Sun, 19 Dec 2010 16:45:29 -0800 | |
changeset 59470 | 9235ac6b60533387bee0974fa730e928da9506c0 |
parent 59469 | 5ce6da5198708af69b07c504935ad7837fecbbe8 |
child 59471 | 3480ad2e571fdaada2e73e49d541435c6355d320 |
push id | 17637 |
push user | dholbert@mozilla.com |
push date | Mon, 20 Dec 2010 00:53:32 +0000 |
treeherder | mozilla-central@150af817b65d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jwatt, roc |
bugs | 619516 |
milestone | 2.0b9pre |
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
|
--- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -162,17 +162,17 @@ nsSVGElement::Init() } nsSVGViewBox *viewBox = GetViewBox(); if (viewBox) { viewBox->Init(); } - nsSVGPreserveAspectRatio *preserveAspectRatio = + SVGAnimatedPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio(); if (preserveAspectRatio) { preserveAspectRatio->Init(); } LengthListAttributesInfo lengthListInfo = GetLengthListInfo(); @@ -531,19 +531,19 @@ nsSVGElement::ParseAttribute(PRInt32 aNa nsSVGViewBox* viewBox = GetViewBox(); if (viewBox) { rv = viewBox->SetBaseValueString(aValue, this, PR_FALSE); if (NS_FAILED(rv)) { viewBox->Init(); } 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); if (NS_FAILED(rv)) { preserveAspectRatio->Init(); } foundMatch = PR_TRUE; } @@ -754,17 +754,17 @@ nsSVGElement::UnsetAttr(PRInt32 aNamespa nsSVGViewBox* viewBox = GetViewBox(); if (viewBox) { viewBox->Init(); DidChangeViewBox(PR_FALSE); foundMatch = PR_TRUE; } // Check if this is a preserveAspectRatio attribute going away } else if (aName == nsGkAtoms::preserveAspectRatio) { - nsSVGPreserveAspectRatio *preserveAspectRatio = + SVGAnimatedPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio(); if (preserveAspectRatio) { preserveAspectRatio->Init(); DidChangePreserveAspectRatio(PR_FALSE); foundMatch = PR_TRUE; } } @@ -2071,29 +2071,30 @@ nsSVGElement::DidAnimateViewBox() if (frame) { frame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::viewBox, nsIDOMMutationEvent::MODIFICATION); } } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGElement::GetPreserveAspectRatio() { return nsnull; } void nsSVGElement::DidChangePreserveAspectRatio(PRBool aDoSetAttr) { if (!aDoSetAttr) return; - nsSVGPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio(); + SVGAnimatedPreserveAspectRatio *preserveAspectRatio = + GetPreserveAspectRatio(); NS_ASSERTION(preserveAspectRatio, "DidChangePreserveAspectRatio on element with no preserveAspectRatio attrib"); nsAutoString newStr; preserveAspectRatio->GetBaseValueString(newStr); SetAttr(kNameSpaceID_None, nsGkAtoms::preserveAspectRatio, @@ -2408,18 +2409,20 @@ nsSVGElement::GetAnimatedAttr(PRInt32 aN // viewBox: if (aName == nsGkAtoms::viewBox) { nsSVGViewBox *viewBox = GetViewBox(); return viewBox ? viewBox->ToSMILAttr(this) : nsnull; } // preserveAspectRatio: if (aName == nsGkAtoms::preserveAspectRatio) { - nsSVGPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio(); - return preserveAspectRatio ? preserveAspectRatio->ToSMILAttr(this) : nsnull; + SVGAnimatedPreserveAspectRatio *preserveAspectRatio = + GetPreserveAspectRatio(); + return preserveAspectRatio ? + preserveAspectRatio->ToSMILAttr(this) : nsnull; } // NumberLists: { NumberListAttributesInfo info = GetNumberListInfo(); for (PRUint32 i = 0; i < info.mNumberListCount; i++) { if (aName == *info.mNumberListInfo[i].mName) { NS_ABORT_IF_FALSE(i <= UCHAR_MAX, "Too many attributes");
--- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -74,18 +74,16 @@ namespace mozilla { class SVGAnimatedNumberList; class SVGNumberList; class SVGAnimatedLengthList; class SVGUserUnitList; class SVGAnimatedPointList; class SVGAnimatedPathSegList; class SVGAnimatedPreserveAspectRatio; } -// XXXdholbert TEMPORARY TYPEDEF -typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio; typedef nsStyledElement nsSVGElementBase; class nsSVGElement : public nsSVGElementBase, // nsIContent public nsISVGValueObserver // :nsISupportsWeakReference { protected: nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo); @@ -94,16 +92,17 @@ protected: public: typedef mozilla::SVGNumberList SVGNumberList; typedef mozilla::SVGAnimatedNumberList SVGAnimatedNumberList; typedef mozilla::SVGUserUnitList SVGUserUnitList; typedef mozilla::SVGAnimatedLengthList SVGAnimatedLengthList; typedef mozilla::SVGAnimatedPointList SVGAnimatedPointList; typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList; + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; // nsISupports NS_DECL_ISUPPORTS_INHERITED // nsIContent interface methods virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, @@ -461,17 +460,17 @@ protected: virtual NumberAttributesInfo GetNumberInfo(); virtual IntegerAttributesInfo GetIntegerInfo(); virtual AngleAttributesInfo GetAngleInfo(); virtual BooleanAttributesInfo GetBooleanInfo(); virtual EnumAttributesInfo GetEnumInfo(); // 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(); static nsSVGEnumMapping sSVGUnitTypesMap[]; private: /* read <number-optional-number> */
--- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -5341,25 +5341,25 @@ private: void Invalidate(); nsresult LoadSVGImage(PRBool aForce, PRBool aNotify); protected: virtual PRBool OperatesOnSRGB(nsSVGFilterInstance*, PRInt32, Image*) { return PR_TRUE; } - virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio(); + virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio(); virtual StringAttributesInfo GetStringInfo(); virtual void DidAnimateString(PRUint8 aAttrEnum); enum { RESULT, HREF }; nsSVGString mStringAttributes[2]; static StringInfo sStringInfo[2]; - nsSVGPreserveAspectRatio mPreserveAspectRatio; + SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; }; nsSVGElement::StringInfo nsSVGFEImageElement::sStringInfo[2] = { { &nsGkAtoms::result, kNameSpaceID_None, PR_TRUE }, { &nsGkAtoms::href, kNameSpaceID_XLink, PR_TRUE } }; @@ -5564,17 +5564,17 @@ nsSVGFEImageElement::ComputeTargetBBox(c // image bounds and compute an accurate bounding box for the filter // primitive result. return GetMaxRect(); } //---------------------------------------------------------------------- // nsSVGElement methods -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGFEImageElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGFEImageElement::GetStringInfo() {
--- a/content/svg/content/src/nsSVGImageElement.cpp +++ b/content/svg/content/src/nsSVGImageElement.cpp @@ -39,16 +39,18 @@ #include "nsSVGImageElement.h" #include "nsCOMPtr.h" #include "nsIURI.h" #include "nsNetUtil.h" #include "imgIContainer.h" #include "imgIDecoderObserver.h" #include "gfxContext.h" +using namespace mozilla; + nsSVGElement::LengthInfo nsSVGImageElement::sLengthInfo[4] = { { &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, { &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, }; @@ -253,17 +255,17 @@ nsSVGImageElement::ConstructPath(gfxCont nsSVGElement::LengthAttributesInfo nsSVGImageElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, NS_ARRAY_LENGTH(sLengthInfo)); } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGImageElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGImageElement::GetStringInfo() {
--- a/content/svg/content/src/nsSVGImageElement.h +++ b/content/svg/content/src/nsSVGImageElement.h @@ -58,16 +58,18 @@ class nsSVGImageElement : public nsSVGIm protected: friend nsresult NS_NewSVGImageElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsSVGImageElement(already_AddRefed<nsINodeInfo> aNodeInfo); virtual ~nsSVGImageElement(); public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; + // interfaces: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMSVGIMAGEELEMENT NS_DECL_NSIDOMSVGURIREFERENCE // xxx I wish we could use virtual inheritance NS_FORWARD_NSIDOMNODE(nsSVGImageElementBase::) @@ -94,24 +96,24 @@ public: void MaybeLoadSVGImage(); virtual nsXPCClassInfo* GetClassInfo(); protected: nsresult LoadSVGImage(PRBool aForce, PRBool aNotify); virtual LengthAttributesInfo GetLengthInfo(); - virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio(); + virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio(); virtual StringAttributesInfo GetStringInfo(); virtual void DidAnimateString(PRUint8 aAttrEnum); enum { X, Y, WIDTH, HEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; - nsSVGPreserveAspectRatio mPreserveAspectRatio; + SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; enum { HREF }; nsSVGString mStringAttributes[1]; static StringInfo sStringInfo[1]; }; #endif
--- a/content/svg/content/src/nsSVGMarkerElement.cpp +++ b/content/svg/content/src/nsSVGMarkerElement.cpp @@ -39,16 +39,18 @@ #include "nsISVGValueUtils.h" #include "nsSVGPreserveAspectRatio.h" #include "nsSVGMatrix.h" #include "nsDOMError.h" #include "nsSVGUtils.h" #include "nsSVGMarkerElement.h" #include "gfxMatrix.h" +using namespace mozilla; + nsSVGElement::LengthInfo nsSVGMarkerElement::sLengthInfo[4] = { { &nsGkAtoms::refX, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::refY, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, { &nsGkAtoms::markerWidth, 3, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::X }, { &nsGkAtoms::markerHeight, 3, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, nsSVGUtils::Y }, }; @@ -366,17 +368,17 @@ nsSVGMarkerElement::GetEnumInfo() } nsSVGViewBox * nsSVGMarkerElement::GetViewBox() { return &mViewBox; } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGMarkerElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } //---------------------------------------------------------------------- // public helpers
--- a/content/svg/content/src/nsSVGMarkerElement.h +++ b/content/svg/content/src/nsSVGMarkerElement.h @@ -106,16 +106,18 @@ class nsSVGMarkerElement : public nsSVGM friend class nsSVGMarkerFrame; protected: friend nsresult NS_NewSVGMarkerElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsSVGMarkerElement(already_AddRefed<nsINodeInfo> aNodeInfo); public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; + // interfaces: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMSVGMARKERELEMENT NS_DECL_NSIDOMSVGFITTOVIEWBOX // xxx I wish we could use virtual inheritance NS_FORWARD_NSIDOMNODE(nsSVGElement::) @@ -152,33 +154,33 @@ protected: nsAttrValue& aResult); void SetParentCoordCtxProvider(nsSVGSVGElement *aContext); virtual LengthAttributesInfo GetLengthInfo(); virtual AngleAttributesInfo GetAngleInfo(); virtual EnumAttributesInfo GetEnumInfo(); virtual nsSVGViewBox *GetViewBox(); - virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio(); + virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio(); enum { REFX, REFY, MARKERWIDTH, MARKERHEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; enum { MARKERUNITS }; nsSVGEnum mEnumAttributes[1]; static nsSVGEnumMapping sUnitsMap[]; static EnumInfo sEnumInfo[1]; enum { ORIENT }; nsSVGAngle mAngleAttributes[1]; static AngleInfo sAngleInfo[1]; nsSVGViewBox mViewBox; - nsSVGPreserveAspectRatio mPreserveAspectRatio; + SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; // derived properties (from 'orient') handled separately nsSVGOrientType mOrientType; nsSVGSVGElement *mCoordCtx; nsCOMPtr<nsIDOMSVGMatrix> mViewBoxToViewportTransform; };
--- a/content/svg/content/src/nsSVGPatternElement.cpp +++ b/content/svg/content/src/nsSVGPatternElement.cpp @@ -39,16 +39,18 @@ #include "nsSVGTransformList.h" #include "nsSVGAnimatedTransformList.h" #include "nsIDOMMutationEvent.h" #include "nsCOMPtr.h" #include "nsGkAtoms.h" #include "nsSVGPatternElement.h" #include "nsIFrame.h" +using namespace mozilla; + //--------------------- Patterns ------------------------ nsSVGElement::LengthInfo nsSVGPatternElement::sLengthInfo[4] = { { &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, { &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::X }, { &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, nsSVGUtils::Y }, @@ -266,17 +268,17 @@ nsSVGPatternElement::GetEnumInfo() } nsSVGViewBox * nsSVGPatternElement::GetViewBox() { return &mViewBox; } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGPatternElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } nsSVGElement::StringAttributesInfo nsSVGPatternElement::GetStringInfo() {
--- a/content/svg/content/src/nsSVGPatternElement.h +++ b/content/svg/content/src/nsSVGPatternElement.h @@ -63,16 +63,18 @@ class nsSVGPatternElement : public nsSVG friend class nsSVGPatternFrame; protected: friend nsresult NS_NewSVGPatternElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo); nsSVGPatternElement(already_AddRefed<nsINodeInfo> aNodeInfo); public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; + // interfaces: NS_DECL_ISUPPORTS_INHERITED // Pattern Element NS_DECL_NSIDOMSVGPATTERNELEMENT // URI Reference NS_DECL_NSIDOMSVGURIREFERENCE @@ -93,17 +95,17 @@ public: protected: virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName, const nsAString* aValue, PRBool aNotify); virtual LengthAttributesInfo GetLengthInfo(); virtual EnumAttributesInfo GetEnumInfo(); virtual nsSVGViewBox *GetViewBox(); - virtual nsSVGPreserveAspectRatio *GetPreserveAspectRatio(); + virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio(); virtual StringAttributesInfo GetStringInfo(); virtual void DidAnimateTransform(); // nsIDOMSVGPatternElement values enum { X, Y, WIDTH, HEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; @@ -116,15 +118,15 @@ protected: // nsIDOMSVGURIReference properties enum { HREF }; nsSVGString mStringAttributes[1]; static StringInfo sStringInfo[1]; // nsIDOMSVGFitToViewbox properties nsSVGViewBox mViewBox; - nsSVGPreserveAspectRatio mPreserveAspectRatio; + SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; // helper nsresult CreateTransformList(); }; #endif
--- a/content/svg/content/src/nsSVGPreserveAspectRatio.h +++ b/content/svg/content/src/nsSVGPreserveAspectRatio.h @@ -238,12 +238,9 @@ public: virtual void ClearAnimValue(); virtual nsresult SetAnimValue(const nsSMILValue& aValue); }; #endif // MOZ_SMIL }; } // namespace mozilla -// XXXdholbert TEMPORARY TYPEDEF -typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio; - #endif //__NS_SVGPRESERVEASPECTRATIO_H__
--- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -1223,17 +1223,17 @@ nsSVGSVGElement::DidChangePreserveAspect void nsSVGSVGElement::DidAnimatePreserveAspectRatio() { nsSVGSVGElementBase::DidAnimatePreserveAspectRatio(); InvalidateTransformNotifyFrame(); } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGSVGElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } #ifndef MOZ_ENABLE_LIBXUL // XXXdholbert HACK -- see comment w/ this method's declaration in header file. void
--- a/content/svg/content/src/nsSVGSVGElement.h +++ b/content/svg/content/src/nsSVGSVGElement.h @@ -134,16 +134,17 @@ class nsSVGSVGElement : public nsSVGSVGE protected: friend nsresult NS_NewSVGSVGElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo, mozilla::dom::FromParser aFromParser); nsSVGSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo, mozilla::dom::FromParser aFromParser); public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; // interfaces: NS_DECL_ISUPPORTS_INHERITED #ifdef MOZ_SMIL NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGSVGElement, nsSVGSVGElementBase) #endif // MOZ_SMIL NS_DECL_NSIDOMSVGSVGELEMENT NS_DECL_NSIDOMSVGFITTOVIEWBOX @@ -275,22 +276,22 @@ protected: virtual EnumAttributesInfo GetEnumInfo(); enum { ZOOMANDPAN }; nsSVGEnum mEnumAttributes[1]; static nsSVGEnumMapping sZoomAndPanMap[]; 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: // // http://www.w3.org/TR/SVG11/coords.html#ViewportSpace // // XXXjwatt Currently only used for outer <svg>, but maybe we could use -1 to // flag this as an inner <svg> to save the overhead of GetCtx calls?
--- a/content/svg/content/src/nsSVGSymbolElement.cpp +++ b/content/svg/content/src/nsSVGSymbolElement.cpp @@ -36,16 +36,17 @@ #include "nsIDOMSVGSymbolElement.h" #include "nsSVGStylableElement.h" #include "nsSVGViewBox.h" #include "nsSVGPreserveAspectRatio.h" #include "nsIDOMSVGFitToViewBox.h" #include "nsGkAtoms.h" +using namespace mozilla; typedef nsSVGStylableElement nsSVGSymbolElementBase; class nsSVGSymbolElement : public nsSVGSymbolElementBase, public nsIDOMSVGFitToViewBox, public nsIDOMSVGSymbolElement { protected: friend nsresult NS_NewSVGSymbolElement(nsIContent **aResult, @@ -67,20 +68,20 @@ public: // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* name) const; virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; 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) //---------------------------------------------------------------------- // nsISupports methods NS_IMPL_ADDREF_INHERITED(nsSVGSymbolElement,nsSVGSymbolElementBase) @@ -154,13 +155,13 @@ nsSVGSymbolElement::IsAttributeMapped(co // nsSVGElement methods nsSVGViewBox * nsSVGSymbolElement::GetViewBox() { return &mViewBox; } -nsSVGPreserveAspectRatio * +SVGAnimatedPreserveAspectRatio * nsSVGSymbolElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; }
--- a/layout/svg/base/src/nsSVGPatternFrame.cpp +++ b/layout/svg/base/src/nsSVGPatternFrame.cpp @@ -51,16 +51,17 @@ #include "nsSVGPatternElement.h" #include "nsSVGGeometryFrame.h" #include "nsSVGPatternFrame.h" #include "gfxContext.h" #include "gfxPlatform.h" #include "gfxPattern.h" #include "gfxMatrix.h" +using namespace mozilla; //---------------------------------------------------------------------- // Implementation nsSVGPatternFrame::nsSVGPatternFrame(nsStyleContext* aContext) : nsSVGPatternFrameBase(aContext), mLoopFlag(PR_FALSE), mNoHRefURI(PR_FALSE) @@ -378,17 +379,17 @@ const nsSVGViewBox & nsSVGPatternFrame::GetViewBox() { nsSVGPatternElement *patternElement = GetPatternWithAttr(nsGkAtoms::viewBox, mContent); return patternElement->mViewBox; } -const nsSVGPreserveAspectRatio & +const SVGAnimatedPreserveAspectRatio & nsSVGPatternFrame::GetPreserveAspectRatio() { nsSVGPatternElement *patternElement = GetPatternWithAttr(nsGkAtoms::preserveAspectRatio, mContent); return patternElement->mPreserveAspectRatio; }
--- a/layout/svg/base/src/nsSVGPatternFrame.h +++ b/layout/svg/base/src/nsSVGPatternFrame.h @@ -44,21 +44,19 @@ #include "gfxMatrix.h" class nsIFrame; class nsSVGLength2; class nsSVGElement; class gfxContext; class gfxASurface; -// XXXdholbert TEMPORARY TYPEDEF namespace mozilla { class SVGAnimatedPreserveAspectRatio; -} -typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio; +} // namespace mozilla typedef nsSVGPaintServerFrame nsSVGPatternFrameBase; /** * Patterns can refer to other patterns. We create an nsSVGPaintingProperty * with property type nsGkAtoms::href to track the referenced pattern. */ class nsSVGPatternFrame : public nsSVGPatternFrameBase @@ -73,16 +71,18 @@ public: // nsSVGPaintServerFrame methods: virtual already_AddRefed<gfxPattern> GetPaintServerPattern(nsIFrame *aSource, float aOpacity, const gfxRect *aOverrideBounds); public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; + // nsSVGContainerFrame methods: virtual gfxMatrix GetCanvasTM(); // nsIFrame interface: virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext); NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, @@ -122,17 +122,17 @@ protected: const nsSVGLength2 *GetWidth(); const nsSVGLength2 *GetHeight(); PRUint16 GetPatternUnits(); PRUint16 GetPatternContentUnits(); gfxMatrix GetPatternTransform(); const nsSVGViewBox &GetViewBox(); - const nsSVGPreserveAspectRatio &GetPreserveAspectRatio(); + const SVGAnimatedPreserveAspectRatio &GetPreserveAspectRatio(); nsresult PaintPattern(gfxASurface **surface, gfxMatrix *patternMatrix, nsIFrame *aSource, float aGraphicOpacity, const gfxRect *aOverrideBounds); NS_IMETHOD GetPatternFirstChild(nsIFrame **kid);
--- a/layout/svg/base/src/nsSVGUtils.cpp +++ b/layout/svg/base/src/nsSVGUtils.cpp @@ -86,16 +86,17 @@ #include "nsSVGFilterPaintCallback.h" #include "nsSVGGeometryFrame.h" #include "nsComputedDOMStyle.h" #include "nsSVGPathGeometryFrame.h" #include "prdtoa.h" #include "mozilla/dom/Element.h" #include "gfxUtils.h" +using namespace mozilla; using namespace mozilla::dom; gfxASurface *nsSVGUtils::gThebesComputationalSurface = nsnull; // c = n / 255 // (c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1 / 2.4) - 0.055) * 255 + 0.5 static const PRUint8 glinearRGBTosRGBMap[256] = { 0, 13, 22, 28, 34, 38, 42, 46, @@ -774,17 +775,17 @@ nsSVGUtils::GetOuterSVGFrameAndCoveredRe return GetOuterSVGFrame(aFrame); } gfxMatrix 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!"); PRUint16 align = aPreserveAspectRatio.GetAnimValue().GetAlign(); PRUint16 meetOrSlice = aPreserveAspectRatio.GetAnimValue().GetMeetOrSlice(); // default to the defaults
--- a/layout/svg/base/src/nsSVGUtils.h +++ b/layout/svg/base/src/nsSVGUtils.h @@ -81,19 +81,16 @@ class nsSVGDisplayContainerFrame; namespace mozilla { class SVGAnimatedPreserveAspectRatio; namespace dom { class Element; } // namespace dom } // namespace mozilla -// XXXdholbert TEMPORARY TYPEDEF -typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio; - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif // SVG Frame state bits #define NS_STATE_IS_OUTER_SVG NS_FRAME_STATE_BIT(20) #define NS_STATE_SVG_DIRTY NS_FRAME_STATE_BIT(21) @@ -217,16 +214,18 @@ public: virtual void Invalidate() = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGFilterProperty, NS_ISVGFILTERPROPERTY_IID) class nsSVGUtils { public: + typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; + /* * Get the parent element of an nsIContent */ static mozilla::dom::Element *GetParentElement(nsIContent *aContent); /* * Get the number of CSS px (user units) per em (i.e. the em-height in user * units) for an nsIContent @@ -381,17 +380,17 @@ public: /* Generate a viewbox to viewport tranformation matrix */ static gfxMatrix GetViewBoxTransform(nsSVGElement* aElement, 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 */ static void PaintFrameWithEffects(nsSVGRenderState *aContext, const nsIntRect *aDirtyRect, nsIFrame *aFrame);