From 3d04ba9c9e72b8534f8ef2da512d65f6d7df49d5 Mon Sep 17 00:00:00 2001 From: longsonr Date: Fri, 21 Dec 2018 08:58:14 +0000 Subject: [PATCH] Bug 1515187 - Part 4 Rename nsSVGElement to SVGElement and put it in the mozilla:dom namespace r=dholbert --HG-- rename : dom/svg/nsSVGElement.cpp => dom/svg/SVGElement.cpp rename : dom/svg/nsSVGElement.h => dom/svg/SVGElement.h --- dom/base/Element.cpp | 4 +- dom/base/nsDocument.cpp | 2 +- dom/base/nsIDocument.h | 9 +- dom/bindings/Bindings.conf | 4 - dom/smil/test/db_smilMappedAttrList.js | 2 +- dom/svg/DOMSVGAnimatedLengthList.cpp | 4 +- dom/svg/DOMSVGAnimatedLengthList.h | 12 +- dom/svg/DOMSVGAnimatedNumberList.cpp | 4 +- dom/svg/DOMSVGAnimatedNumberList.h | 11 +- dom/svg/DOMSVGLength.cpp | 9 +- dom/svg/DOMSVGLength.h | 14 +- dom/svg/DOMSVGLengthList.cpp | 2 +- dom/svg/DOMSVGLengthList.h | 8 +- dom/svg/DOMSVGNumber.cpp | 2 +- dom/svg/DOMSVGNumber.h | 8 +- dom/svg/DOMSVGNumberList.cpp | 2 +- dom/svg/DOMSVGNumberList.h | 8 +- dom/svg/DOMSVGPathSeg.cpp | 2 +- dom/svg/DOMSVGPathSeg.h | 8 +- dom/svg/DOMSVGPathSegList.cpp | 4 +- dom/svg/DOMSVGPathSegList.h | 10 +- dom/svg/DOMSVGPoint.cpp | 2 +- dom/svg/DOMSVGPoint.h | 5 +- dom/svg/DOMSVGPointList.cpp | 4 +- dom/svg/DOMSVGPointList.h | 13 +- dom/svg/DOMSVGStringList.cpp | 2 +- dom/svg/DOMSVGStringList.h | 10 +- dom/svg/DOMSVGTransformList.cpp | 2 +- dom/svg/DOMSVGTransformList.h | 5 +- dom/svg/SVGAElement.cpp | 6 +- dom/svg/SVGAngle.h | 8 +- dom/svg/SVGAnimateMotionElement.h | 2 +- dom/svg/SVGAnimatedAngle.h | 8 +- dom/svg/SVGAnimatedBoolean.h | 8 +- dom/svg/SVGAnimatedEnumeration.h | 8 +- dom/svg/SVGAnimatedInteger.h | 8 +- dom/svg/SVGAnimatedLength.h | 8 +- dom/svg/SVGAnimatedLengthList.cpp | 10 +- dom/svg/SVGAnimatedLengthList.h | 12 +- dom/svg/SVGAnimatedNumber.h | 8 +- dom/svg/SVGAnimatedNumberList.cpp | 10 +- dom/svg/SVGAnimatedNumberList.h | 12 +- dom/svg/SVGAnimatedPathSegList.cpp | 10 +- dom/svg/SVGAnimatedPathSegList.h | 12 +- dom/svg/SVGAnimatedPointList.cpp | 11 +- dom/svg/SVGAnimatedPointList.h | 12 +- dom/svg/SVGAnimatedPreserveAspectRatio.cpp | 11 +- dom/svg/SVGAnimatedPreserveAspectRatio.h | 26 +- dom/svg/SVGAnimatedRect.cpp | 4 +- dom/svg/SVGAnimatedRect.h | 8 +- dom/svg/SVGAnimatedString.h | 8 +- dom/svg/SVGAnimatedTransformList.cpp | 2 +- dom/svg/SVGAnimatedTransformList.h | 10 +- dom/svg/SVGAnimationElement.cpp | 4 +- dom/svg/SVGAnimationElement.h | 12 +- dom/svg/SVGCircleElement.cpp | 6 +- dom/svg/SVGClipPathElement.cpp | 4 +- dom/svg/SVGContentUtils.cpp | 20 +- dom/svg/SVGContentUtils.h | 13 +- dom/svg/SVGDescElement.h | 6 +- dom/svg/SVGDocument.cpp | 2 +- dom/svg/SVGDocument.h | 3 +- dom/svg/{nsSVGElement.cpp => SVGElement.cpp} | 424 ++++++++++--------- dom/svg/{nsSVGElement.h => SVGElement.h} | 48 ++- dom/svg/SVGEllipseElement.cpp | 6 +- dom/svg/SVGFEBlendElement.cpp | 10 +- dom/svg/SVGFEColorMatrixElement.cpp | 14 +- dom/svg/SVGFEComponentTransferElement.cpp | 6 +- dom/svg/SVGFECompositeElement.cpp | 14 +- dom/svg/SVGFEConvolveMatrixElement.cpp | 38 +- dom/svg/SVGFEDisplacementMapElement.cpp | 16 +- dom/svg/SVGFEDistantLightElement.cpp | 6 +- dom/svg/SVGFEDropShadowElement.cpp | 14 +- dom/svg/SVGFEFloodElement.cpp | 6 +- dom/svg/SVGFEGaussianBlurElement.cpp | 10 +- dom/svg/SVGFEImageElement.cpp | 6 +- dom/svg/SVGFEMergeElement.cpp | 6 +- dom/svg/SVGFEMergeNodeElement.cpp | 6 +- dom/svg/SVGFEMorphologyElement.cpp | 14 +- dom/svg/SVGFEOffsetElement.cpp | 10 +- dom/svg/SVGFEPointLightElement.cpp | 6 +- dom/svg/SVGFESpecularLightingElement.cpp | 2 +- dom/svg/SVGFESpotLightElement.cpp | 6 +- dom/svg/SVGFETileElement.cpp | 8 +- dom/svg/SVGFETurbulenceElement.cpp | 22 +- dom/svg/SVGFilterElement.cpp | 14 +- dom/svg/SVGFilterElement.h | 6 +- dom/svg/SVGForeignObjectElement.cpp | 8 +- dom/svg/SVGForeignObjectElement.h | 2 +- dom/svg/SVGGeometryElement.cpp | 6 +- dom/svg/SVGGeometryElement.h | 2 +- dom/svg/SVGGradientElement.cpp | 24 +- dom/svg/SVGGradientElement.h | 4 +- dom/svg/SVGGraphicsElement.h | 2 +- dom/svg/SVGImageElement.cpp | 10 +- dom/svg/SVGLength.cpp | 15 +- dom/svg/SVGLength.h | 16 +- dom/svg/SVGLengthList.cpp | 2 +- dom/svg/SVGLengthList.h | 15 +- dom/svg/SVGLineElement.cpp | 6 +- dom/svg/SVGMPathElement.cpp | 6 +- dom/svg/SVGMPathElement.h | 6 +- dom/svg/SVGMarkerElement.cpp | 20 +- dom/svg/SVGMarkerElement.h | 10 +- dom/svg/SVGMaskElement.cpp | 10 +- dom/svg/SVGMaskElement.h | 4 +- dom/svg/SVGMetadataElement.h | 6 +- dom/svg/SVGMotionSMILAnimationFunction.cpp | 2 +- dom/svg/SVGMotionSMILAttr.cpp | 2 +- dom/svg/SVGMotionSMILAttr.h | 6 +- dom/svg/SVGMotionSMILPathUtils.h | 10 +- dom/svg/SVGNumberList.h | 10 +- dom/svg/SVGPathData.h | 10 +- dom/svg/SVGPathElement.cpp | 2 +- dom/svg/SVGPatternElement.cpp | 14 +- dom/svg/SVGPatternElement.h | 4 +- dom/svg/SVGPointList.h | 10 +- dom/svg/SVGPolyElement.cpp | 2 +- dom/svg/SVGPolyElement.h | 2 +- dom/svg/SVGPreserveAspectRatio.h | 8 +- dom/svg/SVGRect.cpp | 2 +- dom/svg/SVGRect.h | 2 +- dom/svg/SVGRectElement.cpp | 6 +- dom/svg/SVGSVGElement.cpp | 6 +- dom/svg/SVGSVGElement.h | 2 +- dom/svg/SVGScriptElement.cpp | 6 +- dom/svg/SVGScriptElement.h | 4 +- dom/svg/SVGStopElement.cpp | 6 +- dom/svg/SVGStopElement.h | 6 +- dom/svg/SVGStyleElement.h | 6 +- dom/svg/SVGTSpanElement.cpp | 4 +- dom/svg/SVGTests.h | 7 +- dom/svg/SVGTextContentElement.cpp | 4 +- dom/svg/SVGTextElement.cpp | 4 +- dom/svg/SVGTextPathElement.cpp | 16 +- dom/svg/SVGTextPositioningElement.cpp | 8 +- dom/svg/SVGTitleElement.h | 6 +- dom/svg/SVGTransform.h | 5 +- dom/svg/SVGTransformableElement.cpp | 10 +- dom/svg/SVGTransformableElement.h | 12 +- dom/svg/SVGUseElement.cpp | 14 +- dom/svg/SVGUseElement.h | 2 +- dom/svg/SVGViewElement.cpp | 6 +- dom/svg/SVGViewElement.h | 8 +- dom/svg/SVGViewportElement.cpp | 12 +- dom/svg/SVGViewportElement.h | 2 +- dom/svg/moz.build | 4 +- dom/svg/nsISVGPoint.cpp | 2 +- dom/svg/nsSVGAngle.cpp | 20 +- dom/svg/nsSVGAngle.h | 30 +- dom/svg/nsSVGAnimatedTransformList.cpp | 14 +- dom/svg/nsSVGAnimatedTransformList.h | 16 +- dom/svg/nsSVGBoolean.cpp | 12 +- dom/svg/nsSVGBoolean.h | 18 +- dom/svg/nsSVGClass.cpp | 18 +- dom/svg/nsSVGClass.h | 21 +- dom/svg/nsSVGEnum.cpp | 20 +- dom/svg/nsSVGEnum.h | 24 +- dom/svg/nsSVGFilters.cpp | 37 +- dom/svg/nsSVGFilters.h | 15 +- dom/svg/nsSVGInteger.cpp | 10 +- dom/svg/nsSVGInteger.h | 21 +- dom/svg/nsSVGIntegerPair.cpp | 14 +- dom/svg/nsSVGIntegerPair.h | 25 +- dom/svg/nsSVGLength2.cpp | 28 +- dom/svg/nsSVGLength2.h | 45 +- dom/svg/nsSVGNumber2.cpp | 12 +- dom/svg/nsSVGNumber2.h | 21 +- dom/svg/nsSVGNumberPair.cpp | 14 +- dom/svg/nsSVGNumberPair.h | 23 +- dom/svg/nsSVGString.cpp | 12 +- dom/svg/nsSVGString.h | 22 +- dom/svg/nsSVGViewBox.cpp | 14 +- dom/svg/nsSVGViewBox.h | 32 +- layout/base/nsLayoutUtils.cpp | 2 +- layout/painting/nsDisplayList.cpp | 4 +- layout/style/GeckoBindings.cpp | 6 +- layout/svg/SVGGeometryFrame.cpp | 10 +- layout/svg/SVGTextFrame.cpp | 8 +- layout/svg/nsCSSClipPathInstance.cpp | 2 +- layout/svg/nsFilterInstance.cpp | 2 +- layout/svg/nsSVGClipPathFrame.cpp | 6 +- layout/svg/nsSVGContainerFrame.cpp | 19 +- layout/svg/nsSVGFilterFrame.cpp | 2 +- layout/svg/nsSVGForeignObjectFrame.cpp | 8 +- layout/svg/nsSVGGFrame.cpp | 2 +- layout/svg/nsSVGIntegrationUtils.cpp | 4 +- layout/svg/nsSVGMarkerFrame.cpp | 2 +- layout/svg/nsSVGMaskFrame.cpp | 2 +- layout/svg/nsSVGPatternFrame.cpp | 4 +- layout/svg/nsSVGSwitchFrame.cpp | 8 +- layout/svg/nsSVGUtils.cpp | 33 +- layout/svg/nsSVGUtils.h | 6 +- layout/svg/nsSVGViewportFrame.cpp | 2 +- 194 files changed, 1150 insertions(+), 1130 deletions(-) rename dom/svg/{nsSVGElement.cpp => SVGElement.cpp} (84%) rename dom/svg/{nsSVGElement.h => SVGElement.h} (96%) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 0a39f629c03d..dc763513db3f 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -83,7 +83,7 @@ #ifdef MOZ_XUL #include "nsXULElement.h" #endif /* MOZ_XUL */ -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsFrameSelection.h" #ifdef DEBUG #include "nsRange.h" @@ -213,7 +213,7 @@ nsAtom* nsIContent::DoGetID() const { const nsAttrValue* Element::GetSVGAnimatedClass() const { MOZ_ASSERT(MayHaveClass() && IsSVGElement(), "Unexpected call"); - return static_cast(this)->GetAnimatedClassName(); + return static_cast(this)->GetAnimatedClassName(); } NS_IMETHODIMP diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 227dbdeb3450..a16d5e50b613 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -5493,7 +5493,7 @@ already_AddRefed nsIDocument::CreateAttributeNS( void nsIDocument::ResolveScheduledSVGPresAttrs() { for (auto iter = mLazySVGPresElements.Iter(); !iter.Done(); iter.Next()) { - nsSVGElement* svg = iter.Get()->GetKey(); + SVGElement* svg = iter.Get()->GetKey(); svg->UpdateContentDeclarationBlock(); } mLazySVGPresElements.Clear(); diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 53a9009e4575..14bd89436001 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -113,7 +113,6 @@ class nsPresContext; class nsRange; class nsSimpleContentList; class nsSMILAnimationController; -class nsSVGElement; class nsTextNode; class nsUnblockOnloadEvent; class nsWindowSizes; @@ -189,6 +188,7 @@ class Selection; class ServiceWorkerDescriptor; class StyleSheetList; class SVGDocument; +class SVGElement; class SVGSVGElement; class SVGUseElement; class Touch; @@ -447,6 +447,7 @@ class nsIDocument : public nsINode, typedef mozilla::FullscreenRequest FullscreenRequest; typedef mozilla::net::ReferrerPolicy ReferrerPolicyEnum; typedef mozilla::dom::Element Element; + typedef mozilla::dom::SVGElement SVGElement; NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID) @@ -1253,13 +1254,13 @@ class nsIDocument : public nsINode, * These are weak pointers, please manually unschedule them when an element * is removed. */ - void ScheduleSVGForPresAttrEvaluation(nsSVGElement* aSVG) { + void ScheduleSVGForPresAttrEvaluation(SVGElement* aSVG) { mLazySVGPresElements.PutEntry(aSVG); } // Unschedule an element scheduled by ScheduleFrameRequestCallback (e.g. for // when it is destroyed) - void UnscheduleSVGForPresAttrEvaluation(nsSVGElement* aSVG) { + void UnscheduleSVGForPresAttrEvaluation(SVGElement* aSVG) { mLazySVGPresElements.RemoveEntry(aSVG); } @@ -4307,7 +4308,7 @@ class nsIDocument : public nsINode, // We lazily calculate declaration blocks for SVG elements with mapped // attributes in Servo mode. This list contains all elements which need lazy // resolution. - nsTHashtable> mLazySVGPresElements; + nsTHashtable> mLazySVGPresElements; // Restyle root for servo's style system. // diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 34f6e761f943..e1540f8d324f 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -794,10 +794,6 @@ DOMInterfaces = { 'concrete': False, }, -'SVGElement': { - 'nativeType': 'nsSVGElement', -}, - 'SVGFEFuncAElement': { 'headerFile': 'mozilla/dom/SVGComponentTransferFunctionElement.h', }, diff --git a/dom/smil/test/db_smilMappedAttrList.js b/dom/smil/test/db_smilMappedAttrList.js index ede5dc23ba3c..829215e2280e 100644 --- a/dom/smil/test/db_smilMappedAttrList.js +++ b/dom/smil/test/db_smilMappedAttrList.js @@ -10,7 +10,7 @@ var gMappedAttrList = { // NOTE: The list here should match the MappedAttributeEntry arrays in - // nsSVGElement.cpp + // SVGElement.cpp // PresentationAttributes-FillStroke fill: new AdditiveAttribute("fill", "XML", "rect"), diff --git a/dom/svg/DOMSVGAnimatedLengthList.cpp b/dom/svg/DOMSVGAnimatedLengthList.cpp index e21062ef5a9b..5c7fcda7bbe8 100644 --- a/dom/svg/DOMSVGAnimatedLengthList.cpp +++ b/dom/svg/DOMSVGAnimatedLengthList.cpp @@ -7,7 +7,7 @@ #include "DOMSVGAnimatedLengthList.h" #include "DOMSVGLengthList.h" #include "SVGAnimatedLengthList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsCOMPtr.h" #include "nsSVGAttrTearoffTable.h" #include "mozilla/dom/SVGAnimatedLengthListBinding.h" @@ -53,7 +53,7 @@ already_AddRefed DOMSVGAnimatedLengthList::AnimVal() { /* static */ already_AddRefed DOMSVGAnimatedLengthList::GetDOMWrapper(SVGAnimatedLengthList* aList, - nsSVGElement* aElement, + dom::SVGElement* aElement, uint8_t aAttrEnum, uint8_t aAxis) { RefPtr wrapper = SVGAnimatedLengthListTearoffTable().GetTearoff(aList); diff --git a/dom/svg/DOMSVGAnimatedLengthList.h b/dom/svg/DOMSVGAnimatedLengthList.h index 50332a25663c..a847e481b025 100644 --- a/dom/svg/DOMSVGAnimatedLengthList.h +++ b/dom/svg/DOMSVGAnimatedLengthList.h @@ -9,7 +9,7 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" namespace mozilla { @@ -122,8 +122,8 @@ class DOMSVGAnimatedLengthList final : public nsWrapperCache { * DOMSVGAnimatedLengthList being returned. */ static already_AddRefed GetDOMWrapper( - SVGAnimatedLengthList* aList, nsSVGElement* aElement, uint8_t aAttrEnum, - uint8_t aAxis); + SVGAnimatedLengthList* aList, dom::SVGElement* aElement, + uint8_t aAttrEnum, uint8_t aAxis); /** * This method returns the DOMSVGAnimatedLengthList wrapper for an internal @@ -155,7 +155,7 @@ class DOMSVGAnimatedLengthList final : public nsWrapperCache { bool IsAnimating() const; // WebIDL - nsSVGElement* GetParentObject() const { return mElement; } + dom::SVGElement* GetParentObject() const { return mElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // These aren't weak refs because mBaseVal and mAnimVal are weak @@ -167,7 +167,7 @@ class DOMSVGAnimatedLengthList final : public nsWrapperCache { * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - DOMSVGAnimatedLengthList(nsSVGElement* aElement, uint8_t aAttrEnum, + DOMSVGAnimatedLengthList(dom::SVGElement* aElement, uint8_t aAttrEnum, uint8_t aAxis) : mBaseVal(nullptr), mAnimVal(nullptr), @@ -189,7 +189,7 @@ class DOMSVGAnimatedLengthList final : public nsWrapperCache { // Strong ref to our element to keep it alive. We hold this not only for // ourself, but also for our base/animVal and all of their items. - RefPtr mElement; + RefPtr mElement; uint8_t mAttrEnum; uint8_t mAxis; diff --git a/dom/svg/DOMSVGAnimatedNumberList.cpp b/dom/svg/DOMSVGAnimatedNumberList.cpp index 1be0834977bb..d3c6fc250f39 100644 --- a/dom/svg/DOMSVGAnimatedNumberList.cpp +++ b/dom/svg/DOMSVGAnimatedNumberList.cpp @@ -7,7 +7,7 @@ #include "DOMSVGAnimatedNumberList.h" #include "DOMSVGNumberList.h" #include "SVGAnimatedNumberList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsCOMPtr.h" #include "nsSVGAttrTearoffTable.h" #include "mozilla/dom/SVGAnimatedNumberListBinding.h" @@ -59,7 +59,7 @@ already_AddRefed DOMSVGAnimatedNumberList::AnimVal() { /* static */ already_AddRefed DOMSVGAnimatedNumberList::GetDOMWrapper(SVGAnimatedNumberList* aList, - nsSVGElement* aElement, + dom::SVGElement* aElement, uint8_t aAttrEnum) { RefPtr wrapper = SVGAnimatedNumberListTearoffTable().GetTearoff(aList); diff --git a/dom/svg/DOMSVGAnimatedNumberList.h b/dom/svg/DOMSVGAnimatedNumberList.h index cd412ad9e36b..03602848c2d4 100644 --- a/dom/svg/DOMSVGAnimatedNumberList.h +++ b/dom/svg/DOMSVGAnimatedNumberList.h @@ -9,7 +9,7 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" @@ -54,7 +54,8 @@ class DOMSVGAnimatedNumberList final : public nsISupports, * DOMSVGAnimatedNumberList being returned. */ static already_AddRefed GetDOMWrapper( - SVGAnimatedNumberList* aList, nsSVGElement* aElement, uint8_t aAttrEnum); + SVGAnimatedNumberList* aList, dom::SVGElement* aElement, + uint8_t aAttrEnum); /** * This method returns the DOMSVGAnimatedNumberList wrapper for an internal @@ -86,7 +87,7 @@ class DOMSVGAnimatedNumberList final : public nsISupports, bool IsAnimating() const; // WebIDL - nsSVGElement* GetParentObject() const { return mElement; } + dom::SVGElement* GetParentObject() const { return mElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // These aren't weak refs because mBaseVal and mAnimVal are weak @@ -98,7 +99,7 @@ class DOMSVGAnimatedNumberList final : public nsISupports, * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - DOMSVGAnimatedNumberList(nsSVGElement* aElement, uint8_t aAttrEnum) + DOMSVGAnimatedNumberList(dom::SVGElement* aElement, uint8_t aAttrEnum) : mBaseVal(nullptr), mAnimVal(nullptr), mElement(aElement), @@ -118,7 +119,7 @@ class DOMSVGAnimatedNumberList final : public nsISupports, // Strong ref to our element to keep it alive. We hold this not only for // ourself, but also for our base/animVal and all of their items. - RefPtr mElement; + RefPtr mElement; uint8_t mAttrEnum; }; diff --git a/dom/svg/DOMSVGLength.cpp b/dom/svg/DOMSVGLength.cpp index c7a4f67a34e6..ed64eda0824f 100644 --- a/dom/svg/DOMSVGLength.cpp +++ b/dom/svg/DOMSVGLength.cpp @@ -9,7 +9,7 @@ #include "DOMSVGAnimatedLengthList.h" #include "SVGLength.h" #include "SVGAnimatedLengthList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGLength2.h" #include "nsError.h" #include "nsMathUtils.h" @@ -116,7 +116,7 @@ DOMSVGLength::DOMSVGLength() mValue(0.0f), mVal(nullptr) {} -DOMSVGLength::DOMSVGLength(nsSVGLength2* aVal, nsSVGElement* aSVGElement, +DOMSVGLength::DOMSVGLength(nsSVGLength2* aVal, SVGElement* aSVGElement, bool aAnimVal) : mList(nullptr), mListIndex(0), @@ -148,8 +148,9 @@ void DOMSVGLength::CleanupWeakRefs() { DOMSVGLength::~DOMSVGLength() { CleanupWeakRefs(); } -already_AddRefed DOMSVGLength::GetTearOff( - nsSVGLength2* aVal, nsSVGElement* aSVGElement, bool aAnimVal) { +already_AddRefed DOMSVGLength::GetTearOff(nsSVGLength2* aVal, + SVGElement* aSVGElement, + bool aAnimVal) { auto& table = aAnimVal ? sAnimSVGLengthTearOffTable : sBaseSVGLengthTearOffTable; RefPtr domLength = table.GetTearoff(aVal); diff --git a/dom/svg/DOMSVGLength.h b/dom/svg/DOMSVGLength.h index dcfffc8fd1f4..7c086d80ce41 100644 --- a/dom/svg/DOMSVGLength.h +++ b/dom/svg/DOMSVGLength.h @@ -15,8 +15,6 @@ #include "mozilla/Attributes.h" #include "nsWrapperCache.h" -class nsSVGElement; - // We make DOMSVGLength a pseudo-interface to allow us to QI to it in order to // check that the objects that scripts pass to DOMSVGLengthList methods are our // *native* length objects. @@ -35,6 +33,10 @@ namespace mozilla { class ErrorResult; +namespace dom { +class SVGElement; +} + /** * Class DOMSVGLength * @@ -84,7 +86,7 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache { * Ctor for creating the object returned by * nsSVGLength2::ToDOMBaseVal/ToDOMAnimVal */ - DOMSVGLength(nsSVGLength2* aVal, nsSVGElement* aSVGElement, bool aAnimVal); + DOMSVGLength(nsSVGLength2* aVal, dom::SVGElement* aSVGElement, bool aAnimVal); ~DOMSVGLength(); @@ -106,7 +108,7 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache { DOMSVGLength(); static already_AddRefed GetTearOff(nsSVGLength2* aVal, - nsSVGElement* aSVGElement, + dom::SVGElement* aSVGElement, bool aAnimVal); /** @@ -180,7 +182,7 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache { JS::Handle aGivenProto) override; private: - nsSVGElement* Element() const { return mList->Element(); } + dom::SVGElement* Element() const { return mList->Element(); } uint8_t AttrEnum() const { return mAttrEnum; } @@ -228,7 +230,7 @@ class DOMSVGLength final : public nsISupports, public nsWrapperCache { // The following members are only used when we have an nsSVGLength2 nsSVGLength2* mVal; // kept alive because it belongs to mSVGElement - RefPtr mSVGElement; + RefPtr mSVGElement; }; NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGLength, MOZILLA_DOMSVGLENGTH_IID) diff --git a/dom/svg/DOMSVGLengthList.cpp b/dom/svg/DOMSVGLengthList.cpp index 6a286909a2bb..8a69ba30d8f9 100644 --- a/dom/svg/DOMSVGLengthList.cpp +++ b/dom/svg/DOMSVGLengthList.cpp @@ -4,7 +4,7 @@ * 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 "nsSVGElement.h" +#include "SVGElement.h" #include "DOMSVGLengthList.h" #include "DOMSVGLength.h" #include "nsError.h" diff --git a/dom/svg/DOMSVGLengthList.h b/dom/svg/DOMSVGLengthList.h index bb1dfa66dcf0..a3f9e82a9a4d 100644 --- a/dom/svg/DOMSVGLengthList.h +++ b/dom/svg/DOMSVGLengthList.h @@ -15,12 +15,14 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" -class nsSVGElement; - namespace mozilla { class DOMSVGLength; +namespace dom { +class SVGElement; +} + /** * Class DOMSVGLengthList * @@ -123,7 +125,7 @@ class DOMSVGLengthList final : public nsISupports, public nsWrapperCache { uint32_t Length() const { return NumberOfItems(); } private: - nsSVGElement* Element() const { return mAList->mElement; } + dom::SVGElement* Element() const { return mAList->mElement; } uint8_t AttrEnum() const { return mAList->mAttrEnum; } diff --git a/dom/svg/DOMSVGNumber.cpp b/dom/svg/DOMSVGNumber.cpp index ee6d396b0011..1accba9b2f06 100644 --- a/dom/svg/DOMSVGNumber.cpp +++ b/dom/svg/DOMSVGNumber.cpp @@ -8,7 +8,7 @@ #include "DOMSVGNumberList.h" #include "DOMSVGAnimatedNumberList.h" #include "SVGAnimatedNumberList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsError.h" #include "nsContentUtils.h" // for NS_ENSURE_FINITE #include "mozilla/dom/SVGNumberBinding.h" diff --git a/dom/svg/DOMSVGNumber.h b/dom/svg/DOMSVGNumber.h index d7b026b13749..f0d870f7180b 100644 --- a/dom/svg/DOMSVGNumber.h +++ b/dom/svg/DOMSVGNumber.h @@ -14,12 +14,14 @@ #include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" -class nsSVGElement; - #define MOZ_SVG_LIST_INDEX_BIT_COUNT 27 // supports > 134 million list items namespace mozilla { +namespace dom { +class SVGElement; +} + /** * Class DOMSVGNumber * @@ -117,7 +119,7 @@ class DOMSVGNumber final : public nsISupports, public nsWrapperCache { void SetValue(float aValue, ErrorResult& aRv); private: - nsSVGElement* Element() { return mList->Element(); } + dom::SVGElement* Element() { return mList->Element(); } uint8_t AttrEnum() const { return mAttrEnum; } diff --git a/dom/svg/DOMSVGNumberList.cpp b/dom/svg/DOMSVGNumberList.cpp index 4415bd756a27..79475558b44a 100644 --- a/dom/svg/DOMSVGNumberList.cpp +++ b/dom/svg/DOMSVGNumberList.cpp @@ -4,7 +4,7 @@ * 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 "nsSVGElement.h" +#include "SVGElement.h" #include "DOMSVGNumberList.h" #include "DOMSVGNumber.h" #include "nsError.h" diff --git a/dom/svg/DOMSVGNumberList.h b/dom/svg/DOMSVGNumberList.h index 62deeb3fa01e..72f40aff182f 100644 --- a/dom/svg/DOMSVGNumberList.h +++ b/dom/svg/DOMSVGNumberList.h @@ -15,12 +15,14 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" -class nsSVGElement; - namespace mozilla { class DOMSVGNumber; +namespace dom { +class SVGElement; +} + /** * Class DOMSVGNumberList * @@ -123,7 +125,7 @@ class DOMSVGNumberList final : public nsISupports, public nsWrapperCache { uint32_t Length() const { return NumberOfItems(); } private: - nsSVGElement* Element() const { return mAList->mElement; } + dom::SVGElement* Element() const { return mAList->mElement; } uint8_t AttrEnum() const { return mAList->mAttrEnum; } diff --git a/dom/svg/DOMSVGPathSeg.cpp b/dom/svg/DOMSVGPathSeg.cpp index aa6fa0224ea8..82ca6d594abb 100644 --- a/dom/svg/DOMSVGPathSeg.cpp +++ b/dom/svg/DOMSVGPathSeg.cpp @@ -7,7 +7,7 @@ #include "DOMSVGPathSeg.h" #include "DOMSVGPathSegList.h" #include "SVGAnimatedPathSegList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsError.h" // See the architecture comment in DOMSVGPathSegList.h. diff --git a/dom/svg/DOMSVGPathSeg.h b/dom/svg/DOMSVGPathSeg.h index 3e7aed7437ca..dd300f566e64 100644 --- a/dom/svg/DOMSVGPathSeg.h +++ b/dom/svg/DOMSVGPathSeg.h @@ -13,12 +13,14 @@ #include "SVGPathSegUtils.h" #include "mozilla/dom/SVGPathSegBinding.h" -class nsSVGElement; - #define MOZ_SVG_LIST_INDEX_BIT_COUNT 31 namespace mozilla { +namespace dom { +class SVGElement; +} + #define CHECK_ARG_COUNT_IN_SYNC(segType) \ MOZ_ASSERT( \ ArrayLength(mArgs) == \ @@ -171,7 +173,7 @@ class DOMSVGPathSeg : public nsWrapperCache { } } - nsSVGElement* Element() { return mList->Element(); } + dom::SVGElement* Element() { return mList->Element(); } /** * Get a reference to the internal SVGPathSeg list item that this DOM wrapper diff --git a/dom/svg/DOMSVGPathSegList.cpp b/dom/svg/DOMSVGPathSegList.cpp index b13b507df67d..e6ef42aaa9d4 100644 --- a/dom/svg/DOMSVGPathSegList.cpp +++ b/dom/svg/DOMSVGPathSegList.cpp @@ -4,7 +4,7 @@ * 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 "nsSVGElement.h" +#include "SVGElement.h" #include "DOMSVGPathSegList.h" #include "DOMSVGPathSeg.h" #include "nsError.h" @@ -75,7 +75,7 @@ class MOZ_RAII AutoChangePathSegListNotifier { }; /* static */ already_AddRefed -DOMSVGPathSegList::GetDOMWrapper(void* aList, nsSVGElement* aElement, +DOMSVGPathSegList::GetDOMWrapper(void* aList, SVGElement* aElement, bool aIsAnimValList) { RefPtr wrapper = SVGPathSegListTearoffTable().GetTearoff(aList); diff --git a/dom/svg/DOMSVGPathSegList.h b/dom/svg/DOMSVGPathSegList.h index 36714c7210dd..7033e799ac7e 100644 --- a/dom/svg/DOMSVGPathSegList.h +++ b/dom/svg/DOMSVGPathSegList.h @@ -10,7 +10,7 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsDebug.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" #include "SVGPathData.h" // IWYU pragma: keep #include "mozilla/Attributes.h" @@ -77,7 +77,7 @@ class DOMSVGPathSegList final : public nsISupports, public nsWrapperCache { * clearly SVGPathData* and a SVGPathData** are not the same type. */ static already_AddRefed GetDOMWrapper( - void* aList, nsSVGElement* aElement, bool aIsAnimValList); + void* aList, dom::SVGElement* aElement, bool aIsAnimValList); /** * This method returns the DOMSVGPathSegList wrapper for an internal @@ -156,14 +156,14 @@ class DOMSVGPathSegList final : public nsISupports, public nsWrapperCache { * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - DOMSVGPathSegList(nsSVGElement* aElement, bool aIsAnimValList) + DOMSVGPathSegList(dom::SVGElement* aElement, bool aIsAnimValList) : mElement(aElement), mIsAnimValList(aIsAnimValList) { InternalListWillChangeTo(InternalList()); // Sync mItems } ~DOMSVGPathSegList(); - nsSVGElement* Element() const { return mElement.get(); } + dom::SVGElement* Element() const { return mElement.get(); } /// Used to determine if this list is the baseVal or animVal list. bool IsAnimValList() const { return mIsAnimValList; } @@ -221,7 +221,7 @@ class DOMSVGPathSegList final : public nsISupports, public nsWrapperCache { // Strong ref to our element to keep it alive. We hold this not only for // ourself, but also for our DOMSVGPathSeg items too. - RefPtr mElement; + RefPtr mElement; bool mIsAnimValList; }; diff --git a/dom/svg/DOMSVGPoint.cpp b/dom/svg/DOMSVGPoint.cpp index bb92514ed50c..f16912b8002d 100644 --- a/dom/svg/DOMSVGPoint.cpp +++ b/dom/svg/DOMSVGPoint.cpp @@ -8,7 +8,7 @@ #include "DOMSVGPointList.h" #include "SVGPoint.h" #include "gfx2DGlue.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsError.h" #include "mozilla/dom/SVGMatrix.h" diff --git a/dom/svg/DOMSVGPoint.h b/dom/svg/DOMSVGPoint.h index a9c2e6a28dc0..8887f3121137 100644 --- a/dom/svg/DOMSVGPoint.h +++ b/dom/svg/DOMSVGPoint.h @@ -15,11 +15,10 @@ #include "mozilla/Attributes.h" #include "mozilla/FloatingPoint.h" -class nsSVGElement; - namespace mozilla { namespace dom { +class SVGElement; class SVGMatrix; } // namespace dom @@ -88,7 +87,7 @@ class DOMSVGPoint final : public nsISVGPoint { virtual DOMSVGPoint* Copy() override { return new DOMSVGPoint(this); } protected: - nsSVGElement* Element() { return mList->Element(); } + dom::SVGElement* Element() { return mList->Element(); } }; } // namespace mozilla diff --git a/dom/svg/DOMSVGPointList.cpp b/dom/svg/DOMSVGPointList.cpp index 571a34f644f9..f4fbf969c99b 100644 --- a/dom/svg/DOMSVGPointList.cpp +++ b/dom/svg/DOMSVGPointList.cpp @@ -4,7 +4,7 @@ * 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 "nsSVGElement.h" +#include "SVGElement.h" #include "DOMSVGPointList.h" #include "DOMSVGPoint.h" #include "nsError.h" @@ -92,7 +92,7 @@ class MOZ_RAII AutoChangePointListNotifier { }; /* static */ already_AddRefed DOMSVGPointList::GetDOMWrapper( - void* aList, nsSVGElement* aElement, bool aIsAnimValList) { + void* aList, SVGElement* aElement, bool aIsAnimValList) { RefPtr wrapper = SVGPointListTearoffTable().GetTearoff(aList); if (!wrapper) { diff --git a/dom/svg/DOMSVGPointList.h b/dom/svg/DOMSVGPointList.h index 4df70d921ba3..718e59469523 100644 --- a/dom/svg/DOMSVGPointList.h +++ b/dom/svg/DOMSVGPointList.h @@ -10,7 +10,7 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsDebug.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" #include "SVGPointList.h" // IWYU pragma: keep #include "mozilla/Attributes.h" @@ -78,9 +78,8 @@ class DOMSVGPointList final : public nsISupports, public nsWrapperCache { * use the addresses of these members as the key for the hash table, and * clearly SVGPointList* and a SVGPointList** are not the same type. */ - static already_AddRefed GetDOMWrapper(void* aList, - nsSVGElement* aElement, - bool aIsAnimValList); + static already_AddRefed GetDOMWrapper( + void* aList, dom::SVGElement* aElement, bool aIsAnimValList); /** * This method returns the DOMSVGPointList wrapper for an internal @@ -159,14 +158,14 @@ class DOMSVGPointList final : public nsISupports, public nsWrapperCache { * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - DOMSVGPointList(nsSVGElement* aElement, bool aIsAnimValList) + DOMSVGPointList(dom::SVGElement* aElement, bool aIsAnimValList) : mElement(aElement), mIsAnimValList(aIsAnimValList) { InternalListWillChangeTo(InternalList()); // Sync mItems } ~DOMSVGPointList(); - nsSVGElement* Element() const { return mElement.get(); } + dom::SVGElement* Element() const { return mElement.get(); } /// Used to determine if this list is the baseVal or animVal list. bool IsAnimValList() const { return mIsAnimValList; } @@ -195,7 +194,7 @@ class DOMSVGPointList final : public nsISupports, public nsWrapperCache { // Strong ref to our element to keep it alive. We hold this not only for // ourself, but also for our nsISVGPoint items too. - RefPtr mElement; + RefPtr mElement; bool mIsAnimValList; }; diff --git a/dom/svg/DOMSVGStringList.cpp b/dom/svg/DOMSVGStringList.cpp index 9ea4caa874e6..1bc9688fe903 100644 --- a/dom/svg/DOMSVGStringList.cpp +++ b/dom/svg/DOMSVGStringList.cpp @@ -65,7 +65,7 @@ class MOZ_RAII AutoChangeStringListNotifier { }; /* static */ already_AddRefed DOMSVGStringList::GetDOMWrapper( - SVGStringList* aList, nsSVGElement* aElement, + SVGStringList* aList, SVGElement* aElement, bool aIsConditionalProcessingAttribute, uint8_t aAttrEnum) { RefPtr wrapper = SVGStringListTearoffTable().GetTearoff(aList); diff --git a/dom/svg/DOMSVGStringList.h b/dom/svg/DOMSVGStringList.h index 1dbab00ffccb..cd4c953b888f 100644 --- a/dom/svg/DOMSVGStringList.h +++ b/dom/svg/DOMSVGStringList.h @@ -9,7 +9,7 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" namespace mozilla { @@ -50,7 +50,7 @@ class DOMSVGStringList final : public nsISupports, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGStringList) - nsSVGElement* GetParentObject() const { return mElement; } + dom::SVGElement* GetParentObject() const { return mElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -80,7 +80,7 @@ class DOMSVGStringList final : public nsISupports, public nsWrapperCache { * result in a new DOMSVGStringList being returned. */ static already_AddRefed GetDOMWrapper( - SVGStringList* aList, nsSVGElement* aElement, + SVGStringList* aList, dom::SVGElement* aElement, bool aIsConditionalProcessingAttribute, uint8_t aAttrEnum); private: @@ -88,7 +88,7 @@ class DOMSVGStringList final : public nsISupports, public nsWrapperCache { * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - DOMSVGStringList(nsSVGElement* aElement, + DOMSVGStringList(dom::SVGElement* aElement, bool aIsConditionalProcessingAttribute, uint8_t aAttrEnum) : mElement(aElement), mAttrEnum(aAttrEnum), @@ -99,7 +99,7 @@ class DOMSVGStringList final : public nsISupports, public nsWrapperCache { SVGStringList& InternalList() const; // Strong ref to our element to keep it alive. - RefPtr mElement; + RefPtr mElement; uint8_t mAttrEnum; diff --git a/dom/svg/DOMSVGTransformList.cpp b/dom/svg/DOMSVGTransformList.cpp index 36b06237e0d3..8f77db0e62dc 100644 --- a/dom/svg/DOMSVGTransformList.cpp +++ b/dom/svg/DOMSVGTransformList.cpp @@ -8,7 +8,7 @@ #include "mozilla/dom/SVGTransform.h" #include "mozilla/dom/SVGMatrix.h" #include "nsSVGAnimatedTransformList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/dom/SVGTransformListBinding.h" #include "nsError.h" #include diff --git a/dom/svg/DOMSVGTransformList.h b/dom/svg/DOMSVGTransformList.h index f832232fb8d6..55db91f8873a 100644 --- a/dom/svg/DOMSVGTransformList.h +++ b/dom/svg/DOMSVGTransformList.h @@ -15,11 +15,10 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" -class nsSVGElement; - namespace mozilla { namespace dom { +class SVGElement; class SVGMatrix; class SVGTransform; } // namespace dom @@ -120,7 +119,7 @@ class DOMSVGTransformList final : public nsISupports, public nsWrapperCache { uint32_t Length() const { return NumberOfItems(); } private: - nsSVGElement* Element() const { return mAList->mElement; } + dom::SVGElement* Element() const { return mAList->mElement; } /// Used to determine if this list is the baseVal or animVal list. bool IsAnimValList() const { diff --git a/dom/svg/SVGAElement.cpp b/dom/svg/SVGAElement.cpp index 464c1d742fae..110ca845f8c1 100644 --- a/dom/svg/SVGAElement.cpp +++ b/dom/svg/SVGAElement.cpp @@ -27,7 +27,7 @@ JSObject* SVGAElement::WrapNode(JSContext* aCx, return SVGAElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGAElement::sStringInfo[3] = { +SVGElement::StringInfo SVGAElement::sStringInfo[3] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}, {nsGkAtoms::target, kNameSpaceID_None, true}}; @@ -341,9 +341,9 @@ nsresult SVGAElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGAElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGAElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGAngle.h b/dom/svg/SVGAngle.h index 8be97af861a4..55fcde8db917 100644 --- a/dom/svg/SVGAngle.h +++ b/dom/svg/SVGAngle.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGAngle_h #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" class nsSVGAngle; @@ -23,11 +23,11 @@ class SVGAngle final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAngle) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAngle) - SVGAngle(nsSVGAngle* aVal, nsSVGElement* aSVGElement, AngleType aType) + SVGAngle(nsSVGAngle* aVal, SVGElement* aSVGElement, AngleType aType) : mVal(aVal), mSVGElement(aSVGElement), mType(aType) {} // WebIDL - nsSVGElement* GetParentObject() { return mSVGElement; } + SVGElement* GetParentObject() { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint16_t UnitType() const; @@ -45,7 +45,7 @@ class SVGAngle final : public nsWrapperCache { nsSVGAngle* mVal; // if mType is CreatedValue, we own the angle. Otherwise, // the element does. - RefPtr mSVGElement; + RefPtr mSVGElement; AngleType mType; }; diff --git a/dom/svg/SVGAnimateMotionElement.h b/dom/svg/SVGAnimateMotionElement.h index 9ec77bd5c397..42e1ed7b81e9 100644 --- a/dom/svg/SVGAnimateMotionElement.h +++ b/dom/svg/SVGAnimateMotionElement.h @@ -39,7 +39,7 @@ class SVGAnimateMotionElement final : public SVGAnimationElement { virtual bool GetTargetAttributeName(int32_t* aNamespaceID, nsAtom** aLocalName) const override; - // nsSVGElement + // SVGElement virtual nsStaticAtom* GetPathDataAttrName() const override { return nsGkAtoms::path; } diff --git a/dom/svg/SVGAnimatedAngle.h b/dom/svg/SVGAnimatedAngle.h index efa8f8d07624..9d11217c1146 100644 --- a/dom/svg/SVGAnimatedAngle.h +++ b/dom/svg/SVGAnimatedAngle.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGAnimatedAngle_h #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" class nsSVGAngle; @@ -23,11 +23,11 @@ class SVGAnimatedAngle final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedAngle) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedAngle) - SVGAnimatedAngle(nsSVGAngle* aVal, nsSVGElement* aSVGElement) + SVGAnimatedAngle(nsSVGAngle* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL - nsSVGElement* GetParentObject() { return mSVGElement; } + SVGElement* GetParentObject() { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; already_AddRefed BaseVal(); @@ -37,7 +37,7 @@ class SVGAnimatedAngle final : public nsWrapperCache { ~SVGAnimatedAngle(); nsSVGAngle* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedBoolean.h b/dom/svg/SVGAnimatedBoolean.h index 3061cde4afad..9d69ac04fbd1 100644 --- a/dom/svg/SVGAnimatedBoolean.h +++ b/dom/svg/SVGAnimatedBoolean.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGAnimatedBoolean_h #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "nsSVGBoolean.h" @@ -19,11 +19,11 @@ class SVGAnimatedBoolean final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedBoolean) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedBoolean) - SVGAnimatedBoolean(nsSVGBoolean* aVal, nsSVGElement* aSVGElement) + SVGAnimatedBoolean(nsSVGBoolean* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; bool BaseVal() const { return mVal->GetBaseValue(); } @@ -37,7 +37,7 @@ class SVGAnimatedBoolean final : public nsWrapperCache { ~SVGAnimatedBoolean(); nsSVGBoolean* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedEnumeration.h b/dom/svg/SVGAnimatedEnumeration.h index cc53e3897bf8..89b5da37c964 100644 --- a/dom/svg/SVGAnimatedEnumeration.h +++ b/dom/svg/SVGAnimatedEnumeration.h @@ -9,7 +9,7 @@ #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" namespace mozilla { namespace dom { @@ -19,7 +19,7 @@ class SVGAnimatedEnumeration : public nsISupports, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedEnumeration) - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) final; @@ -28,11 +28,11 @@ class SVGAnimatedEnumeration : public nsISupports, public nsWrapperCache { virtual uint16_t AnimVal() = 0; protected: - explicit SVGAnimatedEnumeration(nsSVGElement* aSVGElement) + explicit SVGAnimatedEnumeration(SVGElement* aSVGElement) : mSVGElement(aSVGElement) {} virtual ~SVGAnimatedEnumeration(){}; - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedInteger.h b/dom/svg/SVGAnimatedInteger.h index e892d564c41a..61c6e8ee25c2 100644 --- a/dom/svg/SVGAnimatedInteger.h +++ b/dom/svg/SVGAnimatedInteger.h @@ -9,7 +9,7 @@ #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" namespace mozilla { namespace dom { @@ -19,7 +19,7 @@ class SVGAnimatedInteger : public nsISupports, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedInteger) - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) final; @@ -28,11 +28,11 @@ class SVGAnimatedInteger : public nsISupports, public nsWrapperCache { virtual int32_t AnimVal() = 0; protected: - explicit SVGAnimatedInteger(nsSVGElement* aSVGElement) + explicit SVGAnimatedInteger(SVGElement* aSVGElement) : mSVGElement(aSVGElement) {} virtual ~SVGAnimatedInteger(){}; - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedLength.h b/dom/svg/SVGAnimatedLength.h index 55d8741c1df9..dfb2835e56c6 100644 --- a/dom/svg/SVGAnimatedLength.h +++ b/dom/svg/SVGAnimatedLength.h @@ -8,7 +8,7 @@ #define mozilla_dom_SVGAnimatedLength_h #include "mozilla/Attributes.h" -#include "nsSVGElement.h" +#include "SVGElement.h" class nsSVGLength2; @@ -23,11 +23,11 @@ class SVGAnimatedLength final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedLength) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedLength) - SVGAnimatedLength(nsSVGLength2* aVal, nsSVGElement* aSVGElement) + SVGAnimatedLength(nsSVGLength2* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL - nsSVGElement* GetParentObject() { return mSVGElement; } + SVGElement* GetParentObject() { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; already_AddRefed BaseVal(); @@ -37,7 +37,7 @@ class SVGAnimatedLength final : public nsWrapperCache { ~SVGAnimatedLength(); nsSVGLength2* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedLengthList.cpp b/dom/svg/SVGAnimatedLengthList.cpp index 19a7bed566ec..d42b8a5fa7b7 100644 --- a/dom/svg/SVGAnimatedLengthList.cpp +++ b/dom/svg/SVGAnimatedLengthList.cpp @@ -8,7 +8,7 @@ #include "DOMSVGAnimatedLengthList.h" #include "mozilla/Move.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGAttrTearoffTable.h" #include "nsSMILValue.h" #include "SVGLengthListSMILType.h" @@ -37,7 +37,7 @@ nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString &aValue) { } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. rv = mBaseVal.CopyFrom(newBaseValue); @@ -61,7 +61,7 @@ void SVGAnimatedLengthList::ClearBaseValue(uint32_t aAttrEnum) { } nsresult SVGAnimatedLengthList::SetAnimValue(const SVGLengthList &aNewAnimValue, - nsSVGElement *aElement, + SVGElement *aElement, uint32_t aAttrEnum) { DOMSVGAnimatedLengthList *domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); @@ -98,7 +98,7 @@ nsresult SVGAnimatedLengthList::SetAnimValue(const SVGLengthList &aNewAnimValue, return NS_OK; } -void SVGAnimatedLengthList::ClearAnimValue(nsSVGElement *aElement, +void SVGAnimatedLengthList::ClearAnimValue(SVGElement *aElement, uint32_t aAttrEnum) { DOMSVGAnimatedLengthList *domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); @@ -115,7 +115,7 @@ void SVGAnimatedLengthList::ClearAnimValue(nsSVGElement *aElement, } UniquePtr SVGAnimatedLengthList::ToSMILAttr( - nsSVGElement *aSVGElement, uint8_t aAttrEnum, uint8_t aAxis, + SVGElement *aSVGElement, uint8_t aAttrEnum, uint8_t aAxis, bool aCanZeroPadList) { return MakeUnique(this, aSVGElement, aAttrEnum, aAxis, aCanZeroPadList); diff --git a/dom/svg/SVGAnimatedLengthList.h b/dom/svg/SVGAnimatedLengthList.h index 68c7500391af..9eeaadbaa9fa 100644 --- a/dom/svg/SVGAnimatedLengthList.h +++ b/dom/svg/SVGAnimatedLengthList.h @@ -14,12 +14,12 @@ #include "SVGLengthList.h" class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; } // namespace dom /** @@ -61,14 +61,14 @@ class SVGAnimatedLengthList { return mAnimVal ? *mAnimVal : mBaseVal; } - nsresult SetAnimValue(const SVGLengthList& aValue, nsSVGElement* aElement, + nsresult SetAnimValue(const SVGLengthList& aValue, dom::SVGElement* aElement, uint32_t aAttrEnum); - void ClearAnimValue(nsSVGElement* aElement, uint32_t aAttrEnum); + void ClearAnimValue(dom::SVGElement* aElement, uint32_t aAttrEnum); bool IsAnimating() const { return !!mAnimVal; } - UniquePtr ToSMILAttr(nsSVGElement* aSVGElement, + UniquePtr ToSMILAttr(dom::SVGElement* aSVGElement, uint8_t aAttrEnum, uint8_t aAxis, bool aCanZeroPadList); @@ -84,7 +84,7 @@ class SVGAnimatedLengthList { struct SMILAnimatedLengthList : public nsISMILAttr { public: SMILAnimatedLengthList(SVGAnimatedLengthList* aVal, - nsSVGElement* aSVGElement, uint8_t aAttrEnum, + dom::SVGElement* aSVGElement, uint8_t aAttrEnum, uint8_t aAxis, bool aCanZeroPadList) : mVal(aVal), mElement(aSVGElement), @@ -96,7 +96,7 @@ class SVGAnimatedLengthList { // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedLengthList* mVal; - nsSVGElement* mElement; + dom::SVGElement* mElement; uint8_t mAttrEnum; uint8_t mAxis; bool mCanZeroPadList; // See SVGLengthListAndInfo::CanZeroPadList diff --git a/dom/svg/SVGAnimatedNumber.h b/dom/svg/SVGAnimatedNumber.h index 99fe3c55cdb6..e922d0aa9834 100644 --- a/dom/svg/SVGAnimatedNumber.h +++ b/dom/svg/SVGAnimatedNumber.h @@ -10,7 +10,7 @@ #include "nsISupports.h" #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" namespace mozilla { namespace dom { @@ -20,7 +20,7 @@ class SVGAnimatedNumber : public nsISupports, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedNumber) - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) final; @@ -29,11 +29,11 @@ class SVGAnimatedNumber : public nsISupports, public nsWrapperCache { virtual float AnimVal() = 0; protected: - explicit SVGAnimatedNumber(nsSVGElement* aSVGElement) + explicit SVGAnimatedNumber(SVGElement* aSVGElement) : mSVGElement(aSVGElement) {} virtual ~SVGAnimatedNumber(){}; - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedNumberList.cpp b/dom/svg/SVGAnimatedNumberList.cpp index ef2ac1daa508..0092b170cb14 100644 --- a/dom/svg/SVGAnimatedNumberList.cpp +++ b/dom/svg/SVGAnimatedNumberList.cpp @@ -8,7 +8,7 @@ #include "DOMSVGAnimatedNumberList.h" #include "mozilla/Move.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGAttrTearoffTable.h" #include "nsSMILValue.h" #include "SVGNumberListSMILType.h" @@ -34,7 +34,7 @@ nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString &aValue) { } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. mIsBaseSet = true; @@ -60,7 +60,7 @@ void SVGAnimatedNumberList::ClearBaseValue(uint32_t aAttrEnum) { } nsresult SVGAnimatedNumberList::SetAnimValue(const SVGNumberList &aNewAnimValue, - nsSVGElement *aElement, + SVGElement *aElement, uint32_t aAttrEnum) { DOMSVGAnimatedNumberList *domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); @@ -97,7 +97,7 @@ nsresult SVGAnimatedNumberList::SetAnimValue(const SVGNumberList &aNewAnimValue, return NS_OK; } -void SVGAnimatedNumberList::ClearAnimValue(nsSVGElement *aElement, +void SVGAnimatedNumberList::ClearAnimValue(SVGElement *aElement, uint32_t aAttrEnum) { DOMSVGAnimatedNumberList *domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); @@ -114,7 +114,7 @@ void SVGAnimatedNumberList::ClearAnimValue(nsSVGElement *aElement, } UniquePtr SVGAnimatedNumberList::ToSMILAttr( - nsSVGElement *aSVGElement, uint8_t aAttrEnum) { + SVGElement *aSVGElement, uint8_t aAttrEnum) { return MakeUnique(this, aSVGElement, aAttrEnum); } diff --git a/dom/svg/SVGAnimatedNumberList.h b/dom/svg/SVGAnimatedNumberList.h index 6e1619d0288e..4a44fe6c6322 100644 --- a/dom/svg/SVGAnimatedNumberList.h +++ b/dom/svg/SVGAnimatedNumberList.h @@ -14,12 +14,12 @@ #include "SVGNumberList.h" class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; } // namespace dom /** @@ -61,10 +61,10 @@ class SVGAnimatedNumberList { return mAnimVal ? *mAnimVal : mBaseVal; } - nsresult SetAnimValue(const SVGNumberList& aValue, nsSVGElement* aElement, + nsresult SetAnimValue(const SVGNumberList& aValue, dom::SVGElement* aElement, uint32_t aAttrEnum); - void ClearAnimValue(nsSVGElement* aElement, uint32_t aAttrEnum); + void ClearAnimValue(dom::SVGElement* aElement, uint32_t aAttrEnum); // Returns true if the animated value of this list has been explicitly // set (either by animation, or by taking on the base value which has been @@ -75,7 +75,7 @@ class SVGAnimatedNumberList { bool IsAnimating() const { return !!mAnimVal; } - UniquePtr ToSMILAttr(nsSVGElement* aSVGElement, + UniquePtr ToSMILAttr(dom::SVGElement* aSVGElement, uint8_t aAttrEnum); private: @@ -91,14 +91,14 @@ class SVGAnimatedNumberList { struct SMILAnimatedNumberList : public nsISMILAttr { public: SMILAnimatedNumberList(SVGAnimatedNumberList* aVal, - nsSVGElement* aSVGElement, uint8_t aAttrEnum) + dom::SVGElement* aSVGElement, uint8_t aAttrEnum) : mVal(aVal), mElement(aSVGElement), mAttrEnum(aAttrEnum) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedNumberList* mVal; - nsSVGElement* mElement; + dom::SVGElement* mElement; uint8_t mAttrEnum; // nsISMILAttr methods diff --git a/dom/svg/SVGAnimatedPathSegList.cpp b/dom/svg/SVGAnimatedPathSegList.cpp index 9853cff32e62..cc4882f72cb1 100644 --- a/dom/svg/SVGAnimatedPathSegList.cpp +++ b/dom/svg/SVGAnimatedPathSegList.cpp @@ -8,7 +8,7 @@ #include "DOMSVGPathSegList.h" #include "mozilla/Move.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGAttrTearoffTable.h" #include "nsSMILValue.h" #include "SVGPathSegListSMILType.h" @@ -49,7 +49,7 @@ nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString &aValue) { // Only now may we modify mBaseVal! // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. nsresult rv2 = mBaseVal.CopyFrom(newBaseValue); @@ -89,7 +89,7 @@ void SVGAnimatedPathSegList::ClearBaseValue() { } nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData &aNewAnimValue, - nsSVGElement *aElement) { + SVGElement *aElement) { // Note that a new animation may totally change the number of items in the // animVal list, either replacing what was essentially a mirror of the // baseVal list, or else replacing and overriding an existing animation. @@ -121,7 +121,7 @@ nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData &aNewAnimValue, return rv; } -void SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement) { +void SVGAnimatedPathSegList::ClearAnimValue(SVGElement *aElement) { // We must send these notifications *before* changing mAnimVal! (See above.) DOMSVGPathSegList *domWrapper = @@ -141,7 +141,7 @@ bool SVGAnimatedPathSegList::IsRendered() const { } UniquePtr SVGAnimatedPathSegList::ToSMILAttr( - nsSVGElement *aElement) { + SVGElement *aElement) { return MakeUnique(this, aElement); } diff --git a/dom/svg/SVGAnimatedPathSegList.h b/dom/svg/SVGAnimatedPathSegList.h index 062978b6cd8b..30eb25d58c81 100644 --- a/dom/svg/SVGAnimatedPathSegList.h +++ b/dom/svg/SVGAnimatedPathSegList.h @@ -15,12 +15,12 @@ #include "SVGPathData.h" class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; } // namespace dom /** @@ -65,9 +65,9 @@ class SVGAnimatedPathSegList final { return mAnimVal ? *mAnimVal : mBaseVal; } - nsresult SetAnimValue(const SVGPathData& aValue, nsSVGElement* aElement); + nsresult SetAnimValue(const SVGPathData& aValue, dom::SVGElement* aElement); - void ClearAnimValue(nsSVGElement* aElement); + void ClearAnimValue(dom::SVGElement* aElement); /** * Empty paths are not rendered. @@ -83,7 +83,7 @@ class SVGAnimatedPathSegList final { bool IsAnimating() const { return !!mAnimVal; } - UniquePtr ToSMILAttr(nsSVGElement* aElement); + UniquePtr ToSMILAttr(dom::SVGElement* aElement); size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const; @@ -99,14 +99,14 @@ class SVGAnimatedPathSegList final { struct SMILAnimatedPathSegList : public nsISMILAttr { public: SMILAnimatedPathSegList(SVGAnimatedPathSegList* aVal, - nsSVGElement* aElement) + dom::SVGElement* aElement) : mVal(aVal), mElement(aElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedPathSegList* mVal; - nsSVGElement* mElement; + dom::SVGElement* mElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/SVGAnimatedPointList.cpp b/dom/svg/SVGAnimatedPointList.cpp index 9b496dfa9031..8499e8a790ef 100644 --- a/dom/svg/SVGAnimatedPointList.cpp +++ b/dom/svg/SVGAnimatedPointList.cpp @@ -8,7 +8,7 @@ #include "DOMSVGPointList.h" #include "mozilla/Move.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGAttrTearoffTable.h" #include "nsSMILValue.h" #include "SVGPointListSMILType.h" @@ -49,7 +49,7 @@ nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString &aValue) { // Only now may we modify mBaseVal! // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. nsresult rv2 = mBaseVal.CopyFrom(newBaseValue); @@ -89,7 +89,7 @@ void SVGAnimatedPointList::ClearBaseValue() { } nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList &aNewAnimValue, - nsSVGElement *aElement) { + SVGElement *aElement) { // Note that a new animation may totally change the number of items in the // animVal list, either replacing what was essentially a mirror of the // baseVal list, or else replacing and overriding an existing animation. @@ -124,7 +124,7 @@ nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList &aNewAnimValue, return NS_OK; } -void SVGAnimatedPointList::ClearAnimValue(nsSVGElement *aElement) { +void SVGAnimatedPointList::ClearAnimValue(SVGElement *aElement) { // We must send these notifications *before* changing mAnimVal! (See above.) DOMSVGPointList *domWrapper = @@ -139,8 +139,7 @@ void SVGAnimatedPointList::ClearAnimValue(nsSVGElement *aElement) { aElement->DidAnimatePointList(); } -UniquePtr SVGAnimatedPointList::ToSMILAttr( - nsSVGElement *aElement) { +UniquePtr SVGAnimatedPointList::ToSMILAttr(SVGElement *aElement) { return MakeUnique(this, aElement); } diff --git a/dom/svg/SVGAnimatedPointList.h b/dom/svg/SVGAnimatedPointList.h index 4f0ca371d4db..3a3d2b7e13d2 100644 --- a/dom/svg/SVGAnimatedPointList.h +++ b/dom/svg/SVGAnimatedPointList.h @@ -14,12 +14,12 @@ #include "SVGPointList.h" class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; } // namespace dom /** @@ -64,9 +64,9 @@ class SVGAnimatedPointList { return mAnimVal ? *mAnimVal : mBaseVal; } - nsresult SetAnimValue(const SVGPointList& aValue, nsSVGElement* aElement); + nsresult SetAnimValue(const SVGPointList& aValue, dom::SVGElement* aElement); - void ClearAnimValue(nsSVGElement* aElement); + void ClearAnimValue(dom::SVGElement* aElement); /** * Needed for correct DOM wrapper construction since GetAnimValue may @@ -77,7 +77,7 @@ class SVGAnimatedPointList { bool IsAnimating() const { return !!mAnimVal; } - UniquePtr ToSMILAttr(nsSVGElement* aElement); + UniquePtr ToSMILAttr(dom::SVGElement* aElement); private: // mAnimVal is a pointer to allow us to determine if we're being animated or @@ -90,14 +90,14 @@ class SVGAnimatedPointList { struct SMILAnimatedPointList : public nsISMILAttr { public: - SMILAnimatedPointList(SVGAnimatedPointList* aVal, nsSVGElement* aElement) + SMILAnimatedPointList(SVGAnimatedPointList* aVal, dom::SVGElement* aElement) : mVal(aVal), mElement(aElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedPointList* mVal; - nsSVGElement* mElement; + dom::SVGElement* mElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp index 16086565c7e2..91ddb739226b 100644 --- a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp +++ b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp @@ -79,8 +79,7 @@ DOMSVGAnimatedPreserveAspectRatio::AnimVal() { } nsresult SVGAnimatedPreserveAspectRatio::SetBaseValueString( - const nsAString& aValueAsString, nsSVGElement* aSVGElement, - bool aDoSetAttr) { + const nsAString& aValueAsString, SVGElement* aSVGElement, bool aDoSetAttr) { SVGPreserveAspectRatio val; nsresult res = SVGPreserveAspectRatio::FromString(aValueAsString, &val); if (NS_FAILED(res)) { @@ -113,7 +112,7 @@ void SVGAnimatedPreserveAspectRatio::GetBaseValueString( } void SVGAnimatedPreserveAspectRatio::SetBaseValue( - const SVGPreserveAspectRatio& aValue, nsSVGElement* aSVGElement) { + const SVGPreserveAspectRatio& aValue, SVGElement* aSVGElement) { if (mIsBaseSet && mBaseVal == aValue) { return; } @@ -141,7 +140,7 @@ static uint64_t PackPreserveAspectRatio(const SVGPreserveAspectRatio& par) { } void SVGAnimatedPreserveAspectRatio::SetAnimValue(uint64_t aPackedValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsAnimated && PackPreserveAspectRatio(mAnimVal) == aPackedValue) { return; } @@ -153,7 +152,7 @@ void SVGAnimatedPreserveAspectRatio::SetAnimValue(uint64_t aPackedValue, already_AddRefed SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedPAspectRatio = sSVGAnimatedPAspectRatioTearoffTable.GetTearoff(this); if (!domAnimatedPAspectRatio) { @@ -170,7 +169,7 @@ DOMSVGAnimatedPreserveAspectRatio::~DOMSVGAnimatedPreserveAspectRatio() { } UniquePtr SVGAnimatedPreserveAspectRatio::ToSMILAttr( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/SVGAnimatedPreserveAspectRatio.h b/dom/svg/SVGAnimatedPreserveAspectRatio.h index a10adfefb635..9e73b88ffaf8 100644 --- a/dom/svg/SVGAnimatedPreserveAspectRatio.h +++ b/dom/svg/SVGAnimatedPreserveAspectRatio.h @@ -10,7 +10,7 @@ #include "nsCycleCollectionParticipant.h" #include "nsError.h" #include "nsISMILAttr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "SVGPreserveAspectRatio.h" #include "mozilla/Attributes.h" #include "mozilla/UniquePtr.h" @@ -36,12 +36,12 @@ class SVGAnimatedPreserveAspectRatio final { } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr); + dom::SVGElement* aSVGElement, bool aDoSetAttr); void GetBaseValueString(nsAString& aValue) const; void SetBaseValue(const SVGPreserveAspectRatio& aValue, - nsSVGElement* aSVGElement); - nsresult SetBaseAlign(uint16_t aAlign, nsSVGElement* aSVGElement) { + dom::SVGElement* aSVGElement); + nsresult SetBaseAlign(uint16_t aAlign, dom::SVGElement* aSVGElement) { if (aAlign < SVG_ALIGN_MIN_VALID || aAlign > SVG_ALIGN_MAX_VALID) { return NS_ERROR_FAILURE; } @@ -50,7 +50,7 @@ class SVGAnimatedPreserveAspectRatio final { return NS_OK; } nsresult SetBaseMeetOrSlice(uint16_t aMeetOrSlice, - nsSVGElement* aSVGElement) { + dom::SVGElement* aSVGElement) { if (aMeetOrSlice < SVG_MEETORSLICE_MIN_VALID || aMeetOrSlice > SVG_MEETORSLICE_MAX_VALID) { return NS_ERROR_FAILURE; @@ -59,7 +59,7 @@ class SVGAnimatedPreserveAspectRatio final { aSVGElement); return NS_OK; } - void SetAnimValue(uint64_t aPackedValue, nsSVGElement* aSVGElement); + void SetAnimValue(uint64_t aPackedValue, dom::SVGElement* aSVGElement); const SVGPreserveAspectRatio& GetBaseValue() const { return mBaseVal; } const SVGPreserveAspectRatio& GetAnimValue() const { return mAnimVal; } @@ -67,8 +67,8 @@ class SVGAnimatedPreserveAspectRatio final { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed - ToDOMAnimatedPreserveAspectRatio(nsSVGElement* aSVGElement); - UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + ToDOMAnimatedPreserveAspectRatio(dom::SVGElement* aSVGElement); + UniquePtr ToSMILAttr(dom::SVGElement* aSVGElement); private: SVGPreserveAspectRatio mAnimVal; @@ -80,14 +80,14 @@ class SVGAnimatedPreserveAspectRatio final { struct SMILPreserveAspectRatio final : public nsISMILAttr { public: SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal, - nsSVGElement* aSVGElement) + dom::SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. SVGAnimatedPreserveAspectRatio* mVal; - nsSVGElement* mSVGElement; + dom::SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( @@ -109,11 +109,11 @@ class DOMSVGAnimatedPreserveAspectRatio final : public nsISupports, DOMSVGAnimatedPreserveAspectRatio) DOMSVGAnimatedPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal, - nsSVGElement* aSVGElement) + dom::SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // WebIDL - nsSVGElement* GetParentObject() const { return mSVGElement; } + dom::SVGElement* GetParentObject() const { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -124,7 +124,7 @@ class DOMSVGAnimatedPreserveAspectRatio final : public nsISupports, protected: // kept alive because it belongs to content: SVGAnimatedPreserveAspectRatio* mVal; - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedRect.cpp b/dom/svg/SVGAnimatedRect.cpp index f0f514348dcf..03753e26d4c1 100644 --- a/dom/svg/SVGAnimatedRect.cpp +++ b/dom/svg/SVGAnimatedRect.cpp @@ -6,7 +6,7 @@ #include "SVGAnimatedRect.h" #include "mozilla/dom/SVGAnimatedRectBinding.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGViewBox.h" #include "SVGIRect.h" @@ -18,7 +18,7 @@ NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedRect, mSVGElement) NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(SVGAnimatedRect, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(SVGAnimatedRect, Release) -SVGAnimatedRect::SVGAnimatedRect(nsSVGViewBox* aVal, nsSVGElement* aSVGElement) +SVGAnimatedRect::SVGAnimatedRect(nsSVGViewBox* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} SVGAnimatedRect::~SVGAnimatedRect() { diff --git a/dom/svg/SVGAnimatedRect.h b/dom/svg/SVGAnimatedRect.h index 2a74eed26962..a44994ec328e 100644 --- a/dom/svg/SVGAnimatedRect.h +++ b/dom/svg/SVGAnimatedRect.h @@ -12,7 +12,7 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" -#include "nsSVGElement.h" +#include "SVGElement.h" class nsSVGViewBox; @@ -24,9 +24,9 @@ class SVGAnimatedRect final : public nsWrapperCache { NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedRect) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedRect) - SVGAnimatedRect(nsSVGViewBox* aVal, nsSVGElement* aSVGElement); + SVGAnimatedRect(nsSVGViewBox* aVal, SVGElement* aSVGElement); - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -39,7 +39,7 @@ class SVGAnimatedRect final : public nsWrapperCache { virtual ~SVGAnimatedRect(); nsSVGViewBox* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedString.h b/dom/svg/SVGAnimatedString.h index 8a337ec0899e..132eb3bf23db 100644 --- a/dom/svg/SVGAnimatedString.h +++ b/dom/svg/SVGAnimatedString.h @@ -7,27 +7,27 @@ #ifndef mozilla_dom_SVGAnimatedString_h #define mozilla_dom_SVGAnimatedString_h -#include "nsSVGElement.h" +#include "SVGElement.h" namespace mozilla { namespace dom { class SVGAnimatedString : public nsISupports, public nsWrapperCache { public: - explicit SVGAnimatedString(nsSVGElement* aSVGElement) + explicit SVGAnimatedString(SVGElement* aSVGElement) : mSVGElement(aSVGElement) {} virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } virtual void GetBaseVal(nsAString& aResult) = 0; virtual void SetBaseVal(const nsAString& aValue) = 0; virtual void GetAnimVal(nsAString& aResult) = 0; - RefPtr mSVGElement; + RefPtr mSVGElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimatedTransformList.cpp b/dom/svg/SVGAnimatedTransformList.cpp index 5a4fa6c5e273..bd386234c1c2 100644 --- a/dom/svg/SVGAnimatedTransformList.cpp +++ b/dom/svg/SVGAnimatedTransformList.cpp @@ -47,7 +47,7 @@ already_AddRefed SVGAnimatedTransformList::AnimVal() { /* static */ already_AddRefed SVGAnimatedTransformList::GetDOMWrapper(nsSVGAnimatedTransformList* aList, - nsSVGElement* aElement) { + SVGElement* aElement) { RefPtr wrapper = sSVGAnimatedTransformListTearoffTable.GetTearoff(aList); if (!wrapper) { diff --git a/dom/svg/SVGAnimatedTransformList.h b/dom/svg/SVGAnimatedTransformList.h index 39332edf283d..de06edb7dc50 100644 --- a/dom/svg/SVGAnimatedTransformList.h +++ b/dom/svg/SVGAnimatedTransformList.h @@ -10,7 +10,7 @@ #include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" @@ -56,7 +56,7 @@ class SVGAnimatedTransformList final : public nsWrapperCache { * SVGAnimatedTransformList being returned. */ static already_AddRefed GetDOMWrapper( - nsSVGAnimatedTransformList* aList, nsSVGElement* aElement); + nsSVGAnimatedTransformList* aList, SVGElement* aElement); /** * This method returns the SVGAnimatedTransformList wrapper for an internal @@ -88,7 +88,7 @@ class SVGAnimatedTransformList final : public nsWrapperCache { bool IsAnimating() const; // WebIDL - nsSVGElement* GetParentObject() const { return mElement; } + SVGElement* GetParentObject() const { return mElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // These aren't weak refs because mBaseVal and mAnimVal are weak @@ -100,7 +100,7 @@ class SVGAnimatedTransformList final : public nsWrapperCache { * Only our static GetDOMWrapper() factory method may create objects of our * type. */ - explicit SVGAnimatedTransformList(nsSVGElement* aElement) + explicit SVGAnimatedTransformList(SVGElement* aElement) : mBaseVal(nullptr), mAnimVal(nullptr), mElement(aElement) {} ~SVGAnimatedTransformList(); @@ -117,7 +117,7 @@ class SVGAnimatedTransformList final : public nsWrapperCache { // Strong ref to our element to keep it alive. We hold this not only for // ourself, but also for our base/animVal and all of their items. - RefPtr mElement; + RefPtr mElement; }; } // namespace dom diff --git a/dom/svg/SVGAnimationElement.cpp b/dom/svg/SVGAnimationElement.cpp index c451f239b637..4ae6124f019a 100644 --- a/dom/svg/SVGAnimationElement.cpp +++ b/dom/svg/SVGAnimationElement.cpp @@ -87,13 +87,13 @@ nsSMILTimedElement& SVGAnimationElement::TimedElement() { return mTimedElement; } -nsSVGElement* SVGAnimationElement::GetTargetElement() { +SVGElement* SVGAnimationElement::GetTargetElement() { FlushAnimations(); // We'll just call the other GetTargetElement method, and QI to the right type nsIContent* target = GetTargetElementContent(); - return (target && target->IsSVGElement()) ? static_cast(target) + return (target && target->IsSVGElement()) ? static_cast(target) : nullptr; } diff --git a/dom/svg/SVGAnimationElement.h b/dom/svg/SVGAnimationElement.h index 30ab63021a66..04c75fb8574b 100644 --- a/dom/svg/SVGAnimationElement.h +++ b/dom/svg/SVGAnimationElement.h @@ -11,13 +11,13 @@ #include "mozilla/dom/IDTracker.h" #include "mozilla/dom/SVGTests.h" #include "nsSMILTimedElement.h" -#include "nsSVGElement.h" - -typedef nsSVGElement SVGAnimationElementBase; +#include "SVGElement.h" namespace mozilla { namespace dom { +typedef SVGElement SVGAnimationElementBase; + enum nsSMILTargetAttrType { eSMILTargetAttrType_auto, eSMILTargetAttrType_CSS, @@ -71,7 +71,7 @@ class SVGAnimationElement : public SVGAnimationElementBase, public SVGTests { void ActivateByHyperlink(); // WebIDL - nsSVGElement* GetTargetElement(); + SVGElement* GetTargetElement(); float GetStartTime(ErrorResult& rv); float GetCurrentTime(); float GetSimpleDuration(ErrorResult& rv); @@ -81,10 +81,10 @@ class SVGAnimationElement : public SVGAnimationElementBase, public SVGTests { void EndElementAt(float offset, ErrorResult& rv); // SVGTests - nsSVGElement* AsSVGElement() final { return this; } + SVGElement* AsSVGElement() final { return this; } protected: - // nsSVGElement overrides + // SVGElement overrides void UpdateHrefTarget(const nsAString& aHrefStr); void AnimationTargetChanged(); diff --git a/dom/svg/SVGCircleElement.cpp b/dom/svg/SVGCircleElement.cpp index 5058a859e3d4..1c96e022176b 100644 --- a/dom/svg/SVGCircleElement.cpp +++ b/dom/svg/SVGCircleElement.cpp @@ -22,7 +22,7 @@ JSObject* SVGCircleElement::WrapNode(JSContext* aCx, return SVGCircleElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGCircleElement::sLengthInfo[3] = { +SVGElement::LengthInfo SVGCircleElement::sLengthInfo[3] = { {nsGkAtoms::cx, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::cy, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -57,14 +57,14 @@ already_AddRefed SVGCircleElement::R() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGCircleElement::HasValidDimensions() const { return mLengthAttributes[ATTR_R].IsExplicitlySet() && mLengthAttributes[ATTR_R].GetAnimValInSpecifiedUnits() > 0; } -nsSVGElement::LengthAttributesInfo SVGCircleElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGCircleElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGClipPathElement.cpp b/dom/svg/SVGClipPathElement.cpp index 08b48ea26aa7..890a82c25b09 100644 --- a/dom/svg/SVGClipPathElement.cpp +++ b/dom/svg/SVGClipPathElement.cpp @@ -23,7 +23,7 @@ JSObject* SVGClipPathElement::WrapNode(JSContext* aCx, return SVGClipPathElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::EnumInfo SVGClipPathElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGClipPathElement::sEnumInfo[1] = { {nsGkAtoms::clipPathUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_USERSPACEONUSE}}; //---------------------------------------------------------------------- @@ -37,7 +37,7 @@ already_AddRefed SVGClipPathElement::ClipPathUnits() { return mEnumAttributes[CLIPPATHUNITS].ToDOMAnimatedEnum(this); } -nsSVGElement::EnumAttributesInfo SVGClipPathElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGClipPathElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } diff --git a/dom/svg/SVGContentUtils.cpp b/dom/svg/SVGContentUtils.cpp index 839e48e2fe43..695da79cd0bb 100644 --- a/dom/svg/SVGContentUtils.cpp +++ b/dom/svg/SVGContentUtils.cpp @@ -40,7 +40,7 @@ using namespace mozilla::gfx; namespace mozilla { -SVGSVGElement* SVGContentUtils::GetOuterSVGElement(nsSVGElement* aSVGElement) { +SVGSVGElement* SVGContentUtils::GetOuterSVGElement(SVGElement* aSVGElement) { Element* element = nullptr; Element* ancestor = aSVGElement->GetParentElementCrossingShadowRoot(); @@ -70,7 +70,7 @@ enum DashState { }; static DashState GetStrokeDashData( - SVGContentUtils::AutoStrokeOptions* aStrokeOptions, nsSVGElement* aElement, + SVGContentUtils::AutoStrokeOptions* aStrokeOptions, SVGElement* aElement, const nsStyleSVG* aStyleSVG, SVGContextPaint* aContextPaint) { size_t dashArrayLength; Float totalLengthOfDashes = 0.0, totalLengthOfGaps = 0.0; @@ -165,7 +165,7 @@ static DashState GetStrokeDashData( } void SVGContentUtils::GetStrokeOptions(AutoStrokeOptions* aStrokeOptions, - nsSVGElement* aElement, + SVGElement* aElement, ComputedStyle* aComputedStyle, SVGContextPaint* aContextPaint, StrokeOptionFlags aFlags) { @@ -237,7 +237,7 @@ void SVGContentUtils::GetStrokeOptions(AutoStrokeOptions* aStrokeOptions, } } -Float SVGContentUtils::GetStrokeWidth(nsSVGElement* aElement, +Float SVGContentUtils::GetStrokeWidth(SVGElement* aElement, ComputedStyle* aComputedStyle, SVGContextPaint* aContextPaint) { RefPtr computedStyle; @@ -378,16 +378,16 @@ SVGViewportElement* SVGContentUtils::GetNearestViewportElement( return nullptr; } -static gfx::Matrix GetCTMInternal(nsSVGElement* aElement, bool aScreenCTM, +static gfx::Matrix GetCTMInternal(SVGElement* aElement, bool aScreenCTM, bool aHaveRecursed) { gfxMatrix matrix = aElement->PrependLocalTransformsTo( gfxMatrix(), aHaveRecursed ? eAllTransforms : eUserSpaceToParent); - nsSVGElement* element = aElement; + SVGElement* element = aElement; nsIContent* ancestor = aElement->GetFlattenedTreeParent(); while (ancestor && ancestor->IsSVGElement() && !ancestor->IsSVGElement(nsGkAtoms::foreignObject)) { - element = static_cast(ancestor); + element = static_cast(ancestor); matrix *= element->PrependLocalTransformsTo(gfxMatrix()); // i.e. *A*ppend if (!aScreenCTM && SVGContentUtils::EstablishesViewport(element)) { if (!element->NodeInfo()->Equals(nsGkAtoms::svg, kNameSpaceID_SVG) && @@ -422,7 +422,7 @@ static gfx::Matrix GetCTMInternal(nsSVGElement* aElement, bool aScreenCTM, } if (ancestor->IsSVGElement()) { return gfx::ToMatrix(matrix) * - GetCTMInternal(static_cast(ancestor), true, true); + GetCTMInternal(static_cast(ancestor), true, true); } // XXX this does not take into account CSS transform, or that the non-SVG @@ -445,7 +445,7 @@ static gfx::Matrix GetCTMInternal(nsSVGElement* aElement, bool aScreenCTM, return ToMatrix(matrix).PostTranslate(x, y); } -gfx::Matrix SVGContentUtils::GetCTM(nsSVGElement* aElement, bool aScreenCTM) { +gfx::Matrix SVGContentUtils::GetCTM(SVGElement* aElement, bool aScreenCTM) { return GetCTMInternal(aElement, aScreenCTM, false); } @@ -763,7 +763,7 @@ bool SVGContentUtils::ParseInteger(const nsAString& aString, int32_t& aValue) { return ParseInteger(iter, end, aValue) && iter == end; } -float SVGContentUtils::CoordToFloat(nsSVGElement* aContent, +float SVGContentUtils::CoordToFloat(SVGElement* aContent, const nsStyleCoord& aCoord) { switch (aCoord.GetUnit()) { case eStyleUnit_Factor: diff --git a/dom/svg/SVGContentUtils.h b/dom/svg/SVGContentUtils.h index 6c90fef84852..dbd803aa99bf 100644 --- a/dom/svg/SVGContentUtils.h +++ b/dom/svg/SVGContentUtils.h @@ -22,7 +22,6 @@ class nsIDocument; class nsIFrame; class nsPresContext; class nsStyleCoord; -class nsSVGElement; namespace mozilla { class ComputedStyle; @@ -32,6 +31,7 @@ class SVGContextPaint; class SVGPreserveAspectRatio; namespace dom { class Element; +class SVGElement; class SVGSVGElement; class SVGViewportElement; } // namespace dom @@ -81,7 +81,7 @@ class SVGContentUtils { /* * Get the outer SVG element of an nsIContent */ - static dom::SVGSVGElement* GetOuterSVGElement(nsSVGElement* aSVGElement); + static dom::SVGSVGElement* GetOuterSVGElement(dom::SVGElement* aSVGElement); /** * Activates the animation element aContent as a result of navigation to the @@ -148,7 +148,7 @@ class SVGContentUtils { * whether or not the stroke is dashed. */ static void GetStrokeOptions(AutoStrokeOptions* aStrokeOptions, - nsSVGElement* aElement, + dom::SVGElement* aElement, ComputedStyle* aComputedStyle, mozilla::SVGContextPaint* aContextPaint, StrokeOptionFlags aFlags = eAllStrokeOptions); @@ -162,7 +162,7 @@ class SVGContentUtils { * and 'stroke-opacity' properties to, say, return zero if they are "none" or * "0", respectively. */ - static Float GetStrokeWidth(nsSVGElement* aElement, + static Float GetStrokeWidth(dom::SVGElement* aElement, ComputedStyle* aComputedStyle, mozilla::SVGContextPaint* aContextPaint); @@ -194,7 +194,7 @@ class SVGContentUtils { const char16_t** aParams, uint32_t aParamsLength); - static Matrix GetCTM(nsSVGElement* aElement, bool aScreenCTM); + static Matrix GetCTM(dom::SVGElement* aElement, bool aScreenCTM); /** * Gets the tight bounds-space stroke bounds of the non-scaling-stroked rect @@ -321,7 +321,8 @@ class SVGContentUtils { * Factor (straight userspace), Coord (dimensioned), and Percent (of * aContent's SVG viewport) */ - static float CoordToFloat(nsSVGElement* aContent, const nsStyleCoord& aCoord); + static float CoordToFloat(dom::SVGElement* aContent, + const nsStyleCoord& aCoord); /** * Parse the SVG path string * Returns a path diff --git a/dom/svg/SVGDescElement.h b/dom/svg/SVGDescElement.h index 397573132a70..8a94162be96d 100644 --- a/dom/svg/SVGDescElement.h +++ b/dom/svg/SVGDescElement.h @@ -8,16 +8,16 @@ #define mozilla_dom_SVGDescElement_h #include "mozilla/Attributes.h" -#include "nsSVGElement.h" +#include "SVGElement.h" nsresult NS_NewSVGDescElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -typedef nsSVGElement SVGDescElementBase; - namespace mozilla { namespace dom { +typedef SVGElement SVGDescElementBase; + class SVGDescElement final : public SVGDescElementBase { protected: friend nsresult(::NS_NewSVGDescElement( diff --git a/dom/svg/SVGDocument.cpp b/dom/svg/SVGDocument.cpp index 74b8aa2dbd5e..f98f4b3cd158 100644 --- a/dom/svg/SVGDocument.cpp +++ b/dom/svg/SVGDocument.cpp @@ -17,7 +17,7 @@ #include "nsString.h" #include "nsLiteralString.h" #include "mozilla/dom/Element.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" diff --git a/dom/svg/SVGDocument.h b/dom/svg/SVGDocument.h index 186d92c880a8..f87961adb878 100644 --- a/dom/svg/SVGDocument.h +++ b/dom/svg/SVGDocument.h @@ -10,14 +10,13 @@ #include "mozilla/Attributes.h" #include "mozilla/dom/XMLDocument.h" -class nsSVGElement; - namespace mozilla { class SVGContextPaint; namespace dom { +class SVGElement; class SVGForeignObjectElement; class SVGDocument final : public XMLDocument { diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/SVGElement.cpp similarity index 84% rename from dom/svg/nsSVGElement.cpp rename to dom/svg/SVGElement.cpp index 8a879757ca9c..9b508636a710 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/SVGElement.cpp @@ -8,7 +8,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/Unused.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGSVGElement.h" @@ -56,20 +56,17 @@ #include "mozilla/Unused.h" #include "mozilla/RestyleManager.h" -using namespace mozilla; -using namespace mozilla::dom; -using namespace mozilla::dom::SVGUnitTypes_Binding; - // This is needed to ensure correct handling of calls to the // vararg-list methods in this file: -// nsSVGElement::GetAnimated{Length,Number,Integer}Values +// SVGElement::GetAnimated{Length,Number,Integer}Values // See bug 547964 for details: static_assert(sizeof(void*) == sizeof(nullptr), "nullptr should be the correct size"); nsresult NS_NewSVGElement( Element** aResult, already_AddRefed&& aNodeInfo) { - RefPtr it = new nsSVGElement(std::move(aNodeInfo)); + RefPtr it = + new mozilla::dom::SVGElement(std::move(aNodeInfo)); nsresult rv = it->Init(); if (NS_FAILED(rv)) { @@ -80,29 +77,33 @@ nsresult NS_NewSVGElement( return rv; } -NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGElement) +namespace mozilla { +namespace dom { +using namespace SVGUnitTypes_Binding; -nsSVGEnumMapping nsSVGElement::sSVGUnitTypesMap[] = { +NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGElement) + +nsSVGEnumMapping SVGElement::sSVGUnitTypesMap[] = { {nsGkAtoms::userSpaceOnUse, SVG_UNIT_TYPE_USERSPACEONUSE}, {nsGkAtoms::objectBoundingBox, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}, {nullptr, 0}}; -nsSVGElement::nsSVGElement(already_AddRefed&& aNodeInfo) - : nsSVGElementBase(std::move(aNodeInfo)) {} +SVGElement::SVGElement(already_AddRefed&& aNodeInfo) + : SVGElementBase(std::move(aNodeInfo)) {} -nsSVGElement::~nsSVGElement() { +SVGElement::~SVGElement() { OwnerDoc()->UnscheduleSVGForPresAttrEvaluation(this); } -JSObject* nsSVGElement::WrapNode(JSContext* aCx, - JS::Handle aGivenProto) { +JSObject* SVGElement::WrapNode(JSContext* aCx, + JS::Handle aGivenProto) { return SVGElement_Binding::Wrap(aCx, this, aGivenProto); } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -void nsSVGElement::DidAnimateClass() { +void SVGElement::DidAnimateClass() { // For Servo, snapshot the element before we change it. nsIPresShell* shell = OwnerDoc()->GetShell(); if (shell) { @@ -124,7 +125,7 @@ void nsSVGElement::DidAnimateClass() { } } -nsresult nsSVGElement::Init() { +nsresult SVGElement::Init() { // Set up length attributes - can't do this in the constructor // because we can't do a virtual call at that point @@ -223,10 +224,9 @@ nsresult nsSVGElement::Init() { //---------------------------------------------------------------------- // nsIContent methods -nsresult nsSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, - nsIContent* aBindingParent) { - nsresult rv = - nsSVGElementBase::BindToTree(aDocument, aParent, aBindingParent); +nsresult SVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, + nsIContent* aBindingParent) { + nsresult rv = SVGElementBase::BindToTree(aDocument, aParent, aBindingParent); NS_ENSURE_SUCCESS(rv, rv); if (!MayHaveStyle()) { @@ -256,11 +256,11 @@ nsresult nsSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, return NS_OK; } -nsresult nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, - const nsAttrValue* aValue, - const nsAttrValue* aOldValue, - nsIPrincipal* aSubjectPrincipal, - bool aNotify) { +nsresult SVGElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, + const nsAttrValue* aValue, + const nsAttrValue* aOldValue, + nsIPrincipal* aSubjectPrincipal, + bool aNotify) { // We don't currently use nsMappedAttributes within SVG. If this changes, we // need to be very careful because some nsAttrValues used by SVG point to // member data of SVG elements and if an nsAttrValue outlives the SVG element @@ -287,14 +287,14 @@ nsresult nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, NS_ENSURE_SUCCESS(rv, rv); } - return nsSVGElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aOldValue, - aSubjectPrincipal, aNotify); + return SVGElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aOldValue, + aSubjectPrincipal, aNotify); } -bool nsSVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, - const nsAString& aValue, - nsIPrincipal* aMaybeScriptedPrincipal, - nsAttrValue& aResult) { +bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) { nsresult rv = NS_OK; bool foundMatch = false; bool didSetResult = false; @@ -630,12 +630,12 @@ bool nsSVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, return true; } - return nsSVGElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, - aMaybeScriptedPrincipal, aResult); + return SVGElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue, + aMaybeScriptedPrincipal, aResult); } -void nsSVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName, - bool aNotify) { +void SVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName, + bool aNotify) { // XXXbz there's a bunch of redundancy here with AfterSetAttr. // Maybe consolidate? @@ -849,21 +849,21 @@ void nsSVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName, } } -nsresult nsSVGElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName, - const nsAttrValueOrString* aValue, - bool aNotify) { +nsresult SVGElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName, + const nsAttrValueOrString* aValue, + bool aNotify) { if (!aValue) { UnsetAttrInternal(aNamespaceID, aName, aNotify); } - return nsSVGElementBase::BeforeSetAttr(aNamespaceID, aName, aValue, aNotify); + return SVGElementBase::BeforeSetAttr(aNamespaceID, aName, aValue, aNotify); } -nsChangeHint nsSVGElement::GetAttributeChangeHint(const nsAtom* aAttribute, - int32_t aModType) const { +nsChangeHint SVGElement::GetAttributeChangeHint(const nsAtom* aAttribute, + int32_t aModType) const { nsChangeHint retval = - nsSVGElementBase::GetAttributeChangeHint(aAttribute, aModType); + SVGElementBase::GetAttributeChangeHint(aAttribute, aModType); - nsCOMPtr tests = do_QueryObject(const_cast(this)); + nsCOMPtr tests = do_QueryObject(const_cast(this)); if (tests && tests->IsConditionalProcessingAttribute(aAttribute)) { // It would be nice to only reconstruct the frame if the value returned by // SVGTests::PassesConditionalProcessingTests has changed, but we don't @@ -873,60 +873,60 @@ nsChangeHint nsSVGElement::GetAttributeChangeHint(const nsAtom* aAttribute, return retval; } -bool nsSVGElement::IsNodeOfType(uint32_t aFlags) const { return false; } +bool SVGElement::IsNodeOfType(uint32_t aFlags) const { return false; } -void nsSVGElement::NodeInfoChanged(nsIDocument* aOldDoc) { - nsSVGElementBase::NodeInfoChanged(aOldDoc); +void SVGElement::NodeInfoChanged(nsIDocument* aOldDoc) { + SVGElementBase::NodeInfoChanged(aOldDoc); aOldDoc->UnscheduleSVGForPresAttrEvaluation(this); mContentDeclarationBlock = nullptr; OwnerDoc()->ScheduleSVGForPresAttrEvaluation(this); } NS_IMETHODIMP_(bool) -nsSVGElement::IsAttributeMapped(const nsAtom* name) const { +SVGElement::IsAttributeMapped(const nsAtom* name) const { if (name == nsGkAtoms::lang) { return true; } - return nsSVGElementBase::IsAttributeMapped(name); + return SVGElementBase::IsAttributeMapped(name); } // PresentationAttributes-FillStroke -/* static */ const Element::MappedAttributeEntry - nsSVGElement::sFillStrokeMap[] = {{nsGkAtoms::fill}, - {nsGkAtoms::fill_opacity}, - {nsGkAtoms::fill_rule}, - {nsGkAtoms::paint_order}, - {nsGkAtoms::stroke}, - {nsGkAtoms::stroke_dasharray}, - {nsGkAtoms::stroke_dashoffset}, - {nsGkAtoms::stroke_linecap}, - {nsGkAtoms::stroke_linejoin}, - {nsGkAtoms::stroke_miterlimit}, - {nsGkAtoms::stroke_opacity}, - {nsGkAtoms::stroke_width}, - {nsGkAtoms::vector_effect}, - {nullptr}}; +/* static */ const Element::MappedAttributeEntry SVGElement::sFillStrokeMap[] = + {{nsGkAtoms::fill}, + {nsGkAtoms::fill_opacity}, + {nsGkAtoms::fill_rule}, + {nsGkAtoms::paint_order}, + {nsGkAtoms::stroke}, + {nsGkAtoms::stroke_dasharray}, + {nsGkAtoms::stroke_dashoffset}, + {nsGkAtoms::stroke_linecap}, + {nsGkAtoms::stroke_linejoin}, + {nsGkAtoms::stroke_miterlimit}, + {nsGkAtoms::stroke_opacity}, + {nsGkAtoms::stroke_width}, + {nsGkAtoms::vector_effect}, + {nullptr}}; // PresentationAttributes-Graphics -/* static */ const Element::MappedAttributeEntry nsSVGElement::sGraphicsMap[] = - {{nsGkAtoms::clip_path}, - {nsGkAtoms::clip_rule}, - {nsGkAtoms::colorInterpolation}, - {nsGkAtoms::cursor}, - {nsGkAtoms::display}, - {nsGkAtoms::filter}, - {nsGkAtoms::image_rendering}, - {nsGkAtoms::mask}, - {nsGkAtoms::opacity}, - {nsGkAtoms::pointer_events}, - {nsGkAtoms::shape_rendering}, - {nsGkAtoms::text_rendering}, - {nsGkAtoms::visibility}, - {nullptr}}; +/* static */ const Element::MappedAttributeEntry SVGElement::sGraphicsMap[] = { + {nsGkAtoms::clip_path}, + {nsGkAtoms::clip_rule}, + {nsGkAtoms::colorInterpolation}, + {nsGkAtoms::cursor}, + {nsGkAtoms::display}, + {nsGkAtoms::filter}, + {nsGkAtoms::image_rendering}, + {nsGkAtoms::mask}, + {nsGkAtoms::opacity}, + {nsGkAtoms::pointer_events}, + {nsGkAtoms::shape_rendering}, + {nsGkAtoms::text_rendering}, + {nsGkAtoms::visibility}, + {nullptr}}; // PresentationAttributes-TextContentElements /* static */ const Element::MappedAttributeEntry - nsSVGElement::sTextContentElementsMap[] = { + SVGElement::sTextContentElementsMap[] = { // Properties that we don't support are commented out. // { nsGkAtoms::alignment_baseline }, // { nsGkAtoms::baseline_shift }, @@ -942,7 +942,7 @@ nsSVGElement::IsAttributeMapped(const nsAtom* name) const { // PresentationAttributes-FontSpecification /* static */ const Element::MappedAttributeEntry - nsSVGElement::sFontSpecificationMap[] = { + SVGElement::sFontSpecificationMap[] = { {nsGkAtoms::font_family}, {nsGkAtoms::font_size}, {nsGkAtoms::font_size_adjust}, {nsGkAtoms::font_stretch}, {nsGkAtoms::font_style}, {nsGkAtoms::font_variant}, @@ -950,39 +950,39 @@ nsSVGElement::IsAttributeMapped(const nsAtom* name) const { // PresentationAttributes-GradientStop /* static */ const Element::MappedAttributeEntry - nsSVGElement::sGradientStopMap[] = { + SVGElement::sGradientStopMap[] = { {nsGkAtoms::stop_color}, {nsGkAtoms::stop_opacity}, {nullptr}}; // PresentationAttributes-Viewports -/* static */ const Element::MappedAttributeEntry nsSVGElement::sViewportsMap[] = - {{nsGkAtoms::overflow}, {nsGkAtoms::clip}, {nullptr}}; +/* static */ const Element::MappedAttributeEntry SVGElement::sViewportsMap[] = { + {nsGkAtoms::overflow}, {nsGkAtoms::clip}, {nullptr}}; // PresentationAttributes-Makers -/* static */ const Element::MappedAttributeEntry nsSVGElement::sMarkersMap[] = { +/* static */ const Element::MappedAttributeEntry SVGElement::sMarkersMap[] = { {nsGkAtoms::marker_end}, {nsGkAtoms::marker_mid}, {nsGkAtoms::marker_start}, {nullptr}}; // PresentationAttributes-Color -/* static */ const Element::MappedAttributeEntry nsSVGElement::sColorMap[] = { +/* static */ const Element::MappedAttributeEntry SVGElement::sColorMap[] = { {nsGkAtoms::color}, {nullptr}}; // PresentationAttributes-Filters -/* static */ const Element::MappedAttributeEntry nsSVGElement::sFiltersMap[] = { +/* static */ const Element::MappedAttributeEntry SVGElement::sFiltersMap[] = { {nsGkAtoms::colorInterpolationFilters}, {nullptr}}; // PresentationAttributes-feFlood -/* static */ const Element::MappedAttributeEntry nsSVGElement::sFEFloodMap[] = { +/* static */ const Element::MappedAttributeEntry SVGElement::sFEFloodMap[] = { {nsGkAtoms::flood_color}, {nsGkAtoms::flood_opacity}, {nullptr}}; // PresentationAttributes-LightingEffects /* static */ const Element::MappedAttributeEntry - nsSVGElement::sLightingEffectsMap[] = {{nsGkAtoms::lighting_color}, - {nullptr}}; + SVGElement::sLightingEffectsMap[] = {{nsGkAtoms::lighting_color}, + {nullptr}}; // PresentationAttributes-mask -/* static */ const Element::MappedAttributeEntry nsSVGElement::sMaskMap[] = { +/* static */ const Element::MappedAttributeEntry SVGElement::sMaskMap[] = { {nsGkAtoms::mask_type}, {nullptr}}; //---------------------------------------------------------------------- @@ -992,7 +992,7 @@ nsSVGElement::IsAttributeMapped(const nsAtom* name) const { //---------------------------------------------------------------------- -SVGSVGElement* nsSVGElement::GetOwnerSVGElement() { +SVGSVGElement* SVGElement::GetOwnerSVGElement() { nsIContent* ancestor = GetFlattenedTreeParent(); while (ancestor && ancestor->IsSVGElement()) { @@ -1009,11 +1009,11 @@ SVGSVGElement* nsSVGElement::GetOwnerSVGElement() { return nullptr; } -nsSVGElement* nsSVGElement::GetViewportElement() { +SVGElement* SVGElement::GetViewportElement() { return SVGContentUtils::GetNearestViewportElement(this); } -already_AddRefed nsSVGElement::ClassName() { +already_AddRefed SVGElement::ClassName() { return mClassAttribute.ToDOMAnimatedString(this); } @@ -1025,7 +1025,7 @@ namespace { class MOZ_STACK_CLASS MappedAttrParser { public: MappedAttrParser(css::Loader* aLoader, nsIURI* aDocURI, - already_AddRefed aBaseURI, nsSVGElement* aElement); + already_AddRefed aBaseURI, SVGElement* aElement); ~MappedAttrParser(); // Parses a mapped attribute value. @@ -1050,12 +1050,12 @@ class MOZ_STACK_CLASS MappedAttrParser { RefPtr mDecl; // For reporting use counters - nsSVGElement* mElement; + SVGElement* mElement; }; MappedAttrParser::MappedAttrParser(css::Loader* aLoader, nsIURI* aDocURI, already_AddRefed aBaseURI, - nsSVGElement* aElement) + SVGElement* aElement) : mLoader(aLoader), mDocURI(aDocURI), mBaseURI(aBaseURI), @@ -1128,7 +1128,7 @@ already_AddRefed MappedAttrParser::GetDeclarationBlock() { //---------------------------------------------------------------------- // Implementation Helpers: -void nsSVGElement::UpdateContentDeclarationBlock() { +void SVGElement::UpdateContentDeclarationBlock() { NS_ASSERTION(!mContentDeclarationBlock, "we already have a content declaration block"); @@ -1181,7 +1181,7 @@ void nsSVGElement::UpdateContentDeclarationBlock() { mContentDeclarationBlock = mappedAttrParser.GetDeclarationBlock(); } -const DeclarationBlock* nsSVGElement::GetContentDeclarationBlock() const { +const DeclarationBlock* SVGElement::GetContentDeclarationBlock() const { return mContentDeclarationBlock; } @@ -1228,7 +1228,7 @@ const DeclarationBlock* nsSVGElement::GetContentDeclarationBlock() const { * of the above for us. For such types there is no matching WillChangeXXX * method, only DidChangeXXX which calls SetParsedAttr. */ -nsAttrValue nsSVGElement::WillChangeValue(nsAtom* aName) { +nsAttrValue SVGElement::WillChangeValue(nsAtom* aName) { // We need an empty attr value: // a) to pass to BeforeSetAttr when GetParsedAttr returns nullptr // b) to store the old value in the case we have mutation listeners @@ -1285,9 +1285,9 @@ nsAttrValue nsSVGElement::WillChangeValue(nsAtom* aName) { * * aNewValue is replaced with the old value. */ -void nsSVGElement::DidChangeValue(nsAtom* aName, - const nsAttrValue& aEmptyOrOldValue, - nsAttrValue& aNewValue) { +void SVGElement::DidChangeValue(nsAtom* aName, + const nsAttrValue& aEmptyOrOldValue, + nsAttrValue& aNewValue) { bool hasListeners = nsContentUtils::HasMutationListeners( this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED, this); uint8_t modType = @@ -1307,8 +1307,7 @@ void nsSVGElement::DidChangeValue(nsAtom* aName, updateBatch); } -void nsSVGElement::MaybeSerializeAttrBeforeRemoval(nsAtom* aName, - bool aNotify) { +void SVGElement::MaybeSerializeAttrBeforeRemoval(nsAtom* aName, bool aNotify) { if (!aNotify || !nsContentUtils::HasMutationListeners( this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED, this)) { return; @@ -1325,7 +1324,7 @@ void nsSVGElement::MaybeSerializeAttrBeforeRemoval(nsAtom* aName, } /* static */ -nsAtom* nsSVGElement::GetEventNameForAttr(nsAtom* aAttr) { +nsAtom* SVGElement::GetEventNameForAttr(nsAtom* aAttr) { if (aAttr == nsGkAtoms::onload) return nsGkAtoms::onSVGLoad; if (aAttr == nsGkAtoms::onunload) return nsGkAtoms::onSVGUnload; if (aAttr == nsGkAtoms::onresize) return nsGkAtoms::onSVGResize; @@ -1338,26 +1337,26 @@ nsAtom* nsSVGElement::GetEventNameForAttr(nsAtom* aAttr) { return aAttr; } -SVGViewportElement* nsSVGElement::GetCtx() const { +SVGViewportElement* SVGElement::GetCtx() const { return SVGContentUtils::GetNearestViewportElement(this); } -/* virtual */ gfxMatrix nsSVGElement::PrependLocalTransformsTo( +/* virtual */ gfxMatrix SVGElement::PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const { return aMatrix; } -nsSVGElement::LengthAttributesInfo nsSVGElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGElement::GetLengthInfo() { return LengthAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::LengthAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::LengthAttributesInfo::Reset(uint8_t aAttrEnum) { mLengths[aAttrEnum].Init(mLengthInfo[aAttrEnum].mCtxType, aAttrEnum, mLengthInfo[aAttrEnum].mDefaultValue, mLengthInfo[aAttrEnum].mDefaultUnitType); } -void nsSVGElement::SetLength(nsAtom* aName, const nsSVGLength2& aLength) { +void SVGElement::SetLength(nsAtom* aName, const nsSVGLength2& aLength) { LengthAttributesInfo lengthInfo = GetLengthInfo(); for (uint32_t i = 0; i < lengthInfo.mLengthCount; i++) { @@ -1370,12 +1369,12 @@ void nsSVGElement::SetLength(nsAtom* aName, const nsSVGLength2& aLength) { MOZ_ASSERT(false, "no length found to set"); } -nsAttrValue nsSVGElement::WillChangeLength(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeLength(uint8_t aAttrEnum) { return WillChangeValue(GetLengthInfo().mLengthInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeLength(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeLength(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { LengthAttributesInfo info = GetLengthInfo(); NS_ASSERTION(info.mLengthCount > 0, @@ -1388,7 +1387,7 @@ void nsSVGElement::DidChangeLength(uint8_t aAttrEnum, DidChangeValue(info.mLengthInfo[aAttrEnum].mName, aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimateLength(uint8_t aAttrEnum) { +void SVGElement::DidAnimateLength(uint8_t aAttrEnum) { ClearAnyCachedPath(); nsIFrame* frame = GetPrimaryFrame(); @@ -1401,7 +1400,7 @@ void nsSVGElement::DidAnimateLength(uint8_t aAttrEnum) { } } -nsSVGLength2* nsSVGElement::GetAnimatedLength(const nsAtom* aAttrName) { +nsSVGLength2* SVGElement::GetAnimatedLength(const nsAtom* aAttrName) { LengthAttributesInfo lengthInfo = GetLengthInfo(); for (uint32_t i = 0; i < lengthInfo.mLengthCount; i++) { @@ -1413,7 +1412,7 @@ nsSVGLength2* nsSVGElement::GetAnimatedLength(const nsAtom* aAttrName) { return nullptr; } -void nsSVGElement::GetAnimatedLengthValues(float* aFirst, ...) { +void SVGElement::GetAnimatedLengthValues(float* aFirst, ...) { LengthAttributesInfo info = GetLengthInfo(); NS_ASSERTION(info.mLengthCount > 0, @@ -1445,21 +1444,21 @@ void nsSVGElement::GetAnimatedLengthValues(float* aFirst, ...) { va_end(args); } -nsSVGElement::LengthListAttributesInfo nsSVGElement::GetLengthListInfo() { +SVGElement::LengthListAttributesInfo SVGElement::GetLengthListInfo() { return LengthListAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::LengthListAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::LengthListAttributesInfo::Reset(uint8_t aAttrEnum) { mLengthLists[aAttrEnum].ClearBaseValue(aAttrEnum); // caller notifies } -nsAttrValue nsSVGElement::WillChangeLengthList(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeLengthList(uint8_t aAttrEnum) { return WillChangeValue(GetLengthListInfo().mLengthListInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeLengthList(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeLengthList(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { LengthListAttributesInfo info = GetLengthListInfo(); NS_ASSERTION(info.mLengthListCount > 0, @@ -1473,7 +1472,7 @@ void nsSVGElement::DidChangeLengthList(uint8_t aAttrEnum, newValue); } -void nsSVGElement::DidAnimateLengthList(uint8_t aAttrEnum) { +void SVGElement::DidAnimateLengthList(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1484,7 +1483,7 @@ void nsSVGElement::DidAnimateLengthList(uint8_t aAttrEnum) { } } -void nsSVGElement::GetAnimatedLengthListValues(SVGUserUnitList* aFirst, ...) { +void SVGElement::GetAnimatedLengthListValues(SVGUserUnitList* aFirst, ...) { LengthListAttributesInfo info = GetLengthListInfo(); NS_ASSERTION( @@ -1507,7 +1506,7 @@ void nsSVGElement::GetAnimatedLengthListValues(SVGUserUnitList* aFirst, ...) { va_end(args); } -SVGAnimatedLengthList* nsSVGElement::GetAnimatedLengthList(uint8_t aAttrEnum) { +SVGAnimatedLengthList* SVGElement::GetAnimatedLengthList(uint8_t aAttrEnum) { LengthListAttributesInfo info = GetLengthListInfo(); if (aAttrEnum < info.mLengthListCount) { return &(info.mLengthLists[aAttrEnum]); @@ -1516,22 +1515,22 @@ SVGAnimatedLengthList* nsSVGElement::GetAnimatedLengthList(uint8_t aAttrEnum) { return nullptr; } -nsSVGElement::NumberListAttributesInfo nsSVGElement::GetNumberListInfo() { +SVGElement::NumberListAttributesInfo SVGElement::GetNumberListInfo() { return NumberListAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::NumberListAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::NumberListAttributesInfo::Reset(uint8_t aAttrEnum) { MOZ_ASSERT(aAttrEnum < mNumberListCount, "Bad attr enum"); mNumberLists[aAttrEnum].ClearBaseValue(aAttrEnum); // caller notifies } -nsAttrValue nsSVGElement::WillChangeNumberList(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeNumberList(uint8_t aAttrEnum) { return WillChangeValue(GetNumberListInfo().mNumberListInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeNumberList(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeNumberList(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { NumberListAttributesInfo info = GetNumberListInfo(); MOZ_ASSERT(info.mNumberListCount > 0, @@ -1545,7 +1544,7 @@ void nsSVGElement::DidChangeNumberList(uint8_t aAttrEnum, newValue); } -void nsSVGElement::DidAnimateNumberList(uint8_t aAttrEnum) { +void SVGElement::DidAnimateNumberList(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1558,7 +1557,7 @@ void nsSVGElement::DidAnimateNumberList(uint8_t aAttrEnum) { } } -SVGAnimatedNumberList* nsSVGElement::GetAnimatedNumberList(uint8_t aAttrEnum) { +SVGAnimatedNumberList* SVGElement::GetAnimatedNumberList(uint8_t aAttrEnum) { NumberListAttributesInfo info = GetNumberListInfo(); if (aAttrEnum < info.mNumberListCount) { return &(info.mNumberLists[aAttrEnum]); @@ -1567,7 +1566,7 @@ SVGAnimatedNumberList* nsSVGElement::GetAnimatedNumberList(uint8_t aAttrEnum) { return nullptr; } -SVGAnimatedNumberList* nsSVGElement::GetAnimatedNumberList(nsAtom* aAttrName) { +SVGAnimatedNumberList* SVGElement::GetAnimatedNumberList(nsAtom* aAttrName) { NumberListAttributesInfo info = GetNumberListInfo(); for (uint32_t i = 0; i < info.mNumberListCount; i++) { if (aAttrName == info.mNumberListInfo[i].mName) { @@ -1578,12 +1577,12 @@ SVGAnimatedNumberList* nsSVGElement::GetAnimatedNumberList(nsAtom* aAttrName) { return nullptr; } -nsAttrValue nsSVGElement::WillChangePointList() { +nsAttrValue SVGElement::WillChangePointList() { MOZ_ASSERT(GetPointListAttrName(), "Changing non-existent point list?"); return WillChangeValue(GetPointListAttrName()); } -void nsSVGElement::DidChangePointList(const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangePointList(const nsAttrValue& aEmptyOrOldValue) { MOZ_ASSERT(GetPointListAttrName(), "Changing non-existent point list?"); nsAttrValue newValue; @@ -1592,7 +1591,7 @@ void nsSVGElement::DidChangePointList(const nsAttrValue& aEmptyOrOldValue) { DidChangeValue(GetPointListAttrName(), aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimatePointList() { +void SVGElement::DidAnimatePointList() { MOZ_ASSERT(GetPointListAttrName(), "Animating non-existent path data?"); ClearAnyCachedPath(); @@ -1605,12 +1604,12 @@ void nsSVGElement::DidAnimatePointList() { } } -nsAttrValue nsSVGElement::WillChangePathSegList() { +nsAttrValue SVGElement::WillChangePathSegList() { MOZ_ASSERT(GetPathDataAttrName(), "Changing non-existent path seg list?"); return WillChangeValue(GetPathDataAttrName()); } -void nsSVGElement::DidChangePathSegList(const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangePathSegList(const nsAttrValue& aEmptyOrOldValue) { MOZ_ASSERT(GetPathDataAttrName(), "Changing non-existent path seg list?"); nsAttrValue newValue; @@ -1619,7 +1618,7 @@ void nsSVGElement::DidChangePathSegList(const nsAttrValue& aEmptyOrOldValue) { DidChangeValue(GetPathDataAttrName(), aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimatePathSegList() { +void SVGElement::DidAnimatePathSegList() { MOZ_ASSERT(GetPathDataAttrName(), "Animating non-existent path data?"); ClearAnyCachedPath(); @@ -1632,15 +1631,15 @@ void nsSVGElement::DidAnimatePathSegList() { } } -nsSVGElement::NumberAttributesInfo nsSVGElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGElement::GetNumberInfo() { return NumberAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::NumberAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::NumberAttributesInfo::Reset(uint8_t aAttrEnum) { mNumbers[aAttrEnum].Init(aAttrEnum, mNumberInfo[aAttrEnum].mDefaultValue); } -void nsSVGElement::DidChangeNumber(uint8_t aAttrEnum) { +void SVGElement::DidChangeNumber(uint8_t aAttrEnum) { NumberAttributesInfo info = GetNumberInfo(); NS_ASSERTION(info.mNumberCount > 0, @@ -1654,7 +1653,7 @@ void nsSVGElement::DidChangeNumber(uint8_t aAttrEnum) { attrValue, true); } -void nsSVGElement::DidAnimateNumber(uint8_t aAttrEnum) { +void SVGElement::DidAnimateNumber(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1665,7 +1664,7 @@ void nsSVGElement::DidAnimateNumber(uint8_t aAttrEnum) { } } -void nsSVGElement::GetAnimatedNumberValues(float* aFirst, ...) { +void SVGElement::GetAnimatedNumberValues(float* aFirst, ...) { NumberAttributesInfo info = GetNumberInfo(); NS_ASSERTION(info.mNumberCount > 0, @@ -1684,22 +1683,22 @@ void nsSVGElement::GetAnimatedNumberValues(float* aFirst, ...) { va_end(args); } -nsSVGElement::NumberPairAttributesInfo nsSVGElement::GetNumberPairInfo() { +SVGElement::NumberPairAttributesInfo SVGElement::GetNumberPairInfo() { return NumberPairAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::NumberPairAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::NumberPairAttributesInfo::Reset(uint8_t aAttrEnum) { mNumberPairs[aAttrEnum].Init(aAttrEnum, mNumberPairInfo[aAttrEnum].mDefaultValue1, mNumberPairInfo[aAttrEnum].mDefaultValue2); } -nsAttrValue nsSVGElement::WillChangeNumberPair(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeNumberPair(uint8_t aAttrEnum) { return WillChangeValue(GetNumberPairInfo().mNumberPairInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeNumberPair(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeNumberPair(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { NumberPairAttributesInfo info = GetNumberPairInfo(); NS_ASSERTION(info.mNumberPairCount > 0, @@ -1713,7 +1712,7 @@ void nsSVGElement::DidChangeNumberPair(uint8_t aAttrEnum, newValue); } -void nsSVGElement::DidAnimateNumberPair(uint8_t aAttrEnum) { +void SVGElement::DidAnimateNumberPair(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1724,15 +1723,15 @@ void nsSVGElement::DidAnimateNumberPair(uint8_t aAttrEnum) { } } -nsSVGElement::IntegerAttributesInfo nsSVGElement::GetIntegerInfo() { +SVGElement::IntegerAttributesInfo SVGElement::GetIntegerInfo() { return IntegerAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::IntegerAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::IntegerAttributesInfo::Reset(uint8_t aAttrEnum) { mIntegers[aAttrEnum].Init(aAttrEnum, mIntegerInfo[aAttrEnum].mDefaultValue); } -void nsSVGElement::DidChangeInteger(uint8_t aAttrEnum) { +void SVGElement::DidChangeInteger(uint8_t aAttrEnum) { IntegerAttributesInfo info = GetIntegerInfo(); NS_ASSERTION(info.mIntegerCount > 0, @@ -1746,7 +1745,7 @@ void nsSVGElement::DidChangeInteger(uint8_t aAttrEnum) { attrValue, true); } -void nsSVGElement::DidAnimateInteger(uint8_t aAttrEnum) { +void SVGElement::DidAnimateInteger(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1757,7 +1756,7 @@ void nsSVGElement::DidAnimateInteger(uint8_t aAttrEnum) { } } -void nsSVGElement::GetAnimatedIntegerValues(int32_t* aFirst, ...) { +void SVGElement::GetAnimatedIntegerValues(int32_t* aFirst, ...) { IntegerAttributesInfo info = GetIntegerInfo(); NS_ASSERTION(info.mIntegerCount > 0, @@ -1776,23 +1775,23 @@ void nsSVGElement::GetAnimatedIntegerValues(int32_t* aFirst, ...) { va_end(args); } -nsSVGElement::IntegerPairAttributesInfo nsSVGElement::GetIntegerPairInfo() { +SVGElement::IntegerPairAttributesInfo SVGElement::GetIntegerPairInfo() { return IntegerPairAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::IntegerPairAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::IntegerPairAttributesInfo::Reset(uint8_t aAttrEnum) { mIntegerPairs[aAttrEnum].Init(aAttrEnum, mIntegerPairInfo[aAttrEnum].mDefaultValue1, mIntegerPairInfo[aAttrEnum].mDefaultValue2); } -nsAttrValue nsSVGElement::WillChangeIntegerPair(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeIntegerPair(uint8_t aAttrEnum) { return WillChangeValue( GetIntegerPairInfo().mIntegerPairInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeIntegerPair(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeIntegerPair(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { IntegerPairAttributesInfo info = GetIntegerPairInfo(); NS_ASSERTION(info.mIntegerPairCount > 0, @@ -1806,7 +1805,7 @@ void nsSVGElement::DidChangeIntegerPair(uint8_t aAttrEnum, newValue); } -void nsSVGElement::DidAnimateIntegerPair(uint8_t aAttrEnum) { +void SVGElement::DidAnimateIntegerPair(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1817,21 +1816,21 @@ void nsSVGElement::DidAnimateIntegerPair(uint8_t aAttrEnum) { } } -nsSVGElement::AngleAttributesInfo nsSVGElement::GetAngleInfo() { +SVGElement::AngleAttributesInfo SVGElement::GetAngleInfo() { return AngleAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::AngleAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::AngleAttributesInfo::Reset(uint8_t aAttrEnum) { mAngles[aAttrEnum].Init(aAttrEnum, mAngleInfo[aAttrEnum].mDefaultValue, mAngleInfo[aAttrEnum].mDefaultUnitType); } -nsAttrValue nsSVGElement::WillChangeAngle(uint8_t aAttrEnum) { +nsAttrValue SVGElement::WillChangeAngle(uint8_t aAttrEnum) { return WillChangeValue(GetAngleInfo().mAngleInfo[aAttrEnum].mName); } -void nsSVGElement::DidChangeAngle(uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeAngle(uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { AngleAttributesInfo info = GetAngleInfo(); NS_ASSERTION(info.mAngleCount > 0, @@ -1844,7 +1843,7 @@ void nsSVGElement::DidChangeAngle(uint8_t aAttrEnum, DidChangeValue(info.mAngleInfo[aAttrEnum].mName, aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimateAngle(uint8_t aAttrEnum) { +void SVGElement::DidAnimateAngle(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1854,15 +1853,15 @@ void nsSVGElement::DidAnimateAngle(uint8_t aAttrEnum) { } } -nsSVGElement::BooleanAttributesInfo nsSVGElement::GetBooleanInfo() { +SVGElement::BooleanAttributesInfo SVGElement::GetBooleanInfo() { return BooleanAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::BooleanAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::BooleanAttributesInfo::Reset(uint8_t aAttrEnum) { mBooleans[aAttrEnum].Init(aAttrEnum, mBooleanInfo[aAttrEnum].mDefaultValue); } -void nsSVGElement::DidChangeBoolean(uint8_t aAttrEnum) { +void SVGElement::DidChangeBoolean(uint8_t aAttrEnum) { BooleanAttributesInfo info = GetBooleanInfo(); NS_ASSERTION(info.mBooleanCount > 0, @@ -1874,7 +1873,7 @@ void nsSVGElement::DidChangeBoolean(uint8_t aAttrEnum) { attrValue, true); } -void nsSVGElement::DidAnimateBoolean(uint8_t aAttrEnum) { +void SVGElement::DidAnimateBoolean(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1885,20 +1884,20 @@ void nsSVGElement::DidAnimateBoolean(uint8_t aAttrEnum) { } } -nsSVGElement::EnumAttributesInfo nsSVGElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGElement::GetEnumInfo() { return EnumAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::EnumAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::EnumAttributesInfo::Reset(uint8_t aAttrEnum) { mEnums[aAttrEnum].Init(aAttrEnum, mEnumInfo[aAttrEnum].mDefaultValue); } -void nsSVGElement::EnumAttributesInfo::SetUnknownValue(uint8_t aAttrEnum) { +void SVGElement::EnumAttributesInfo::SetUnknownValue(uint8_t aAttrEnum) { // Fortunately in SVG every enum's unknown value is 0 mEnums[aAttrEnum].Init(aAttrEnum, 0); } -void nsSVGElement::DidChangeEnum(uint8_t aAttrEnum) { +void SVGElement::DidChangeEnum(uint8_t aAttrEnum) { EnumAttributesInfo info = GetEnumInfo(); NS_ASSERTION(info.mEnumCount > 0, @@ -1910,7 +1909,7 @@ void nsSVGElement::DidChangeEnum(uint8_t aAttrEnum) { attrValue, true); } -void nsSVGElement::DidAnimateEnum(uint8_t aAttrEnum) { +void SVGElement::DidAnimateEnum(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1920,13 +1919,13 @@ void nsSVGElement::DidAnimateEnum(uint8_t aAttrEnum) { } } -nsSVGViewBox* nsSVGElement::GetViewBox() { return nullptr; } +nsSVGViewBox* SVGElement::GetViewBox() { return nullptr; } -nsAttrValue nsSVGElement::WillChangeViewBox() { +nsAttrValue SVGElement::WillChangeViewBox() { return WillChangeValue(nsGkAtoms::viewBox); } -void nsSVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) { nsSVGViewBox* viewBox = GetViewBox(); NS_ASSERTION(viewBox, "DidChangeViewBox on element with no viewBox attrib"); @@ -1937,7 +1936,7 @@ void nsSVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) { DidChangeValue(nsGkAtoms::viewBox, aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimateViewBox() { +void SVGElement::DidAnimateViewBox() { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1946,15 +1945,15 @@ void nsSVGElement::DidAnimateViewBox() { } } -SVGAnimatedPreserveAspectRatio* nsSVGElement::GetPreserveAspectRatio() { +SVGAnimatedPreserveAspectRatio* SVGElement::GetPreserveAspectRatio() { return nullptr; } -nsAttrValue nsSVGElement::WillChangePreserveAspectRatio() { +nsAttrValue SVGElement::WillChangePreserveAspectRatio() { return WillChangeValue(nsGkAtoms::preserveAspectRatio); } -void nsSVGElement::DidChangePreserveAspectRatio( +void SVGElement::DidChangePreserveAspectRatio( const nsAttrValue& aEmptyOrOldValue) { SVGAnimatedPreserveAspectRatio* preserveAspectRatio = GetPreserveAspectRatio(); @@ -1969,7 +1968,7 @@ void nsSVGElement::DidChangePreserveAspectRatio( DidChangeValue(nsGkAtoms::preserveAspectRatio, aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimatePreserveAspectRatio() { +void SVGElement::DidAnimatePreserveAspectRatio() { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -1978,11 +1977,11 @@ void nsSVGElement::DidAnimatePreserveAspectRatio() { } } -nsAttrValue nsSVGElement::WillChangeTransformList() { +nsAttrValue SVGElement::WillChangeTransformList() { return WillChangeValue(GetTransformListAttrName()); } -void nsSVGElement::DidChangeTransformList(const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeTransformList(const nsAttrValue& aEmptyOrOldValue) { MOZ_ASSERT(GetTransformListAttrName(), "Changing non-existent transform list?"); @@ -1995,7 +1994,7 @@ void nsSVGElement::DidChangeTransformList(const nsAttrValue& aEmptyOrOldValue) { DidChangeValue(GetTransformListAttrName(), aEmptyOrOldValue, newValue); } -void nsSVGElement::DidAnimateTransformList(int32_t aModType) { +void SVGElement::DidAnimateTransformList(int32_t aModType) { MOZ_ASSERT(GetTransformListAttrName(), "Animating non-existent transform data?"); @@ -2019,18 +2018,18 @@ void nsSVGElement::DidAnimateTransformList(int32_t aModType) { } } -nsSVGElement::StringAttributesInfo nsSVGElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGElement::GetStringInfo() { return StringAttributesInfo(nullptr, nullptr, 0); } -void nsSVGElement::StringAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::StringAttributesInfo::Reset(uint8_t aAttrEnum) { mStrings[aAttrEnum].Init(aAttrEnum); } -void nsSVGElement::GetStringBaseValue(uint8_t aAttrEnum, - nsAString& aResult) const { - nsSVGElement::StringAttributesInfo info = - const_cast(this)->GetStringInfo(); +void SVGElement::GetStringBaseValue(uint8_t aAttrEnum, + nsAString& aResult) const { + SVGElement::StringAttributesInfo info = + const_cast(this)->GetStringInfo(); NS_ASSERTION(info.mStringCount > 0, "GetBaseValue on element with no string attribs"); @@ -2041,9 +2040,9 @@ void nsSVGElement::GetStringBaseValue(uint8_t aAttrEnum, info.mStringInfo[aAttrEnum].mName, aResult); } -void nsSVGElement::SetStringBaseValue(uint8_t aAttrEnum, - const nsAString& aValue) { - nsSVGElement::StringAttributesInfo info = GetStringInfo(); +void SVGElement::SetStringBaseValue(uint8_t aAttrEnum, + const nsAString& aValue) { + SVGElement::StringAttributesInfo info = GetStringInfo(); NS_ASSERTION(info.mStringCount > 0, "SetBaseValue on element with no string attribs"); @@ -2054,7 +2053,7 @@ void nsSVGElement::SetStringBaseValue(uint8_t aAttrEnum, info.mStringInfo[aAttrEnum].mName, aValue, true); } -void nsSVGElement::DidAnimateString(uint8_t aAttrEnum) { +void SVGElement::DidAnimateString(uint8_t aAttrEnum) { nsIFrame* frame = GetPrimaryFrame(); if (frame) { @@ -2065,11 +2064,11 @@ void nsSVGElement::DidAnimateString(uint8_t aAttrEnum) { } } -nsSVGElement::StringListAttributesInfo nsSVGElement::GetStringListInfo() { +SVGElement::StringListAttributesInfo SVGElement::GetStringListInfo() { return StringListAttributesInfo(nullptr, nullptr, 0); } -nsAttrValue nsSVGElement::WillChangeStringList( +nsAttrValue SVGElement::WillChangeStringList( bool aIsConditionalProcessingAttribute, uint8_t aAttrEnum) { nsStaticAtom* name; if (aIsConditionalProcessingAttribute) { @@ -2081,9 +2080,9 @@ nsAttrValue nsSVGElement::WillChangeStringList( return WillChangeValue(name); } -void nsSVGElement::DidChangeStringList(bool aIsConditionalProcessingAttribute, - uint8_t aAttrEnum, - const nsAttrValue& aEmptyOrOldValue) { +void SVGElement::DidChangeStringList(bool aIsConditionalProcessingAttribute, + uint8_t aAttrEnum, + const nsAttrValue& aEmptyOrOldValue) { nsStaticAtom* name; nsAttrValue newValue; nsCOMPtr tests; @@ -2110,14 +2109,14 @@ void nsSVGElement::DidChangeStringList(bool aIsConditionalProcessingAttribute, } } -void nsSVGElement::StringListAttributesInfo::Reset(uint8_t aAttrEnum) { +void SVGElement::StringListAttributesInfo::Reset(uint8_t aAttrEnum) { mStringLists[aAttrEnum].Clear(); // caller notifies } -nsresult nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument, - nsAtom* aAttribute, - const nsAString& aValue) { +nsresult SVGElement::ReportAttributeParseFailure(nsIDocument* aDocument, + nsAtom* aAttribute, + const nsAString& aValue) { const nsString& attributeValue = PromiseFlatString(aValue); const char16_t* strings[] = {aAttribute->GetUTF16String(), attributeValue.get()}; @@ -2125,7 +2124,7 @@ nsresult nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument, strings, ArrayLength(strings)); } -void nsSVGElement::RecompileScriptEventListeners() { +void SVGElement::RecompileScriptEventListeners() { int32_t i, count = mAttrs.AttrCount(); for (i = 0; i < count; ++i) { const nsAttrName* name = mAttrs.AttrNameAt(i); @@ -2146,8 +2145,8 @@ void nsSVGElement::RecompileScriptEventListeners() { } } -UniquePtr nsSVGElement::GetAnimatedAttr(int32_t aNamespaceID, - nsAtom* aName) { +UniquePtr SVGElement::GetAnimatedAttr(int32_t aNamespaceID, + nsAtom* aName) { if (aNamespaceID == kNameSpaceID_None) { // Transforms: if (GetTransformListAttrName() == aName) { @@ -2316,16 +2315,19 @@ UniquePtr nsSVGElement::GetAnimatedAttr(int32_t aNamespaceID, return nullptr; } -void nsSVGElement::AnimationNeedsResample() { +void SVGElement::AnimationNeedsResample() { nsIDocument* doc = GetComposedDoc(); if (doc && doc->HasAnimationController()) { doc->GetAnimationController()->SetResampleNeeded(); } } -void nsSVGElement::FlushAnimations() { +void SVGElement::FlushAnimations() { nsIDocument* doc = GetComposedDoc(); if (doc && doc->HasAnimationController()) { doc->GetAnimationController()->FlushResampleRequests(); } } + +} // namespace dom +} // namespace mozilla diff --git a/dom/svg/nsSVGElement.h b/dom/svg/SVGElement.h similarity index 96% rename from dom/svg/nsSVGElement.h rename to dom/svg/SVGElement.h index c5d8419c18cb..a2a36b10a274 100644 --- a/dom/svg/nsSVGElement.h +++ b/dom/svg/SVGElement.h @@ -8,7 +8,7 @@ #define __NS_SVGELEMENT_H__ /* - nsSVGElement is the base class for all SVG content elements. + SVGElement is the base class for all SVG content elements. It implements all the common DOM interfaces and handles attributes. */ @@ -38,15 +38,14 @@ class nsSVGNumberPair; class nsSVGString; class nsSVGViewBox; +struct nsSVGEnumMapping; + +nsresult NS_NewSVGElement(mozilla::dom::Element** aResult, + already_AddRefed&& aNodeInfo); + namespace mozilla { class DeclarationBlock; -namespace dom { -class SVGSVGElement; -class SVGViewportElement; - -} // namespace dom - class SVGAnimatedNumberList; class SVGNumberList; class SVGAnimatedLengthList; @@ -58,21 +57,21 @@ class nsSVGAnimatedTransformList; class SVGStringList; class DOMSVGStringList; -} // namespace mozilla +namespace dom { +class SVGSVGElement; +class SVGViewportElement; -struct nsSVGEnumMapping; +typedef nsStyledElement SVGElementBase; -typedef nsStyledElement nsSVGElementBase; - -class nsSVGElement : public nsSVGElementBase // nsIContent +class SVGElement : public SVGElementBase // nsIContent { protected: - explicit nsSVGElement(already_AddRefed&& aNodeInfo); - friend nsresult NS_NewSVGElement( - mozilla::dom::Element** aResult, - already_AddRefed&& aNodeInfo); + explicit SVGElement(already_AddRefed&& aNodeInfo); + friend nsresult( + ::NS_NewSVGElement(mozilla::dom::Element** aResult, + already_AddRefed&& aNodeInfo)); nsresult Init(); - virtual ~nsSVGElement(); + virtual ~SVGElement(); public: virtual nsresult Clone(mozilla::dom::NodeInfo*, @@ -90,7 +89,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent typedef mozilla::SVGStringList SVGStringList; // nsISupports - NS_INLINE_DECL_REFCOUNTING_INHERITED(nsSVGElement, nsSVGElementBase) + NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGElement, SVGElementBase) void DidAnimateClass(); @@ -125,7 +124,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent static const MappedAttributeEntry sLightingEffectsMap[]; static const MappedAttributeEntry sMaskMap[]; - NS_IMPL_FROMNODE(nsSVGElement, kNameSpaceID_SVG) + NS_IMPL_FROMNODE(SVGElement, kNameSpaceID_SVG) // Gets the element that establishes the rectangular viewport against which // we should resolve percentage lengths (our "coordinate context"). Returns @@ -157,7 +156,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent */ virtual gfxMatrix PrependLocalTransformsTo( const gfxMatrix& aMatrix, - mozilla::SVGTransformTypes aWhich = mozilla::eAllTransforms) const; + SVGTransformTypes aWhich = eAllTransforms) const; // Setter for to set the current transformation // Only visible for nsSVGGraphicElement, so it's a no-op here, and that @@ -301,7 +300,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent // WebIDL mozilla::dom::SVGSVGElement* GetOwnerSVGElement(); - nsSVGElement* GetViewportElement(); + SVGElement* GetViewportElement(); already_AddRefed ClassName(); void UpdateContentDeclarationBlock(); @@ -315,7 +314,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent // by SVG elements. // This is because we're not currently passing the correct value for aValue to // BeforeSetAttr since it would involve allocating extra SVG value types. - // See the comment in nsSVGElement::WillChangeValue. + // See the comment in SVGElement::WillChangeValue. nsresult BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName, const nsAttrValueOrString* aValue, bool aNotify) final; virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, @@ -479,7 +478,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent void Reset(uint8_t aAttrEnum); }; - friend class nsSVGEnum; + friend class ::nsSVGEnum; struct EnumInfo { nsStaticAtom* const mName; @@ -697,4 +696,7 @@ class nsSVGElement : public nsSVGElementBase // nsIContent NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \ NS_IMPL_CYCLE_COLLECTION_TRACE_END +} // namespace dom +} // namespace mozilla + #endif // __NS_SVGELEMENT_H__ diff --git a/dom/svg/SVGEllipseElement.cpp b/dom/svg/SVGEllipseElement.cpp index 402320ae7d85..555fdc934c24 100644 --- a/dom/svg/SVGEllipseElement.cpp +++ b/dom/svg/SVGEllipseElement.cpp @@ -23,7 +23,7 @@ JSObject* SVGEllipseElement::WrapNode(JSContext* aCx, return SVGEllipseElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGEllipseElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGEllipseElement::sLengthInfo[4] = { {nsGkAtoms::cx, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::cy, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -66,7 +66,7 @@ already_AddRefed SVGEllipseElement::Ry() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGEllipseElement::HasValidDimensions() const { return mLengthAttributes[RX].IsExplicitlySet() && @@ -75,7 +75,7 @@ already_AddRefed SVGEllipseElement::Ry() { mLengthAttributes[RY].GetAnimValInSpecifiedUnits() > 0; } -nsSVGElement::LengthAttributesInfo SVGEllipseElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGEllipseElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGFEBlendElement.cpp b/dom/svg/SVGFEBlendElement.cpp index bea5b73ec255..ba1078f4b312 100644 --- a/dom/svg/SVGFEBlendElement.cpp +++ b/dom/svg/SVGFEBlendElement.cpp @@ -39,10 +39,10 @@ nsSVGEnumMapping SVGFEBlendElement::sModeMap[] = { {nsGkAtoms::luminosity, SVG_FEBLEND_MODE_LUMINOSITY}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFEBlendElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGFEBlendElement::sEnumInfo[1] = { {nsGkAtoms::mode, sModeMap, SVG_FEBLEND_MODE_NORMAL}}; -nsSVGElement::StringInfo SVGFEBlendElement::sStringInfo[3] = { +SVGElement::StringInfo SVGFEBlendElement::sStringInfo[3] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}, {nsGkAtoms::in2, kNameSpaceID_None, true}}; @@ -93,13 +93,13 @@ void SVGFEBlendElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::EnumAttributesInfo SVGFEBlendElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFEBlendElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFEBlendElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEBlendElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEColorMatrixElement.cpp b/dom/svg/SVGFEColorMatrixElement.cpp index 8212487bea63..eaa88111828e 100644 --- a/dom/svg/SVGFEColorMatrixElement.cpp +++ b/dom/svg/SVGFEColorMatrixElement.cpp @@ -30,14 +30,14 @@ nsSVGEnumMapping SVGFEColorMatrixElement::sTypeMap[] = { {nsGkAtoms::luminanceToAlpha, SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFEColorMatrixElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGFEColorMatrixElement::sEnumInfo[1] = { {nsGkAtoms::type, sTypeMap, SVG_FECOLORMATRIX_TYPE_MATRIX}}; -nsSVGElement::StringInfo SVGFEColorMatrixElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEColorMatrixElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; -nsSVGElement::NumberListInfo SVGFEColorMatrixElement::sNumberListInfo[1] = { +SVGElement::NumberListInfo SVGFEColorMatrixElement::sNumberListInfo[1] = { {nsGkAtoms::values}}; //---------------------------------------------------------------------- @@ -107,18 +107,18 @@ bool SVGFEColorMatrixElement::AttributeAffectsRendering( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::EnumAttributesInfo SVGFEColorMatrixElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFEColorMatrixElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFEColorMatrixElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEColorMatrixElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } -nsSVGElement::NumberListAttributesInfo +SVGElement::NumberListAttributesInfo SVGFEColorMatrixElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, ArrayLength(sNumberListInfo)); diff --git a/dom/svg/SVGFEComponentTransferElement.cpp b/dom/svg/SVGFEComponentTransferElement.cpp index cb0e8e585f1d..5bb9be494d74 100644 --- a/dom/svg/SVGFEComponentTransferElement.cpp +++ b/dom/svg/SVGFEComponentTransferElement.cpp @@ -23,7 +23,7 @@ JSObject* SVGFEComponentTransferElement::WrapNode( return SVGFEComponentTransferElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFEComponentTransferElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEComponentTransferElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -37,9 +37,9 @@ already_AddRefed SVGFEComponentTransferElement::In1() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo +SVGElement::StringAttributesInfo SVGFEComponentTransferElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); diff --git a/dom/svg/SVGFECompositeElement.cpp b/dom/svg/SVGFECompositeElement.cpp index be2c113801d2..f584b788cad6 100644 --- a/dom/svg/SVGFECompositeElement.cpp +++ b/dom/svg/SVGFECompositeElement.cpp @@ -19,7 +19,7 @@ JSObject* SVGFECompositeElement::WrapNode(JSContext* aCx, return SVGFECompositeElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFECompositeElement::sNumberInfo[4] = { +SVGElement::NumberInfo SVGFECompositeElement::sNumberInfo[4] = { {nsGkAtoms::k1, 0, false}, {nsGkAtoms::k2, 0, false}, {nsGkAtoms::k3, 0, false}, @@ -34,10 +34,10 @@ nsSVGEnumMapping SVGFECompositeElement::sOperatorMap[] = { {nsGkAtoms::arithmetic, SVG_FECOMPOSITE_OPERATOR_ARITHMETIC}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFECompositeElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGFECompositeElement::sEnumInfo[1] = { {nsGkAtoms::_operator, sOperatorMap, SVG_FECOMPOSITE_OPERATOR_OVER}}; -nsSVGElement::StringInfo SVGFECompositeElement::sStringInfo[3] = { +SVGElement::StringInfo SVGFECompositeElement::sStringInfo[3] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}, {nsGkAtoms::in2, kNameSpaceID_None, true}}; @@ -117,18 +117,18 @@ void SVGFECompositeElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFECompositeElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFECompositeElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::EnumAttributesInfo SVGFECompositeElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFECompositeElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFECompositeElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFECompositeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEConvolveMatrixElement.cpp b/dom/svg/SVGFEConvolveMatrixElement.cpp index c673638467e2..713de74fea37 100644 --- a/dom/svg/SVGFEConvolveMatrixElement.cpp +++ b/dom/svg/SVGFEConvolveMatrixElement.cpp @@ -24,19 +24,19 @@ JSObject* SVGFEConvolveMatrixElement::WrapNode( return SVGFEConvolveMatrixElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEConvolveMatrixElement::sNumberInfo[2] = { +SVGElement::NumberInfo SVGFEConvolveMatrixElement::sNumberInfo[2] = { {nsGkAtoms::divisor, 1, false}, {nsGkAtoms::bias, 0, false}}; -nsSVGElement::NumberPairInfo SVGFEConvolveMatrixElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFEConvolveMatrixElement::sNumberPairInfo[1] = { {nsGkAtoms::kernelUnitLength, 0, 0}}; -nsSVGElement::IntegerInfo SVGFEConvolveMatrixElement::sIntegerInfo[2] = { +SVGElement::IntegerInfo SVGFEConvolveMatrixElement::sIntegerInfo[2] = { {nsGkAtoms::targetX, 0}, {nsGkAtoms::targetY, 0}}; -nsSVGElement::IntegerPairInfo SVGFEConvolveMatrixElement::sIntegerPairInfo[1] = - {{nsGkAtoms::order, 3, 3}}; +SVGElement::IntegerPairInfo SVGFEConvolveMatrixElement::sIntegerPairInfo[1] = { + {nsGkAtoms::order, 3, 3}}; -nsSVGElement::BooleanInfo SVGFEConvolveMatrixElement::sBooleanInfo[1] = { +SVGElement::BooleanInfo SVGFEConvolveMatrixElement::sBooleanInfo[1] = { {nsGkAtoms::preserveAlpha, false}}; nsSVGEnumMapping SVGFEConvolveMatrixElement::sEdgeModeMap[] = { @@ -45,14 +45,14 @@ nsSVGEnumMapping SVGFEConvolveMatrixElement::sEdgeModeMap[] = { {nsGkAtoms::none, SVG_EDGEMODE_NONE}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFEConvolveMatrixElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGFEConvolveMatrixElement::sEnumInfo[1] = { {nsGkAtoms::edgeMode, sEdgeModeMap, SVG_EDGEMODE_DUPLICATE}}; -nsSVGElement::StringInfo SVGFEConvolveMatrixElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEConvolveMatrixElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; -nsSVGElement::NumberListInfo SVGFEConvolveMatrixElement::sNumberListInfo[1] = { +SVGElement::NumberListInfo SVGFEConvolveMatrixElement::sNumberListInfo[1] = { {nsGkAtoms::kernelMatrix}}; //---------------------------------------------------------------------- @@ -221,47 +221,45 @@ bool SVGFEConvolveMatrixElement::AttributeAffectsRendering( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFEConvolveMatrixElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEConvolveMatrixElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::NumberPairAttributesInfo +SVGElement::NumberPairAttributesInfo SVGFEConvolveMatrixElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::IntegerAttributesInfo -SVGFEConvolveMatrixElement::GetIntegerInfo() { +SVGElement::IntegerAttributesInfo SVGFEConvolveMatrixElement::GetIntegerInfo() { return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo, ArrayLength(sIntegerInfo)); } -nsSVGElement::IntegerPairAttributesInfo +SVGElement::IntegerPairAttributesInfo SVGFEConvolveMatrixElement::GetIntegerPairInfo() { return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo, ArrayLength(sIntegerPairInfo)); } -nsSVGElement::BooleanAttributesInfo -SVGFEConvolveMatrixElement::GetBooleanInfo() { +SVGElement::BooleanAttributesInfo SVGFEConvolveMatrixElement::GetBooleanInfo() { return BooleanAttributesInfo(mBooleanAttributes, sBooleanInfo, ArrayLength(sBooleanInfo)); } -nsSVGElement::EnumAttributesInfo SVGFEConvolveMatrixElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFEConvolveMatrixElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFEConvolveMatrixElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEConvolveMatrixElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } -nsSVGElement::NumberListAttributesInfo +SVGElement::NumberListAttributesInfo SVGFEConvolveMatrixElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, ArrayLength(sNumberListInfo)); diff --git a/dom/svg/SVGFEDisplacementMapElement.cpp b/dom/svg/SVGFEDisplacementMapElement.cpp index da2e959ec879..b08056a5ca7e 100644 --- a/dom/svg/SVGFEDisplacementMapElement.cpp +++ b/dom/svg/SVGFEDisplacementMapElement.cpp @@ -21,7 +21,7 @@ JSObject* SVGFEDisplacementMapElement::WrapNode( return SVGFEDisplacementMapElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEDisplacementMapElement::sNumberInfo[1] = { +SVGElement::NumberInfo SVGFEDisplacementMapElement::sNumberInfo[1] = { {nsGkAtoms::scale, 0, false}, }; @@ -32,11 +32,11 @@ nsSVGEnumMapping SVGFEDisplacementMapElement::sChannelMap[] = { {nsGkAtoms::A, SVG_CHANNEL_A}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFEDisplacementMapElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGFEDisplacementMapElement::sEnumInfo[2] = { {nsGkAtoms::xChannelSelector, sChannelMap, SVG_CHANNEL_A}, {nsGkAtoms::yChannelSelector, sChannelMap, SVG_CHANNEL_A}}; -nsSVGElement::StringInfo SVGFEDisplacementMapElement::sStringInfo[3] = { +SVGElement::StringInfo SVGFEDisplacementMapElement::sStringInfo[3] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}, {nsGkAtoms::in2, kNameSpaceID_None, true}}; @@ -111,20 +111,18 @@ void SVGFEDisplacementMapElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo -SVGFEDisplacementMapElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEDisplacementMapElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::EnumAttributesInfo SVGFEDisplacementMapElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFEDisplacementMapElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo -SVGFEDisplacementMapElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEDisplacementMapElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEDistantLightElement.cpp b/dom/svg/SVGFEDistantLightElement.cpp index 679d0c259489..e94bf449d73b 100644 --- a/dom/svg/SVGFEDistantLightElement.cpp +++ b/dom/svg/SVGFEDistantLightElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFEDistantLightElement::WrapNode( return SVGFEDistantLightElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] = { +SVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] = { {nsGkAtoms::azimuth, 0, false}, {nsGkAtoms::elevation, 0, false}}; //---------------------------------------------------------------------- @@ -58,9 +58,9 @@ already_AddRefed SVGFEDistantLightElement::Elevation() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFEDistantLightElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEDistantLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } diff --git a/dom/svg/SVGFEDropShadowElement.cpp b/dom/svg/SVGFEDropShadowElement.cpp index e6224e2bb9bb..71bc3aed03bd 100644 --- a/dom/svg/SVGFEDropShadowElement.cpp +++ b/dom/svg/SVGFEDropShadowElement.cpp @@ -21,13 +21,13 @@ JSObject* SVGFEDropShadowElement::WrapNode(JSContext* aCx, return SVGFEDropShadowElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEDropShadowElement::sNumberInfo[2] = { +SVGElement::NumberInfo SVGFEDropShadowElement::sNumberInfo[2] = { {nsGkAtoms::dx, 2, false}, {nsGkAtoms::dy, 2, false}}; -nsSVGElement::NumberPairInfo SVGFEDropShadowElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFEDropShadowElement::sNumberPairInfo[1] = { {nsGkAtoms::stdDeviation, 2, 2}}; -nsSVGElement::StringInfo SVGFEDropShadowElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEDropShadowElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -128,20 +128,20 @@ SVGFEDropShadowElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFEDropShadowElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEDropShadowElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::NumberPairAttributesInfo +SVGElement::NumberPairAttributesInfo SVGFEDropShadowElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::StringAttributesInfo SVGFEDropShadowElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEDropShadowElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEFloodElement.cpp b/dom/svg/SVGFEFloodElement.cpp index 177c939ff9fa..8d739ca5e17a 100644 --- a/dom/svg/SVGFEFloodElement.cpp +++ b/dom/svg/SVGFEFloodElement.cpp @@ -23,7 +23,7 @@ JSObject* SVGFEFloodElement::WrapNode(JSContext* aCx, return SVGFEFloodElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFEFloodElement::sStringInfo[1] = { +SVGElement::StringInfo SVGFEFloodElement::sStringInfo[1] = { {nsGkAtoms::result, kNameSpaceID_None, true}}; //---------------------------------------------------------------------- @@ -60,9 +60,9 @@ SVGFEFloodElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGFEFloodElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEFloodElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEGaussianBlurElement.cpp b/dom/svg/SVGFEGaussianBlurElement.cpp index 3ade503ca151..20df417fd76f 100644 --- a/dom/svg/SVGFEGaussianBlurElement.cpp +++ b/dom/svg/SVGFEGaussianBlurElement.cpp @@ -21,10 +21,10 @@ JSObject* SVGFEGaussianBlurElement::WrapNode( return SVGFEGaussianBlurElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberPairInfo SVGFEGaussianBlurElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFEGaussianBlurElement::sNumberPairInfo[1] = { {nsGkAtoms::stdDeviation, 0, 0}}; -nsSVGElement::StringInfo SVGFEGaussianBlurElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEGaussianBlurElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -89,15 +89,15 @@ void SVGFEGaussianBlurElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberPairAttributesInfo +SVGElement::NumberPairAttributesInfo SVGFEGaussianBlurElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::StringAttributesInfo SVGFEGaussianBlurElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEGaussianBlurElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEImageElement.cpp b/dom/svg/SVGFEImageElement.cpp index 62c18e2b4de0..0fb3c880ac06 100644 --- a/dom/svg/SVGFEImageElement.cpp +++ b/dom/svg/SVGFEImageElement.cpp @@ -32,7 +32,7 @@ JSObject* SVGFEImageElement::WrapNode(JSContext* aCx, return SVGFEImageElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFEImageElement::sStringInfo[3] = { +SVGElement::StringInfo SVGFEImageElement::sStringInfo[3] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -282,7 +282,7 @@ bool SVGFEImageElement::OutputIsTainted(const nsTArray& aInputsAreTainted, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods already_AddRefed SVGFEImageElement::PreserveAspectRatio() { @@ -293,7 +293,7 @@ SVGAnimatedPreserveAspectRatio* SVGFEImageElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } -nsSVGElement::StringAttributesInfo SVGFEImageElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEImageElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEMergeElement.cpp b/dom/svg/SVGFEMergeElement.cpp index 409e9b952243..af5bc614a7b5 100644 --- a/dom/svg/SVGFEMergeElement.cpp +++ b/dom/svg/SVGFEMergeElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFEMergeElement::WrapNode(JSContext* aCx, return SVGFEMergeElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFEMergeElement::sStringInfo[1] = { +SVGElement::StringInfo SVGFEMergeElement::sStringInfo[1] = { {nsGkAtoms::result, kNameSpaceID_None, true}}; NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMergeElement) @@ -44,9 +44,9 @@ void SVGFEMergeElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGFEMergeElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEMergeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEMergeNodeElement.cpp b/dom/svg/SVGFEMergeNodeElement.cpp index 1a915acee754..5f5f9c5ca4dd 100644 --- a/dom/svg/SVGFEMergeNodeElement.cpp +++ b/dom/svg/SVGFEMergeNodeElement.cpp @@ -17,7 +17,7 @@ JSObject* SVGFEMergeNodeElement::WrapNode(JSContext* aCx, return SVGFEMergeNodeElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFEMergeNodeElement::sStringInfo[1] = { +SVGElement::StringInfo SVGFEMergeNodeElement::sStringInfo[1] = { {nsGkAtoms::in, kNameSpaceID_None, true}}; //---------------------------------------------------------------------- @@ -38,9 +38,9 @@ already_AddRefed SVGFEMergeNodeElement::In1() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGFEMergeNodeElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEMergeNodeElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEMorphologyElement.cpp b/dom/svg/SVGFEMorphologyElement.cpp index 9f46a40bbabb..7b0b442916c0 100644 --- a/dom/svg/SVGFEMorphologyElement.cpp +++ b/dom/svg/SVGFEMorphologyElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFEMorphologyElement::WrapNode(JSContext* aCx, return SVGFEMorphologyElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberPairInfo SVGFEMorphologyElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFEMorphologyElement::sNumberPairInfo[1] = { {nsGkAtoms::radius, 0, 0}}; nsSVGEnumMapping SVGFEMorphologyElement::sOperatorMap[] = { @@ -28,10 +28,10 @@ nsSVGEnumMapping SVGFEMorphologyElement::sOperatorMap[] = { {nsGkAtoms::dilate, SVG_OPERATOR_DILATE}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFEMorphologyElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGFEMorphologyElement::sEnumInfo[1] = { {nsGkAtoms::_operator, sOperatorMap, SVG_OPERATOR_ERODE}}; -nsSVGElement::StringInfo SVGFEMorphologyElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEMorphologyElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -110,19 +110,19 @@ bool SVGFEMorphologyElement::AttributeAffectsRendering( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberPairAttributesInfo +SVGElement::NumberPairAttributesInfo SVGFEMorphologyElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::EnumAttributesInfo SVGFEMorphologyElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFEMorphologyElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFEMorphologyElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEMorphologyElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEOffsetElement.cpp b/dom/svg/SVGFEOffsetElement.cpp index dcf1c73365a2..2a29bc3c2cd0 100644 --- a/dom/svg/SVGFEOffsetElement.cpp +++ b/dom/svg/SVGFEOffsetElement.cpp @@ -20,10 +20,10 @@ JSObject* SVGFEOffsetElement::WrapNode(JSContext* aCx, return SVGFEOffsetElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEOffsetElement::sNumberInfo[2] = { +SVGElement::NumberInfo SVGFEOffsetElement::sNumberInfo[2] = { {nsGkAtoms::dx, 0, false}, {nsGkAtoms::dy, 0, false}}; -nsSVGElement::StringInfo SVGFEOffsetElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFEOffsetElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -74,14 +74,14 @@ void SVGFEOffsetElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFEOffsetElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEOffsetElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::StringAttributesInfo SVGFEOffsetElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFEOffsetElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFEPointLightElement.cpp b/dom/svg/SVGFEPointLightElement.cpp index 02e2b4f259e2..d7304829e6df 100644 --- a/dom/svg/SVGFEPointLightElement.cpp +++ b/dom/svg/SVGFEPointLightElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFEPointLightElement::WrapNode(JSContext* aCx, return SVGFEPointLightElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] = { +SVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] = { {nsGkAtoms::x, 0, false}, {nsGkAtoms::y, 0, false}, {nsGkAtoms::z, 0, false}}; @@ -67,9 +67,9 @@ already_AddRefed SVGFEPointLightElement::Z() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFEPointLightElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFEPointLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } diff --git a/dom/svg/SVGFESpecularLightingElement.cpp b/dom/svg/SVGFESpecularLightingElement.cpp index 53fe207008ad..3e5f0c15437d 100644 --- a/dom/svg/SVGFESpecularLightingElement.cpp +++ b/dom/svg/SVGFESpecularLightingElement.cpp @@ -58,7 +58,7 @@ SVGFESpecularLightingElement::KernelUnitLengthY() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods FilterPrimitiveDescription SVGFESpecularLightingElement::GetPrimitiveDescription( diff --git a/dom/svg/SVGFESpotLightElement.cpp b/dom/svg/SVGFESpotLightElement.cpp index ba66bf1cff23..006cca41354c 100644 --- a/dom/svg/SVGFESpotLightElement.cpp +++ b/dom/svg/SVGFESpotLightElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFESpotLightElement::WrapNode(JSContext* aCx, return SVGFESpotLightElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] = { +SVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] = { {nsGkAtoms::x, 0, false}, {nsGkAtoms::y, 0, false}, {nsGkAtoms::z, 0, false}, @@ -104,9 +104,9 @@ already_AddRefed SVGFESpotLightElement::LimitingConeAngle() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFESpotLightElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFESpotLightElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } diff --git a/dom/svg/SVGFETileElement.cpp b/dom/svg/SVGFETileElement.cpp index d6ca99bbc453..6b35631f9600 100644 --- a/dom/svg/SVGFETileElement.cpp +++ b/dom/svg/SVGFETileElement.cpp @@ -20,7 +20,7 @@ JSObject* SVGFETileElement::WrapNode(JSContext* aCx, return SVGFETileElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGFETileElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFETileElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -39,7 +39,7 @@ void SVGFETileElement::GetSourceImageNames( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods FilterPrimitiveDescription SVGFETileElement::GetPrimitiveDescription( nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion, @@ -56,9 +56,9 @@ bool SVGFETileElement::AttributeAffectsRendering(int32_t aNameSpaceID, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGFETileElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFETileElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFETurbulenceElement.cpp b/dom/svg/SVGFETurbulenceElement.cpp index 0ca1b0e60455..e5e540d1d7b8 100644 --- a/dom/svg/SVGFETurbulenceElement.cpp +++ b/dom/svg/SVGFETurbulenceElement.cpp @@ -27,13 +27,13 @@ JSObject* SVGFETurbulenceElement::WrapNode(JSContext* aCx, return SVGFETurbulenceElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGFETurbulenceElement::sNumberInfo[1] = { +SVGElement::NumberInfo SVGFETurbulenceElement::sNumberInfo[1] = { {nsGkAtoms::seed, 0, false}}; -nsSVGElement::NumberPairInfo SVGFETurbulenceElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFETurbulenceElement::sNumberPairInfo[1] = { {nsGkAtoms::baseFrequency, 0, 0}}; -nsSVGElement::IntegerInfo SVGFETurbulenceElement::sIntegerInfo[1] = { +SVGElement::IntegerInfo SVGFETurbulenceElement::sIntegerInfo[1] = { {nsGkAtoms::numOctaves, 1}}; nsSVGEnumMapping SVGFETurbulenceElement::sTypeMap[] = { @@ -46,11 +46,11 @@ nsSVGEnumMapping SVGFETurbulenceElement::sStitchTilesMap[] = { {nsGkAtoms::noStitch, SVG_STITCHTYPE_NOSTITCH}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGFETurbulenceElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGFETurbulenceElement::sEnumInfo[2] = { {nsGkAtoms::type, sTypeMap, SVG_TURBULENCE_TYPE_TURBULENCE}, {nsGkAtoms::stitchTiles, sStitchTilesMap, SVG_STITCHTYPE_NOSTITCH}}; -nsSVGElement::StringInfo SVGFETurbulenceElement::sStringInfo[1] = { +SVGElement::StringInfo SVGFETurbulenceElement::sStringInfo[1] = { {nsGkAtoms::result, kNameSpaceID_None, true}}; //---------------------------------------------------------------------- @@ -152,29 +152,29 @@ bool SVGFETurbulenceElement::AttributeAffectsRendering( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFETurbulenceElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFETurbulenceElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::NumberPairAttributesInfo +SVGElement::NumberPairAttributesInfo SVGFETurbulenceElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::IntegerAttributesInfo SVGFETurbulenceElement::GetIntegerInfo() { +SVGElement::IntegerAttributesInfo SVGFETurbulenceElement::GetIntegerInfo() { return IntegerAttributesInfo(mIntegerAttributes, sIntegerInfo, ArrayLength(sIntegerInfo)); } -nsSVGElement::EnumAttributesInfo SVGFETurbulenceElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFETurbulenceElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFETurbulenceElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFETurbulenceElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFilterElement.cpp b/dom/svg/SVGFilterElement.cpp index 1b1d55728f4a..eb3f1ea4619c 100644 --- a/dom/svg/SVGFilterElement.cpp +++ b/dom/svg/SVGFilterElement.cpp @@ -28,7 +28,7 @@ JSObject* SVGFilterElement::WrapNode(JSContext* aCx, return SVGFilterElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGFilterElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGFilterElement::sLengthInfo[4] = { {nsGkAtoms::x, -10, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::y, -10, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -39,12 +39,12 @@ nsSVGElement::LengthInfo SVGFilterElement::sLengthInfo[4] = { SVGContentUtils::Y}, }; -nsSVGElement::EnumInfo SVGFilterElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGFilterElement::sEnumInfo[2] = { {nsGkAtoms::filterUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}, {nsGkAtoms::primitiveUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_USERSPACEONUSE}}; -nsSVGElement::StringInfo SVGFilterElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFilterElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -108,7 +108,7 @@ SVGFilterElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGFilterElement::HasValidDimensions() const { return (!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() || @@ -117,16 +117,16 @@ SVGFilterElement::IsAttributeMapped(const nsAtom* name) const { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0); } -nsSVGElement::LengthAttributesInfo SVGFilterElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGFilterElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::EnumAttributesInfo SVGFilterElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGFilterElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGFilterElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFilterElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGFilterElement.h b/dom/svg/SVGFilterElement.h index 3772dfad6c9b..ffd85d221797 100644 --- a/dom/svg/SVGFilterElement.h +++ b/dom/svg/SVGFilterElement.h @@ -8,13 +8,11 @@ #define mozilla_dom_SVGFilterElement_h #include "nsSVGEnum.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGIntegerPair.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -typedef nsSVGElement SVGFilterElementBase; - class nsSVGFilterFrame; class nsSVGFilterInstance; @@ -25,6 +23,8 @@ namespace mozilla { namespace dom { class SVGAnimatedLength; +typedef SVGElement SVGFilterElementBase; + class SVGFilterElement : public SVGFilterElementBase { friend class ::nsSVGFilterFrame; friend class ::nsSVGFilterInstance; diff --git a/dom/svg/SVGForeignObjectElement.cpp b/dom/svg/SVGForeignObjectElement.cpp index 571966357b65..72f774c38dda 100644 --- a/dom/svg/SVGForeignObjectElement.cpp +++ b/dom/svg/SVGForeignObjectElement.cpp @@ -22,7 +22,7 @@ JSObject* SVGForeignObjectElement::WrapNode(JSContext* aCx, return SVGForeignObjectElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGForeignObjectElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGForeignObjectElement::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -64,7 +64,7 @@ already_AddRefed SVGForeignObjectElement::Height() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ gfxMatrix SVGForeignObjectElement::PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const { @@ -112,9 +112,9 @@ SVGForeignObjectElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::LengthAttributesInfo SVGForeignObjectElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGForeignObjectElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGForeignObjectElement.h b/dom/svg/SVGForeignObjectElement.h index 1a1cb1eb7bdc..56f235515184 100644 --- a/dom/svg/SVGForeignObjectElement.h +++ b/dom/svg/SVGForeignObjectElement.h @@ -31,7 +31,7 @@ class SVGForeignObjectElement final : public SVGGraphicsElement { JS::Handle aGivenProto) override; public: - // nsSVGElement specializations: + // SVGElement specializations: virtual gfxMatrix PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich = eAllTransforms) const override; diff --git a/dom/svg/SVGGeometryElement.cpp b/dom/svg/SVGGeometryElement.cpp index f507fc989ff6..945c21ec5760 100644 --- a/dom/svg/SVGGeometryElement.cpp +++ b/dom/svg/SVGGeometryElement.cpp @@ -19,8 +19,8 @@ using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::dom; -nsSVGElement::NumberInfo SVGGeometryElement::sNumberInfo = { - nsGkAtoms::pathLength, 0, false}; +SVGElement::NumberInfo SVGGeometryElement::sNumberInfo = {nsGkAtoms::pathLength, + 0, false}; //---------------------------------------------------------------------- // Implementation @@ -29,7 +29,7 @@ SVGGeometryElement::SVGGeometryElement( already_AddRefed&& aNodeInfo) : SVGGeometryElementBase(std::move(aNodeInfo)) {} -nsSVGElement::NumberAttributesInfo SVGGeometryElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGGeometryElement::GetNumberInfo() { return NumberAttributesInfo(&mPathLength, &sNumberInfo, 1); } diff --git a/dom/svg/SVGGeometryElement.h b/dom/svg/SVGGeometryElement.h index 6afa21cf8f6c..372994b78fa8 100644 --- a/dom/svg/SVGGeometryElement.h +++ b/dom/svg/SVGGeometryElement.h @@ -213,7 +213,7 @@ class SVGGeometryElement : public SVGGeometryElementBase { ErrorResult& rv); protected: - // nsSVGElement method + // SVGElement method virtual NumberAttributesInfo GetNumberInfo() override; nsSVGNumber2 mPathLength; diff --git a/dom/svg/SVGGradientElement.cpp b/dom/svg/SVGGradientElement.cpp index f9544699719d..0ec26fc3a947 100644 --- a/dom/svg/SVGGradientElement.cpp +++ b/dom/svg/SVGGradientElement.cpp @@ -15,7 +15,7 @@ #include "mozilla/dom/SVGUnitTypesBinding.h" #include "nsCOMPtr.h" #include "nsGkAtoms.h" -#include "nsSVGElement.h" +#include "SVGElement.h" NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(LinearGradient) NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(RadialGradient) @@ -34,12 +34,12 @@ nsSVGEnumMapping SVGGradientElement::sSpreadMethodMap[] = { {nsGkAtoms::repeat, SVG_SPREADMETHOD_REPEAT}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGGradientElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGGradientElement::sEnumInfo[2] = { {nsGkAtoms::gradientUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}, {nsGkAtoms::spreadMethod, sSpreadMethodMap, SVG_SPREADMETHOD_PAD}}; -nsSVGElement::StringInfo SVGGradientElement::sStringInfo[2] = { +SVGElement::StringInfo SVGGradientElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -51,13 +51,13 @@ SVGGradientElement::SVGGradientElement( : SVGGradientElementBase(std::move(aNodeInfo)) {} //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::EnumAttributesInfo SVGGradientElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGGradientElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGGradientElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGGradientElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } @@ -103,7 +103,7 @@ JSObject* SVGLinearGradientElement::WrapNode( return SVGLinearGradientElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGLinearGradientElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGLinearGradientElement::sLengthInfo[4] = { {nsGkAtoms::x1, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::y1, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -145,7 +145,7 @@ already_AddRefed SVGLinearGradientElement::Y2() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods nsSVGAnimatedTransformList* SVGGradientElement::GetAnimatedTransformList( uint32_t aFlags) { @@ -155,7 +155,7 @@ nsSVGAnimatedTransformList* SVGGradientElement::GetAnimatedTransformList( return mGradientTransform; } -nsSVGElement::LengthAttributesInfo SVGLinearGradientElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGLinearGradientElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } @@ -167,7 +167,7 @@ JSObject* SVGRadialGradientElement::WrapNode( return SVGRadialGradientElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGRadialGradientElement::sLengthInfo[6] = { +SVGElement::LengthInfo SVGRadialGradientElement::sLengthInfo[6] = { {nsGkAtoms::cx, 50, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::cy, 50, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -221,9 +221,9 @@ already_AddRefed SVGRadialGradientElement::Fr() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::LengthAttributesInfo SVGRadialGradientElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGRadialGradientElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGGradientElement.h b/dom/svg/SVGGradientElement.h index 83dd096c7ad7..267c4e980cbd 100644 --- a/dom/svg/SVGGradientElement.h +++ b/dom/svg/SVGGradientElement.h @@ -9,7 +9,7 @@ #include "nsAutoPtr.h" #include "nsSVGAnimatedTransformList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGLength2.h" #include "nsSVGEnum.h" #include "nsSVGString.h" @@ -30,7 +30,7 @@ class SVGAnimatedTransformList; //--------------------- Gradients------------------------ -typedef nsSVGElement SVGGradientElementBase; +typedef SVGElement SVGGradientElementBase; class SVGGradientElement : public SVGGradientElementBase { friend class ::nsSVGGradientFrame; diff --git a/dom/svg/SVGGraphicsElement.h b/dom/svg/SVGGraphicsElement.h index 26d1f3f133d5..d013c49f72f8 100644 --- a/dom/svg/SVGGraphicsElement.h +++ b/dom/svg/SVGGraphicsElement.h @@ -26,7 +26,7 @@ class SVGGraphicsElement : public SVGGraphicsElementBase, public SVGTests { NS_DECL_ISUPPORTS_INHERITED bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override; - nsSVGElement* AsSVGElement() final { return this; } + SVGElement* AsSVGElement() final { return this; } protected: // returns true if focusability has been definitively determined otherwise diff --git a/dom/svg/SVGImageElement.cpp b/dom/svg/SVGImageElement.cpp index e9a46ff7f4ee..5de279e60855 100644 --- a/dom/svg/SVGImageElement.cpp +++ b/dom/svg/SVGImageElement.cpp @@ -30,7 +30,7 @@ JSObject* SVGImageElement::WrapNode(JSContext* aCx, return SVGImageElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGImageElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGImageElement::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -41,7 +41,7 @@ nsSVGElement::LengthInfo SVGImageElement::sLengthInfo[4] = { SVGContentUtils::Y}, }; -nsSVGElement::StringInfo SVGImageElement::sStringInfo[2] = { +SVGElement::StringInfo SVGImageElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -265,7 +265,7 @@ already_AddRefed SVGImageElement::BuildPath(PathBuilder* aBuilder) { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGImageElement::HasValidDimensions() const { return mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() && @@ -274,7 +274,7 @@ already_AddRefed SVGImageElement::BuildPath(PathBuilder* aBuilder) { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0; } -nsSVGElement::LengthAttributesInfo SVGImageElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGImageElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } @@ -283,7 +283,7 @@ SVGAnimatedPreserveAspectRatio* SVGImageElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } -nsSVGElement::StringAttributesInfo SVGImageElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGImageElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGLength.cpp b/dom/svg/SVGLength.cpp index 54263f4a90e5..a7edd09791b8 100644 --- a/dom/svg/SVGLength.cpp +++ b/dom/svg/SVGLength.cpp @@ -7,7 +7,7 @@ #include "mozilla/ArrayUtils.h" #include "SVGLength.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/dom/SVGSVGElement.h" #include "nsTextFormatter.h" #include "SVGContentUtils.h" @@ -91,7 +91,7 @@ inline static float GetAbsUnitsPerAbsUnit(uint8_t aUnits, uint8_t aPerUnit) { } float SVGLength::GetValueInSpecifiedUnit(uint8_t aUnit, - const nsSVGElement* aElement, + const SVGElement* aElement, uint8_t aAxis) const { if (aUnit == mUnit) { return mValue; @@ -133,7 +133,7 @@ float SVGLength::GetValueInSpecifiedUnit(uint8_t aUnit, #define INCHES_PER_MM_FLOAT float(0.0393700787) #define INCHES_PER_CM_FLOAT float(0.393700787) -float SVGLength::GetUserUnitsPerUnit(const nsSVGElement* aElement, +float SVGLength::GetUserUnitsPerUnit(const SVGElement* aElement, uint8_t aAxis) const { switch (mUnit) { case SVGLength_Binding::SVG_LENGTHTYPE_NUMBER: @@ -152,18 +152,17 @@ float SVGLength::GetUserUnitsPerUnit(const nsSVGElement* aElement, case SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE: return GetUserUnitsPerPercent(aElement, aAxis); case SVGLength_Binding::SVG_LENGTHTYPE_EMS: - return SVGContentUtils::GetFontSize(const_cast(aElement)); + return SVGContentUtils::GetFontSize(const_cast(aElement)); case SVGLength_Binding::SVG_LENGTHTYPE_EXS: - return SVGContentUtils::GetFontXHeight( - const_cast(aElement)); + return SVGContentUtils::GetFontXHeight(const_cast(aElement)); default: MOZ_ASSERT_UNREACHABLE("Unknown unit type"); return std::numeric_limits::quiet_NaN(); } } -/* static */ float SVGLength::GetUserUnitsPerPercent( - const nsSVGElement* aElement, uint8_t aAxis) { +/* static */ float SVGLength::GetUserUnitsPerPercent(const SVGElement* aElement, + uint8_t aAxis) { if (aElement) { dom::SVGViewportElement* viewportElement = aElement->GetCtx(); if (viewportElement) { diff --git a/dom/svg/SVGLength.h b/dom/svg/SVGLength.h index d9b7e87e9014..5c3d40865b08 100644 --- a/dom/svg/SVGLength.h +++ b/dom/svg/SVGLength.h @@ -12,10 +12,12 @@ #include "mozilla/FloatingPoint.h" #include "mozilla/dom/SVGLengthBinding.h" -class nsSVGElement; - namespace mozilla { +namespace dom { +class SVGElement; +} + /** * This SVGLength class is currently used for SVGLength *list* attributes only. * The class that is currently used for attributes is nsSVGLength2. @@ -93,7 +95,8 @@ class SVGLength { * If it's not possible to convert this length's value to user units, then * this method will return numeric_limits::quiet_NaN(). */ - float GetValueInUserUnits(const nsSVGElement *aElement, uint8_t aAxis) const { + float GetValueInUserUnits(const dom::SVGElement *aElement, + uint8_t aAxis) const { return mValue * GetUserUnitsPerUnit(aElement, aAxis); } @@ -103,7 +106,7 @@ class SVGLength { * This method returns numeric_limits::quiet_NaN() if it is not * possible to convert the value to the specified unit. */ - float GetValueInSpecifiedUnit(uint8_t aUnit, const nsSVGElement *aElement, + float GetValueInSpecifiedUnit(uint8_t aUnit, const dom::SVGElement *aElement, uint8_t aAxis) const; bool IsPercentage() const { @@ -122,7 +125,8 @@ class SVGLength { * factor between the length's current unit and user units is undefined (see * the comments for GetUserUnitsPerInch and GetUserUnitsPerPercent). */ - float GetUserUnitsPerUnit(const nsSVGElement *aElement, uint8_t aAxis) const; + float GetUserUnitsPerUnit(const dom::SVGElement *aElement, + uint8_t aAxis) const; private: #ifdef DEBUG @@ -144,7 +148,7 @@ class SVGLength { * This function returns a non-negative value if the conversion factor is * defined, otherwise it returns numeric_limits::quiet_NaN(). */ - static float GetUserUnitsPerPercent(const nsSVGElement *aElement, + static float GetUserUnitsPerPercent(const dom::SVGElement *aElement, uint8_t aAxis); float mValue; diff --git a/dom/svg/SVGLengthList.cpp b/dom/svg/SVGLengthList.cpp index 40527e115e4f..b2a098e3eff8 100644 --- a/dom/svg/SVGLengthList.cpp +++ b/dom/svg/SVGLengthList.cpp @@ -8,7 +8,7 @@ #include "nsCharSeparatedTokenizer.h" #include "nsError.h" #include "nsString.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "SVGAnimatedLengthList.h" #include "SVGContentUtils.h" #include "SVGLength.h" diff --git a/dom/svg/SVGLengthList.h b/dom/svg/SVGLengthList.h index a1fbf54c17b3..8ab9fa29dade 100644 --- a/dom/svg/SVGLengthList.h +++ b/dom/svg/SVGLengthList.h @@ -12,7 +12,7 @@ #include "nsIContent.h" #include "nsINode.h" #include "nsIWeakReferenceUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" #include "SVGLength.h" #include "mozilla/dom/SVGLengthBinding.h" @@ -160,21 +160,21 @@ class SVGLengthListAndInfo : public SVGLengthList { SVGLengthListAndInfo() : mElement(nullptr), mAxis(0), mCanZeroPadList(false) {} - SVGLengthListAndInfo(nsSVGElement* aElement, uint8_t aAxis, + SVGLengthListAndInfo(dom::SVGElement* aElement, uint8_t aAxis, bool aCanZeroPadList) : mElement(do_GetWeakReference(static_cast(aElement))), mAxis(aAxis), mCanZeroPadList(aCanZeroPadList) {} - void SetInfo(nsSVGElement* aElement, uint8_t aAxis, bool aCanZeroPadList) { + void SetInfo(dom::SVGElement* aElement, uint8_t aAxis, bool aCanZeroPadList) { mElement = do_GetWeakReference(static_cast(aElement)); mAxis = aAxis; mCanZeroPadList = aCanZeroPadList; } - nsSVGElement* Element() const { + dom::SVGElement* Element() const { nsCOMPtr e = do_QueryReferent(mElement); - return static_cast(e.get()); + return static_cast(e.get()); } /** @@ -287,7 +287,8 @@ class MOZ_STACK_CLASS SVGUserUnitList { public: SVGUserUnitList() : mList(nullptr), mElement(nullptr), mAxis(0) {} - void Init(const SVGLengthList* aList, nsSVGElement* aElement, uint8_t aAxis) { + void Init(const SVGLengthList* aList, dom::SVGElement* aElement, + uint8_t aAxis) { mList = aList; mElement = aElement; mAxis = aAxis; @@ -312,7 +313,7 @@ class MOZ_STACK_CLASS SVGUserUnitList { private: const SVGLengthList* mList; - nsSVGElement* mElement; + dom::SVGElement* mElement; uint8_t mAxis; }; diff --git a/dom/svg/SVGLineElement.cpp b/dom/svg/SVGLineElement.cpp index e949ca4012df..2f6f928b2b6e 100644 --- a/dom/svg/SVGLineElement.cpp +++ b/dom/svg/SVGLineElement.cpp @@ -21,7 +21,7 @@ JSObject* SVGLineElement::WrapNode(JSContext* aCx, return SVGLineElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGLineElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGLineElement::sLengthInfo[4] = { {nsGkAtoms::x1, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y1, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -89,9 +89,9 @@ SVGLineElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::LengthAttributesInfo SVGLineElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGLineElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGMPathElement.cpp b/dom/svg/SVGMPathElement.cpp index 0fbed1b88f6c..bcbc6c3e4376 100644 --- a/dom/svg/SVGMPathElement.cpp +++ b/dom/svg/SVGMPathElement.cpp @@ -24,7 +24,7 @@ JSObject* SVGMPathElement::WrapNode(JSContext* aCx, return SVGMPathElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGMPathElement::sStringInfo[2] = { +SVGElement::StringInfo SVGMPathElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, false}, {nsGkAtoms::href, kNameSpaceID_XLink, false}}; @@ -148,9 +148,9 @@ nsresult SVGMPathElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGMPathElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGMPathElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGMPathElement.h b/dom/svg/SVGMPathElement.h index 8dffbe949e8e..7318d444b6ee 100644 --- a/dom/svg/SVGMPathElement.h +++ b/dom/svg/SVGMPathElement.h @@ -8,19 +8,19 @@ #define mozilla_dom_SVGMPathElement_h #include "mozilla/dom/IDTracker.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsStubMutationObserver.h" #include "nsSVGString.h" nsresult NS_NewSVGMPathElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -typedef nsSVGElement SVGMPathElementBase; - namespace mozilla { namespace dom { class SVGPathElement; +typedef SVGElement SVGMPathElementBase; + class SVGMPathElement final : public SVGMPathElementBase, public nsStubMutationObserver { protected: diff --git a/dom/svg/SVGMarkerElement.cpp b/dom/svg/SVGMarkerElement.cpp index cab69dca1928..5753c805acb4 100644 --- a/dom/svg/SVGMarkerElement.cpp +++ b/dom/svg/SVGMarkerElement.cpp @@ -33,7 +33,7 @@ JSObject* SVGMarkerElement::WrapNode(JSContext* aCx, return SVGMarkerElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGMarkerElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGMarkerElement::sLengthInfo[4] = { {nsGkAtoms::refX, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::refY, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -49,17 +49,17 @@ nsSVGEnumMapping SVGMarkerElement::sUnitsMap[] = { {nsGkAtoms::userSpaceOnUse, SVG_MARKERUNITS_USERSPACEONUSE}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGMarkerElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGMarkerElement::sEnumInfo[1] = { {nsGkAtoms::markerUnits, sUnitsMap, SVG_MARKERUNITS_STROKEWIDTH}}; -nsSVGElement::AngleInfo SVGMarkerElement::sAngleInfo[1] = { +SVGElement::AngleInfo SVGMarkerElement::sAngleInfo[1] = { {nsGkAtoms::orient, 0, SVG_ANGLETYPE_UNSPECIFIED}}; //---------------------------------------------------------------------- // Implementation nsresult nsSVGOrientType::SetBaseValue(uint16_t aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (aValue == SVG_MARKER_ORIENT_AUTO || aValue == SVG_MARKER_ORIENT_ANGLE || aValue == SVG_MARKER_ORIENT_AUTO_START_REVERSE) { SetBaseValue(aValue); @@ -76,7 +76,7 @@ nsresult nsSVGOrientType::SetBaseValue(uint16_t aValue, } already_AddRefed nsSVGOrientType::ToDOMAnimatedEnum( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr toReturn = new DOMAnimatedEnum(this, aSVGElement); return toReturn.forget(); @@ -169,7 +169,7 @@ SVGMarkerElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods bool SVGMarkerElement::ParseAttribute(int32_t aNameSpaceID, nsAtom* aName, const nsAString& aValue, @@ -211,7 +211,7 @@ nsresult SVGMarkerElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods void SVGMarkerElement::SetParentCoordCtxProvider(SVGViewportElement* aContext) { mCoordCtx = aContext; @@ -225,17 +225,17 @@ void SVGMarkerElement::SetParentCoordCtxProvider(SVGViewportElement* aContext) { mLengthAttributes[MARKERHEIGHT].GetAnimValInSpecifiedUnits() > 0); } -nsSVGElement::LengthAttributesInfo SVGMarkerElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGMarkerElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::AngleAttributesInfo SVGMarkerElement::GetAngleInfo() { +SVGElement::AngleAttributesInfo SVGMarkerElement::GetAngleInfo() { return AngleAttributesInfo(mAngleAttributes, sAngleInfo, ArrayLength(sAngleInfo)); } -nsSVGElement::EnumAttributesInfo SVGMarkerElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGMarkerElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } diff --git a/dom/svg/SVGMarkerElement.h b/dom/svg/SVGMarkerElement.h index d5996bbc4c88..bf889bd5e83d 100644 --- a/dom/svg/SVGMarkerElement.h +++ b/dom/svg/SVGMarkerElement.h @@ -13,7 +13,7 @@ #include "nsSVGLength2.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGAnimatedEnumeration.h" #include "mozilla/dom/SVGMarkerElementBinding.h" @@ -36,7 +36,7 @@ class nsSVGOrientType { : mAnimVal(SVGMarkerElement_Binding::SVG_MARKER_ORIENT_ANGLE), mBaseVal(SVGMarkerElement_Binding::SVG_MARKER_ORIENT_ANGLE) {} - nsresult SetBaseValue(uint16_t aValue, nsSVGElement* aSVGElement); + nsresult SetBaseValue(uint16_t aValue, SVGElement* aSVGElement); // XXX FIXME like https://bugzilla.mozilla.org/show_bug.cgi?id=545550 but // without adding an mIsAnimated member...? @@ -59,14 +59,14 @@ class nsSVGOrientType { uint16_t GetAnimValueInternal() const { return mAnimVal; } already_AddRefed ToDOMAnimatedEnum( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); private: nsSVGEnumValue mAnimVal; nsSVGEnumValue mBaseVal; struct DOMAnimatedEnum final : public SVGAnimatedEnumeration { - DOMAnimatedEnum(nsSVGOrientType* aVal, nsSVGElement* aSVGElement) + DOMAnimatedEnum(nsSVGOrientType* aVal, SVGElement* aSVGElement) : SVGAnimatedEnumeration(aSVGElement), mVal(aVal) {} nsSVGOrientType* mVal; // kept alive because it belongs to content @@ -80,7 +80,7 @@ class nsSVGOrientType { }; }; -typedef nsSVGElement SVGMarkerElementBase; +typedef SVGElement SVGMarkerElementBase; class SVGMarkerElement : public SVGMarkerElementBase { friend class ::nsSVGMarkerFrame; diff --git a/dom/svg/SVGMaskElement.cpp b/dom/svg/SVGMaskElement.cpp index c9bea0a9b551..aa24cc24b651 100644 --- a/dom/svg/SVGMaskElement.cpp +++ b/dom/svg/SVGMaskElement.cpp @@ -27,7 +27,7 @@ JSObject* SVGMaskElement::WrapNode(JSContext* aCx, //--------------------- Masks ------------------------ -nsSVGElement::LengthInfo SVGMaskElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGMaskElement::sLengthInfo[4] = { {nsGkAtoms::x, -10, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::y, -10, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -38,7 +38,7 @@ nsSVGElement::LengthInfo SVGMaskElement::sLengthInfo[4] = { SVGContentUtils::Y}, }; -nsSVGElement::EnumInfo SVGMaskElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGMaskElement::sEnumInfo[2] = { {nsGkAtoms::maskUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}, {nsGkAtoms::maskContentUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_USERSPACEONUSE}}; @@ -82,7 +82,7 @@ already_AddRefed SVGMaskElement::Height() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGMaskElement::HasValidDimensions() const { return (!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() || @@ -91,12 +91,12 @@ already_AddRefed SVGMaskElement::Height() { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0); } -nsSVGElement::LengthAttributesInfo SVGMaskElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGMaskElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::EnumAttributesInfo SVGMaskElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGMaskElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } diff --git a/dom/svg/SVGMaskElement.h b/dom/svg/SVGMaskElement.h index 22ef35b6e330..89f3f36f8856 100644 --- a/dom/svg/SVGMaskElement.h +++ b/dom/svg/SVGMaskElement.h @@ -9,7 +9,7 @@ #include "nsSVGEnum.h" #include "nsSVGLength2.h" -#include "nsSVGElement.h" +#include "SVGElement.h" class nsSVGMaskFrame; @@ -21,7 +21,7 @@ namespace dom { //--------------------- Masks ------------------------ -typedef nsSVGElement SVGMaskElementBase; +typedef SVGElement SVGMaskElementBase; class SVGMaskElement final : public SVGMaskElementBase { friend class ::nsSVGMaskFrame; diff --git a/dom/svg/SVGMetadataElement.h b/dom/svg/SVGMetadataElement.h index 6560bf178885..f1754deefce2 100644 --- a/dom/svg/SVGMetadataElement.h +++ b/dom/svg/SVGMetadataElement.h @@ -8,16 +8,16 @@ #define mozilla_dom_SVGMetadataElement_h #include "mozilla/Attributes.h" -#include "nsSVGElement.h" +#include "SVGElement.h" nsresult NS_NewSVGMetadataElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -typedef nsSVGElement SVGMetadataElementBase; - namespace mozilla { namespace dom { +typedef SVGElement SVGMetadataElementBase; + class SVGMetadataElement final : public SVGMetadataElementBase { protected: friend nsresult(::NS_NewSVGMetadataElement( diff --git a/dom/svg/SVGMotionSMILAnimationFunction.cpp b/dom/svg/SVGMotionSMILAnimationFunction.cpp index 4bea8717627e..bc1274012b71 100644 --- a/dom/svg/SVGMotionSMILAnimationFunction.cpp +++ b/dom/svg/SVGMotionSMILAnimationFunction.cpp @@ -145,7 +145,7 @@ void SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromBasicAttrs( } SVGMotionSMILPathUtils::PathGenerator pathGenerator( - static_cast(aContextElem)); + static_cast(aContextElem)); bool success = false; if (HasAttr(nsGkAtoms::values)) { diff --git a/dom/svg/SVGMotionSMILAttr.cpp b/dom/svg/SVGMotionSMILAttr.cpp index 28a6ee1d4015..b3781171c207 100644 --- a/dom/svg/SVGMotionSMILAttr.cpp +++ b/dom/svg/SVGMotionSMILAttr.cpp @@ -11,7 +11,7 @@ #include "mozilla/dom/SVGAnimationElement.h" #include "nsSMILValue.h" #include "nsDebug.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "gfx2DGlue.h" namespace mozilla { diff --git a/dom/svg/SVGMotionSMILAttr.h b/dom/svg/SVGMotionSMILAttr.h index 877ea6fbcac0..06aa5f6bf78d 100644 --- a/dom/svg/SVGMotionSMILAttr.h +++ b/dom/svg/SVGMotionSMILAttr.h @@ -14,12 +14,12 @@ class nsIContent; class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; } // namespace dom /** @@ -31,7 +31,7 @@ class SVGAnimationElement; */ class SVGMotionSMILAttr : public nsISMILAttr { public: - explicit SVGMotionSMILAttr(nsSVGElement* aSVGElement) + explicit SVGMotionSMILAttr(dom::SVGElement* aSVGElement) : mSVGElement(aSVGElement) {} // nsISMILAttr methods @@ -47,7 +47,7 @@ class SVGMotionSMILAttr : public nsISMILAttr { // Raw pointers are OK here because this SVGMotionSMILAttr is both // created & destroyed during a SMIL sample-step, during which time the DOM // isn't modified. - nsSVGElement* mSVGElement; + dom::SVGElement* mSVGElement; }; } // namespace mozilla diff --git a/dom/svg/SVGMotionSMILPathUtils.h b/dom/svg/SVGMotionSMILPathUtils.h index 51af9e9d97f9..d7931d5250bd 100644 --- a/dom/svg/SVGMotionSMILPathUtils.h +++ b/dom/svg/SVGMotionSMILPathUtils.h @@ -19,10 +19,12 @@ #include "nsStringFwd.h" #include "nsTArray.h" -class nsSVGElement; - namespace mozilla { +namespace dom { +class SVGElement; +} + class SVGMotionSMILPathUtils { typedef mozilla::gfx::DrawTarget DrawTarget; typedef mozilla::gfx::Path Path; @@ -33,7 +35,7 @@ class SVGMotionSMILPathUtils { // coordinates in the from/by/to/values attributes. class PathGenerator { public: - explicit PathGenerator(const nsSVGElement* aSVGElement) + explicit PathGenerator(const dom::SVGElement* aSVGElement) : mSVGElement(aSVGElement), mHaveReceivedCommands(false) { RefPtr drawTarget = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget(); @@ -67,7 +69,7 @@ class SVGMotionSMILPathUtils { bool ParseCoordinatePair(const nsAString& aStr, float& aXVal, float& aYVal); // Member data - const nsSVGElement* mSVGElement; // context for converting to user units + const dom::SVGElement* mSVGElement; // context for converting to user units RefPtr mPathBuilder; bool mHaveReceivedCommands; }; diff --git a/dom/svg/SVGNumberList.h b/dom/svg/SVGNumberList.h index 85e7593e4007..004324a28c78 100644 --- a/dom/svg/SVGNumberList.h +++ b/dom/svg/SVGNumberList.h @@ -12,7 +12,7 @@ #include "nsIContent.h" #include "nsINode.h" #include "nsIWeakReferenceUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" namespace mozilla { @@ -131,16 +131,16 @@ class SVGNumberListAndInfo : public SVGNumberList { public: SVGNumberListAndInfo() : mElement(nullptr) {} - explicit SVGNumberListAndInfo(nsSVGElement* aElement) + explicit SVGNumberListAndInfo(dom::SVGElement* aElement) : mElement(do_GetWeakReference(static_cast(aElement))) {} - void SetInfo(nsSVGElement* aElement) { + void SetInfo(dom::SVGElement* aElement) { mElement = do_GetWeakReference(static_cast(aElement)); } - nsSVGElement* Element() const { + dom::SVGElement* Element() const { nsCOMPtr e = do_QueryReferent(mElement); - return static_cast(e.get()); + return static_cast(e.get()); } nsresult CopyFrom(const SVGNumberListAndInfo& rhs) { diff --git a/dom/svg/SVGPathData.h b/dom/svg/SVGPathData.h index 93c229653562..da7b9e0abaf6 100644 --- a/dom/svg/SVGPathData.h +++ b/dom/svg/SVGPathData.h @@ -16,7 +16,7 @@ #include "mozilla/gfx/Types.h" #include "mozilla/MemoryReporting.h" #include "mozilla/RefPtr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" #include @@ -231,16 +231,16 @@ class SVGPathData { */ class SVGPathDataAndInfo final : public SVGPathData { public: - explicit SVGPathDataAndInfo(nsSVGElement* aElement = nullptr) + explicit SVGPathDataAndInfo(dom::SVGElement* aElement = nullptr) : mElement(do_GetWeakReference(static_cast(aElement))) {} - void SetElement(nsSVGElement* aElement) { + void SetElement(dom::SVGElement* aElement) { mElement = do_GetWeakReference(static_cast(aElement)); } - nsSVGElement* Element() const { + dom::SVGElement* Element() const { nsCOMPtr e = do_QueryReferent(mElement); - return static_cast(e.get()); + return static_cast(e.get()); } nsresult CopyFrom(const SVGPathDataAndInfo& rhs) { diff --git a/dom/svg/SVGPathElement.cpp b/dom/svg/SVGPathElement.cpp index 7eae71378f63..fb3c456c37a9 100644 --- a/dom/svg/SVGPathElement.cpp +++ b/dom/svg/SVGPathElement.cpp @@ -215,7 +215,7 @@ already_AddRefed SVGPathElement::AnimatedPathSegList() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGPathElement::HasValidDimensions() const { return !mD.GetAnimValue().IsEmpty(); diff --git a/dom/svg/SVGPatternElement.cpp b/dom/svg/SVGPatternElement.cpp index 5681379f7114..462d80b4fb2c 100644 --- a/dom/svg/SVGPatternElement.cpp +++ b/dom/svg/SVGPatternElement.cpp @@ -28,7 +28,7 @@ JSObject* SVGPatternElement::WrapNode(JSContext* aCx, //--------------------- Patterns ------------------------ -nsSVGElement::LengthInfo SVGPatternElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGPatternElement::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -39,13 +39,13 @@ nsSVGElement::LengthInfo SVGPatternElement::sLengthInfo[4] = { SVGContentUtils::Y}, }; -nsSVGElement::EnumInfo SVGPatternElement::sEnumInfo[2] = { +SVGElement::EnumInfo SVGPatternElement::sEnumInfo[2] = { {nsGkAtoms::patternUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}, {nsGkAtoms::patternContentUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_USERSPACEONUSE}}; -nsSVGElement::StringInfo SVGPatternElement::sStringInfo[2] = { +SVGElement::StringInfo SVGPatternElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -135,7 +135,7 @@ SVGPatternElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods nsSVGAnimatedTransformList* SVGPatternElement::GetAnimatedTransformList( uint32_t aFlags) { @@ -152,12 +152,12 @@ nsSVGAnimatedTransformList* SVGPatternElement::GetAnimatedTransformList( mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0; } -nsSVGElement::LengthAttributesInfo SVGPatternElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGPatternElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::EnumAttributesInfo SVGPatternElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGPatternElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } @@ -167,7 +167,7 @@ SVGAnimatedPreserveAspectRatio* SVGPatternElement::GetPreserveAspectRatio() { return &mPreserveAspectRatio; } -nsSVGElement::StringAttributesInfo SVGPatternElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGPatternElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGPatternElement.h b/dom/svg/SVGPatternElement.h index 30a8212d0371..ef826f39c325 100644 --- a/dom/svg/SVGPatternElement.h +++ b/dom/svg/SVGPatternElement.h @@ -11,7 +11,7 @@ #include "nsSVGEnum.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "nsSVGAnimatedTransformList.h" @@ -25,7 +25,7 @@ namespace mozilla { namespace dom { class SVGAnimatedTransformList; -typedef nsSVGElement SVGPatternElementBase; +typedef SVGElement SVGPatternElementBase; class SVGPatternElement final : public SVGPatternElementBase { friend class ::nsSVGPatternFrame; diff --git a/dom/svg/SVGPointList.h b/dom/svg/SVGPointList.h index 45e3c27f2ee9..334dd93b8ba4 100644 --- a/dom/svg/SVGPointList.h +++ b/dom/svg/SVGPointList.h @@ -12,7 +12,7 @@ #include "nsIContent.h" #include "nsINode.h" #include "nsIWeakReferenceUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsTArray.h" #include "SVGPoint.h" @@ -142,16 +142,16 @@ class SVGPointList { */ class SVGPointListAndInfo : public SVGPointList { public: - explicit SVGPointListAndInfo(nsSVGElement* aElement = nullptr) + explicit SVGPointListAndInfo(dom::SVGElement* aElement = nullptr) : mElement(do_GetWeakReference(static_cast(aElement))) {} - void SetInfo(nsSVGElement* aElement) { + void SetInfo(dom::SVGElement* aElement) { mElement = do_GetWeakReference(static_cast(aElement)); } - nsSVGElement* Element() const { + dom::SVGElement* Element() const { nsCOMPtr e = do_QueryReferent(mElement); - return static_cast(e.get()); + return static_cast(e.get()); } /** diff --git a/dom/svg/SVGPolyElement.cpp b/dom/svg/SVGPolyElement.cpp index 92eb15a8a74d..65dd6a36d3f4 100644 --- a/dom/svg/SVGPolyElement.cpp +++ b/dom/svg/SVGPolyElement.cpp @@ -49,7 +49,7 @@ SVGPolyElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGPolyElement::HasValidDimensions() const { return !mPoints.GetAnimValue().IsEmpty(); diff --git a/dom/svg/SVGPolyElement.h b/dom/svg/SVGPolyElement.h index 5542294c65b9..ec2359f840f2 100644 --- a/dom/svg/SVGPolyElement.h +++ b/dom/svg/SVGPolyElement.h @@ -39,7 +39,7 @@ class SVGPolyElement : public SVGPolyElementBase { return nsGkAtoms::points; } - // nsSVGElement methods: + // SVGElement methods: virtual bool HasValidDimensions() const override; // SVGGeometryElement methods: diff --git a/dom/svg/SVGPreserveAspectRatio.h b/dom/svg/SVGPreserveAspectRatio.h index 3d9052d8cc9e..760601309c40 100644 --- a/dom/svg/SVGPreserveAspectRatio.h +++ b/dom/svg/SVGPreserveAspectRatio.h @@ -13,7 +13,7 @@ #include "nsWrapperCache.h" #include "nsCycleCollectionParticipant.h" #include "mozilla/ErrorResult.h" -#include "nsSVGElement.h" +#include "mozilla/dom/SVGElement.h" namespace mozilla { @@ -88,11 +88,11 @@ class DOMSVGPreserveAspectRatio final : public nsISupports, NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPreserveAspectRatio) DOMSVGPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal, - nsSVGElement* aSVGElement, bool aIsBaseValue) + SVGElement* aSVGElement, bool aIsBaseValue) : mVal(aVal), mSVGElement(aSVGElement), mIsBaseValue(aIsBaseValue) {} // WebIDL - nsSVGElement* GetParentObject() const { return mSVGElement; } + SVGElement* GetParentObject() const { return mSVGElement; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -106,7 +106,7 @@ class DOMSVGPreserveAspectRatio final : public nsISupports, SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement - RefPtr mSVGElement; + RefPtr mSVGElement; const bool mIsBaseValue; }; diff --git a/dom/svg/SVGRect.cpp b/dom/svg/SVGRect.cpp index 837f6910c38e..946f98edea27 100644 --- a/dom/svg/SVGRect.cpp +++ b/dom/svg/SVGRect.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/dom/SVGRect.h" -#include "nsSVGElement.h" +#include "SVGElement.h" using namespace mozilla::gfx; diff --git a/dom/svg/SVGRect.h b/dom/svg/SVGRect.h index a5925b7423d4..e6dea16039c1 100644 --- a/dom/svg/SVGRect.h +++ b/dom/svg/SVGRect.h @@ -9,7 +9,7 @@ #include "mozilla/dom/SVGIRect.h" #include "mozilla/gfx/Rect.h" -#include "nsSVGElement.h" +#include "SVGElement.h" //////////////////////////////////////////////////////////////////////// // SVGRect class diff --git a/dom/svg/SVGRectElement.cpp b/dom/svg/SVGRectElement.cpp index d94dfdecaedd..e729a8d90a26 100644 --- a/dom/svg/SVGRectElement.cpp +++ b/dom/svg/SVGRectElement.cpp @@ -28,7 +28,7 @@ JSObject* SVGRectElement::WrapNode(JSContext* aCx, return SVGRectElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGRectElement::sLengthInfo[6] = { +SVGElement::LengthInfo SVGRectElement::sLengthInfo[6] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -81,7 +81,7 @@ already_AddRefed SVGRectElement::Ry() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ bool SVGRectElement::HasValidDimensions() const { return mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() && @@ -90,7 +90,7 @@ already_AddRefed SVGRectElement::Ry() { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0; } -nsSVGElement::LengthAttributesInfo SVGRectElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGRectElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGSVGElement.cpp b/dom/svg/SVGSVGElement.cpp index 9bed7048892e..a5f0979a68b3 100644 --- a/dom/svg/SVGSVGElement.cpp +++ b/dom/svg/SVGSVGElement.cpp @@ -40,7 +40,7 @@ nsSVGEnumMapping SVGSVGElement::sZoomAndPanMap[] = { {nsGkAtoms::magnify, SVG_ZOOMANDPAN_MAGNIFY}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGSVGElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGSVGElement::sEnumInfo[1] = { {nsGkAtoms::zoomAndPan, sZoomAndPanMap, SVG_ZOOMANDPAN_MAGNIFY}}; NS_IMPL_CYCLE_COLLECTION_INHERITED(DOMSVGTranslatePoint, nsISVGPoint, mElement) @@ -375,7 +375,7 @@ nsSMILTimeContainer* SVGSVGElement::GetTimedDocumentRoot() { return nullptr; } //---------------------------------------------------------------------- -// nsSVGElement +// SVGElement nsresult SVGSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent) { nsSMILAnimationController* smilController = nullptr; @@ -522,7 +522,7 @@ void SVGSVGElement::InvalidateTransformNotifyFrame() { } } -nsSVGElement::EnumAttributesInfo SVGSVGElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGSVGElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } diff --git a/dom/svg/SVGSVGElement.h b/dom/svg/SVGSVGElement.h index b6461288382d..157e36870165 100644 --- a/dom/svg/SVGSVGElement.h +++ b/dom/svg/SVGSVGElement.h @@ -144,7 +144,7 @@ class SVGSVGElement final : public SVGSVGElementBase { uint16_t ZoomAndPan(); void SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv); - // nsSVGElement overrides + // SVGElement overrides virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent) override; diff --git a/dom/svg/SVGScriptElement.cpp b/dom/svg/SVGScriptElement.cpp index c8891adf7470..76660b31232c 100644 --- a/dom/svg/SVGScriptElement.cpp +++ b/dom/svg/SVGScriptElement.cpp @@ -21,7 +21,7 @@ JSObject* SVGScriptElement::WrapNode(JSContext* aCx, return SVGScriptElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::StringInfo SVGScriptElement::sStringInfo[2] = { +SVGElement::StringInfo SVGScriptElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, false}, {nsGkAtoms::href, kNameSpaceID_XLink, false}}; @@ -171,9 +171,9 @@ bool SVGScriptElement::HasScriptContent() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::StringAttributesInfo SVGScriptElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGScriptElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGScriptElement.h b/dom/svg/SVGScriptElement.h index 06fe224f6756..aa074fa80164 100644 --- a/dom/svg/SVGScriptElement.h +++ b/dom/svg/SVGScriptElement.h @@ -7,7 +7,7 @@ #ifndef mozilla_dom_SVGScriptElement_h #define mozilla_dom_SVGScriptElement_h -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsCOMPtr.h" #include "nsSVGString.h" #include "mozilla/dom/ScriptElement.h" @@ -21,7 +21,7 @@ nsresult NS_NewSVGScriptElement( namespace mozilla { namespace dom { -typedef nsSVGElement SVGScriptElementBase; +typedef SVGElement SVGScriptElementBase; class SVGScriptElement final : public SVGScriptElementBase, public ScriptElement { diff --git a/dom/svg/SVGStopElement.cpp b/dom/svg/SVGStopElement.cpp index c6a06a0b0e08..3ed5f9f27153 100644 --- a/dom/svg/SVGStopElement.cpp +++ b/dom/svg/SVGStopElement.cpp @@ -17,8 +17,8 @@ JSObject* SVGStopElement::WrapNode(JSContext* aCx, return SVGStopElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::NumberInfo SVGStopElement::sNumberInfo = {nsGkAtoms::offset, 0, - true}; +SVGElement::NumberInfo SVGStopElement::sNumberInfo = {nsGkAtoms::offset, 0, + true}; //---------------------------------------------------------------------- // Implementation @@ -41,7 +41,7 @@ already_AddRefed SVGStopElement::Offset() { //---------------------------------------------------------------------- // sSVGElement methods -nsSVGElement::NumberAttributesInfo SVGStopElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGStopElement::GetNumberInfo() { return NumberAttributesInfo(&mOffset, &sNumberInfo, 1); } diff --git a/dom/svg/SVGStopElement.h b/dom/svg/SVGStopElement.h index 26a015e7a1a9..3b24d8574b31 100644 --- a/dom/svg/SVGStopElement.h +++ b/dom/svg/SVGStopElement.h @@ -7,17 +7,17 @@ #ifndef mozilla_dom_SVGStopElement_h #define mozilla_dom_SVGStopElement_h -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGNumber2.h" nsresult NS_NewSVGStopElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -typedef nsSVGElement SVGStopElementBase; - namespace mozilla { namespace dom { +typedef SVGElement SVGStopElementBase; + class SVGStopElement final : public SVGStopElementBase { protected: friend nsresult(::NS_NewSVGStopElement( diff --git a/dom/svg/SVGStyleElement.h b/dom/svg/SVGStyleElement.h index 50b75688eb2a..69d671c3ef96 100644 --- a/dom/svg/SVGStyleElement.h +++ b/dom/svg/SVGStyleElement.h @@ -8,18 +8,18 @@ #define mozilla_dom_SVGStyleElement_h #include "mozilla/Attributes.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsStyleLinkElement.h" #include "nsStubMutationObserver.h" nsresult NS_NewSVGStyleElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -typedef nsSVGElement SVGStyleElementBase; - namespace mozilla { namespace dom { +typedef SVGElement SVGStyleElementBase; + class SVGStyleElement final : public SVGStyleElementBase, public nsStyleLinkElement, public nsStubMutationObserver { diff --git a/dom/svg/SVGTSpanElement.cpp b/dom/svg/SVGTSpanElement.cpp index f9ca70191041..e790c37b3633 100644 --- a/dom/svg/SVGTSpanElement.cpp +++ b/dom/svg/SVGTSpanElement.cpp @@ -24,11 +24,11 @@ SVGTSpanElement::SVGTSpanElement( already_AddRefed&& aNodeInfo) : SVGTSpanElementBase(std::move(aNodeInfo)) {} -nsSVGElement::EnumAttributesInfo SVGTSpanElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGTSpanElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::LengthAttributesInfo SVGTSpanElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGTSpanElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGTests.h b/dom/svg/SVGTests.h index 813df04217a1..f7bbfcae7ae3 100644 --- a/dom/svg/SVGTests.h +++ b/dom/svg/SVGTests.h @@ -14,7 +14,6 @@ class nsAttrValue; class nsAtom; class nsStaticAtom; -class nsSVGElement; namespace mozilla { class DOMSVGStringList; @@ -28,6 +27,8 @@ class DOMSVGStringList; namespace dom { +class SVGElement; + class SVGTests : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTESTS_IID) @@ -97,9 +98,9 @@ class SVGTests : public nsISupports { already_AddRefed SystemLanguage(); bool HasExtension(const nsAString& aExtension); - virtual nsSVGElement* AsSVGElement() = 0; + virtual SVGElement* AsSVGElement() = 0; - const nsSVGElement* AsSVGElement() const { + const SVGElement* AsSVGElement() const { return const_cast(this)->AsSVGElement(); } diff --git a/dom/svg/SVGTextContentElement.cpp b/dom/svg/SVGTextContentElement.cpp index a47440f90244..9fc1314101a2 100644 --- a/dom/svg/SVGTextContentElement.cpp +++ b/dom/svg/SVGTextContentElement.cpp @@ -26,10 +26,10 @@ nsSVGEnumMapping SVGTextContentElement::sLengthAdjustMap[] = { {nsGkAtoms::spacingAndGlyphs, LENGTHADJUST_SPACINGANDGLYPHS}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGTextContentElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGTextContentElement::sEnumInfo[1] = { {nsGkAtoms::lengthAdjust, sLengthAdjustMap, LENGTHADJUST_SPACING}}; -nsSVGElement::LengthInfo SVGTextContentElement::sLengthInfo[1] = { +SVGElement::LengthInfo SVGTextContentElement::sLengthInfo[1] = { {nsGkAtoms::textLength, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY}}; diff --git a/dom/svg/SVGTextElement.cpp b/dom/svg/SVGTextElement.cpp index b12e62a02afb..409fbfc95725 100644 --- a/dom/svg/SVGTextElement.cpp +++ b/dom/svg/SVGTextElement.cpp @@ -24,11 +24,11 @@ SVGTextElement::SVGTextElement( already_AddRefed&& aNodeInfo) : SVGTextElementBase(std::move(aNodeInfo)) {} -nsSVGElement::EnumAttributesInfo SVGTextElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGTextElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::LengthAttributesInfo SVGTextElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGTextElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGTextPathElement.cpp b/dom/svg/SVGTextPathElement.cpp index 4339c68b1225..c75b92517b06 100644 --- a/dom/svg/SVGTextPathElement.cpp +++ b/dom/svg/SVGTextPathElement.cpp @@ -8,7 +8,7 @@ #include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGTextContentElementBinding.h" #include "mozilla/dom/SVGTextPathElementBinding.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsGkAtoms.h" #include "nsError.h" @@ -27,7 +27,7 @@ JSObject* SVGTextPathElement::WrapNode(JSContext* aCx, return SVGTextPathElement_Binding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGTextPathElement::sLengthInfo[2] = { +SVGElement::LengthInfo SVGTextPathElement::sLengthInfo[2] = { // from SVGTextContentElement: {nsGkAtoms::textLength, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY}, @@ -50,7 +50,7 @@ nsSVGEnumMapping SVGTextPathElement::sSideMap[] = { {nsGkAtoms::right, TEXTPATH_SIDETYPE_RIGHT}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGTextPathElement::sEnumInfo[4] = { +SVGElement::EnumInfo SVGTextPathElement::sEnumInfo[4] = { // from SVGTextContentElement: {nsGkAtoms::lengthAdjust, sLengthAdjustMap, LENGTHADJUST_SPACING}, // from SVGTextPathElement: @@ -58,7 +58,7 @@ nsSVGElement::EnumInfo SVGTextPathElement::sEnumInfo[4] = { {nsGkAtoms::spacing, sSpacingMap, TEXTPATH_SPACINGTYPE_EXACT}, {nsGkAtoms::side_, sSideMap, TEXTPATH_SIDETYPE_LEFT}}; -nsSVGElement::StringInfo SVGTextPathElement::sStringInfo[2] = { +SVGElement::StringInfo SVGTextPathElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -120,18 +120,18 @@ SVGTextPathElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement overrides +// SVGElement overrides -nsSVGElement::LengthAttributesInfo SVGTextPathElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGTextPathElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::EnumAttributesInfo SVGTextPathElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGTextPathElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::StringAttributesInfo SVGTextPathElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGTextPathElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGTextPositioningElement.cpp b/dom/svg/SVGTextPositioningElement.cpp index dfb101d82a36..bceab59e9dc0 100644 --- a/dom/svg/SVGTextPositioningElement.cpp +++ b/dom/svg/SVGTextPositioningElement.cpp @@ -15,22 +15,22 @@ namespace mozilla { namespace dom { -nsSVGElement::LengthListInfo SVGTextPositioningElement::sLengthListInfo[4] = { +SVGElement::LengthListInfo SVGTextPositioningElement::sLengthListInfo[4] = { {nsGkAtoms::x, SVGContentUtils::X, false}, {nsGkAtoms::y, SVGContentUtils::Y, false}, {nsGkAtoms::dx, SVGContentUtils::X, true}, {nsGkAtoms::dy, SVGContentUtils::Y, true}}; -nsSVGElement::LengthListAttributesInfo +SVGElement::LengthListAttributesInfo SVGTextPositioningElement::GetLengthListInfo() { return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo, ArrayLength(sLengthListInfo)); } -nsSVGElement::NumberListInfo SVGTextPositioningElement::sNumberListInfo[1] = { +SVGElement::NumberListInfo SVGTextPositioningElement::sNumberListInfo[1] = { {nsGkAtoms::rotate}}; -nsSVGElement::NumberListAttributesInfo +SVGElement::NumberListAttributesInfo SVGTextPositioningElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, ArrayLength(sNumberListInfo)); diff --git a/dom/svg/SVGTitleElement.h b/dom/svg/SVGTitleElement.h index 881b0c843dfa..1a3a0945726b 100644 --- a/dom/svg/SVGTitleElement.h +++ b/dom/svg/SVGTitleElement.h @@ -8,16 +8,16 @@ #define mozilla_dom_SVGTitleElement_h #include "mozilla/Attributes.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsStubMutationObserver.h" -typedef nsSVGElement SVGTitleElementBase; - nsresult NS_NewSVGTitleElement( nsIContent **aResult, already_AddRefed &&aNodeInfo); namespace mozilla { namespace dom { +typedef SVGElement SVGTitleElementBase; + class SVGTitleElement final : public SVGTitleElementBase, public nsStubMutationObserver { protected: diff --git a/dom/svg/SVGTransform.h b/dom/svg/SVGTransform.h index 6ecac87df1f0..2409e32eadc2 100644 --- a/dom/svg/SVGTransform.h +++ b/dom/svg/SVGTransform.h @@ -17,13 +17,12 @@ #include "nsWrapperCache.h" #include "mozilla/Attributes.h" -class nsSVGElement; - #define MOZ_SVG_LIST_INDEX_BIT_COUNT 31 // supports > 2 billion list items namespace mozilla { namespace dom { +class SVGElement; class SVGMatrix; /** @@ -128,7 +127,7 @@ class SVGTransform final : public nsWrapperCache { void SetMatrix(const gfxMatrix& aMatrix); private: - nsSVGElement* Element() { return mList->Element(); } + SVGElement* Element() { return mList->Element(); } /** * Get a reference to the internal nsSVGTransform list item that this DOM diff --git a/dom/svg/SVGTransformableElement.cpp b/dom/svg/SVGTransformableElement.cpp index 198fd5bf2c92..1ddfb83611d6 100644 --- a/dom/svg/SVGTransformableElement.cpp +++ b/dom/svg/SVGTransformableElement.cpp @@ -40,13 +40,13 @@ SVGTransformableElement::IsAttributeMapped(const nsAtom* name) const { sGraphicsMap}; return FindAttributeDependence(name, map) || - nsSVGElement::IsAttributeMapped(name); + SVGElement::IsAttributeMapped(name); } nsChangeHint SVGTransformableElement::GetAttributeChangeHint( const nsAtom* aAttribute, int32_t aModType) const { nsChangeHint retval = - nsSVGElement::GetAttributeChangeHint(aAttribute, aModType); + SVGElement::GetAttributeChangeHint(aAttribute, aModType); if (aAttribute == nsGkAtoms::transform || aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) { nsIFrame* frame = @@ -89,7 +89,7 @@ bool SVGTransformableElement::IsEventAttributeNameInternal(nsAtom* aName) { } //---------------------------------------------------------------------- -// nsSVGElement overrides +// SVGElement overrides gfxMatrix SVGTransformableElement::PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const { @@ -146,11 +146,11 @@ nsSVGAnimatedTransformList* SVGTransformableElement::GetAnimatedTransformList( return mTransforms; } -nsSVGElement* SVGTransformableElement::GetNearestViewportElement() { +SVGElement* SVGTransformableElement::GetNearestViewportElement() { return SVGContentUtils::GetNearestViewportElement(this); } -nsSVGElement* SVGTransformableElement::GetFarthestViewportElement() { +SVGElement* SVGTransformableElement::GetFarthestViewportElement() { return SVGContentUtils::GetOuterSVGElement(this); } diff --git a/dom/svg/SVGTransformableElement.h b/dom/svg/SVGTransformableElement.h index 4f9f14e311f6..514d8c39680a 100644 --- a/dom/svg/SVGTransformableElement.h +++ b/dom/svg/SVGTransformableElement.h @@ -10,7 +10,7 @@ #include "mozilla/Attributes.h" #include "nsAutoPtr.h" #include "nsSVGAnimatedTransformList.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "gfxMatrix.h" #include "mozilla/gfx/Matrix.h" @@ -23,18 +23,18 @@ class SVGMatrix; class SVGIRect; struct SVGBoundingBoxOptions; -class SVGTransformableElement : public nsSVGElement { +class SVGTransformableElement : public SVGElement { public: explicit SVGTransformableElement(already_AddRefed&& aNodeInfo) - : nsSVGElement(std::move(aNodeInfo)) {} + : SVGElement(std::move(aNodeInfo)) {} virtual ~SVGTransformableElement() {} virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override = 0; // WebIDL already_AddRefed Transform(); - nsSVGElement* GetNearestViewportElement(); - nsSVGElement* GetFarthestViewportElement(); + SVGElement* GetNearestViewportElement(); + SVGElement* GetFarthestViewportElement(); MOZ_CAN_RUN_SCRIPT already_AddRefed GetBBox(const SVGBoundingBoxOptions& aOptions, ErrorResult& rv); @@ -49,7 +49,7 @@ class SVGTransformableElement : public nsSVGElement { nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute, int32_t aModType) const override; - // nsSVGElement overrides + // SVGElement overrides virtual bool IsEventAttributeNameInternal(nsAtom* aName) override; virtual gfxMatrix PrependLocalTransformsTo( diff --git a/dom/svg/SVGUseElement.cpp b/dom/svg/SVGUseElement.cpp index ac39d3a850ce..9d1d3e7bf63d 100644 --- a/dom/svg/SVGUseElement.cpp +++ b/dom/svg/SVGUseElement.cpp @@ -35,7 +35,7 @@ JSObject* SVGUseElement::WrapNode(JSContext* aCx, //////////////////////////////////////////////////////////////////////// // implementation -nsSVGElement::LengthInfo SVGUseElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGUseElement::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -46,7 +46,7 @@ nsSVGElement::LengthInfo SVGUseElement::sLengthInfo[4] = { SVGContentUtils::Y}, }; -nsSVGElement::StringInfo SVGUseElement::sStringInfo[2] = { +SVGElement::StringInfo SVGUseElement::sStringInfo[2] = { {nsGkAtoms::href, kNameSpaceID_None, true}, {nsGkAtoms::href, kNameSpaceID_XLink, true}}; @@ -319,7 +319,7 @@ void SVGUseElement::UpdateShadowTree() { } if (newElement->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol)) { - auto* newSVGElement = static_cast(newElement.get()); + auto* newSVGElement = static_cast(newElement.get()); if (mLengthAttributes[ATTR_WIDTH].IsExplicitlySet()) newSVGElement->SetLength(nsGkAtoms::width, mLengthAttributes[ATTR_WIDTH]); if (mLengthAttributes[ATTR_HEIGHT].IsExplicitlySet()) @@ -368,7 +368,7 @@ void SVGUseElement::SyncWidthOrHeight(nsAtom* aName) { return; } - auto* target = nsSVGElement::FromNode(GetClonedChild(*this)); + auto* target = SVGElement::FromNode(GetClonedChild(*this)); uint32_t index = sLengthInfo[ATTR_WIDTH].mName == aName ? ATTR_WIDTH : ATTR_HEIGHT; @@ -433,7 +433,7 @@ void SVGUseElement::UnlinkSource() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ gfxMatrix SVGUseElement::PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const { @@ -477,12 +477,12 @@ void SVGUseElement::UnlinkSource() { mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0); } -nsSVGElement::LengthAttributesInfo SVGUseElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGUseElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } -nsSVGElement::StringAttributesInfo SVGUseElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGUseElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/SVGUseElement.h b/dom/svg/SVGUseElement.h index 185e9cc61658..751967664883 100644 --- a/dom/svg/SVGUseElement.h +++ b/dom/svg/SVGUseElement.h @@ -62,7 +62,7 @@ class SVGUseElement final : public SVGUseElementBase, NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED - // nsSVGElement specializations: + // SVGElement specializations: virtual gfxMatrix PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich = eAllTransforms) const override; diff --git a/dom/svg/SVGViewElement.cpp b/dom/svg/SVGViewElement.cpp index 909be4dbed11..49203ea82977 100644 --- a/dom/svg/SVGViewElement.cpp +++ b/dom/svg/SVGViewElement.cpp @@ -24,7 +24,7 @@ nsSVGEnumMapping SVGViewElement::sZoomAndPanMap[] = { {nsGkAtoms::magnify, SVG_ZOOMANDPAN_MAGNIFY}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGViewElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGViewElement::sEnumInfo[1] = { {nsGkAtoms::zoomAndPan, sZoomAndPanMap, SVG_ZOOMANDPAN_MAGNIFY}}; //---------------------------------------------------------------------- @@ -61,9 +61,9 @@ SVGViewElement::PreserveAspectRatio() { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::EnumAttributesInfo SVGViewElement::GetEnumInfo() { +SVGElement::EnumAttributesInfo SVGViewElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } diff --git a/dom/svg/SVGViewElement.h b/dom/svg/SVGViewElement.h index 116cc86fe4c2..19387df85786 100644 --- a/dom/svg/SVGViewElement.h +++ b/dom/svg/SVGViewElement.h @@ -7,14 +7,12 @@ #ifndef mozilla_dom_SVGViewElement_h #define mozilla_dom_SVGViewElement_h -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGEnum.h" #include "nsSVGViewBox.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGStringList.h" -typedef nsSVGElement SVGViewElementBase; - class nsSVGOuterSVGFrame; nsresult NS_NewSVGViewElement( @@ -26,6 +24,8 @@ class SVGFragmentIdentifier; namespace dom { class SVGViewportElement; +typedef SVGElement SVGViewElementBase; + class SVGViewElement : public SVGViewElementBase { protected: friend class mozilla::SVGFragmentIdentifier; @@ -49,7 +49,7 @@ class SVGViewElement : public SVGViewElementBase { already_AddRefed PreserveAspectRatio(); private: - // nsSVGElement overrides + // SVGElement overrides virtual EnumAttributesInfo GetEnumInfo() override; diff --git a/dom/svg/SVGViewportElement.cpp b/dom/svg/SVGViewportElement.cpp index 1c8ade55a048..700257f5bc80 100644 --- a/dom/svg/SVGViewportElement.cpp +++ b/dom/svg/SVGViewportElement.cpp @@ -38,7 +38,7 @@ using namespace mozilla::gfx; namespace mozilla { namespace dom { -nsSVGElement::LengthInfo SVGViewportElement::sLengthInfo[4] = { +SVGElement::LengthInfo SVGViewportElement::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_NUMBER, @@ -80,9 +80,9 @@ SVGViewportElement::IsAttributeMapped(const nsAtom* name) const { // We want to map the 'width' and 'height' attributes into style for // outer-, except when the attributes aren't set (since their default // values of '100%' can cause unexpected and undesirable behaviour for SVG - // inline in HTML). We rely on nsSVGElement::UpdateContentStyleRule() to + // inline in HTML). We rely on SVGElement::UpdateContentStyleRule() to // prevent mapping of the default values into style (it only maps attributes - // that are set). We also rely on a check in nsSVGElement:: + // that are set). We also rely on a check in SVGElement:: // UpdateContentStyleRule() to prevent us mapping the attributes when they're // given a value that is not currently recognized by the SVG // specification. @@ -108,7 +108,7 @@ SVGViewportElement::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement overrides +// SVGElement overrides // Helper for GetViewBoxTransform on root node // * aLength: internal value for our width or height attribute. @@ -237,7 +237,7 @@ float SVGViewportElement::GetLength(uint8_t aCtxType) { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods /* virtual */ gfxMatrix SVGViewportElement::PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const { @@ -332,7 +332,7 @@ nsSVGViewBoxRect SVGViewportElement::GetViewBoxWithSynthesis( return nsSVGViewBoxRect(0, 0, aViewportWidth, aViewportHeight); } -nsSVGElement::LengthAttributesInfo SVGViewportElement::GetLengthInfo() { +SVGElement::LengthAttributesInfo SVGViewportElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } diff --git a/dom/svg/SVGViewportElement.h b/dom/svg/SVGViewportElement.h index a21074e8d95d..7ec8e7b440b3 100644 --- a/dom/svg/SVGViewportElement.h +++ b/dom/svg/SVGViewportElement.h @@ -55,7 +55,7 @@ class SVGViewportElement : public SVGGraphicsElement { // nsIContent interface NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; - // nsSVGElement specializations: + // SVGElement specializations: virtual gfxMatrix PrependLocalTransformsTo( const gfxMatrix& aMatrix, SVGTransformTypes aWhich = eAllTransforms) const override; diff --git a/dom/svg/moz.build b/dom/svg/moz.build index 74162ff1131b..95e3d0028095 100644 --- a/dom/svg/moz.build +++ b/dom/svg/moz.build @@ -11,7 +11,6 @@ MOCHITEST_MANIFESTS += ['test/mochitest.ini'] EXPORTS += [ 'nsSVGClass.h', - 'nsSVGElement.h', 'nsSVGFeatures.h', 'SVGAttrValueWrapper.h', 'SVGContentUtils.h', @@ -44,6 +43,7 @@ EXPORTS.mozilla.dom += [ 'SVGDefsElement.h', 'SVGDescElement.h', 'SVGDocument.h', + 'SVGElement.h', 'SVGElementFactory.h', 'SVGEllipseElement.h', 'SVGFEBlendElement.h', @@ -128,7 +128,6 @@ UNIFIED_SOURCES += [ 'nsSVGBoolean.cpp', 'nsSVGClass.cpp', 'nsSVGDataParser.cpp', - 'nsSVGElement.cpp', 'nsSVGEnum.cpp', 'nsSVGFeatures.cpp', 'nsSVGFilters.cpp', @@ -168,6 +167,7 @@ UNIFIED_SOURCES += [ 'SVGDefsElement.cpp', 'SVGDescElement.cpp', 'SVGDocument.cpp', + 'SVGElement.cpp', 'SVGElementFactory.cpp', 'SVGEllipseElement.cpp', 'SVGFEBlendElement.cpp', diff --git a/dom/svg/nsISVGPoint.cpp b/dom/svg/nsISVGPoint.cpp index 460d9d3145fa..3cf0e974d8cd 100644 --- a/dom/svg/nsISVGPoint.cpp +++ b/dom/svg/nsISVGPoint.cpp @@ -7,7 +7,7 @@ #include "nsISVGPoint.h" #include "DOMSVGPointList.h" #include "SVGPoint.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsError.h" #include "mozilla/dom/SVGPointBinding.h" diff --git a/dom/svg/nsSVGAngle.cpp b/dom/svg/nsSVGAngle.cpp index 5858b6cf8620..925a689847c4 100644 --- a/dom/svg/nsSVGAngle.cpp +++ b/dom/svg/nsSVGAngle.cpp @@ -108,7 +108,7 @@ static void GetValueString(nsAString& aValueAsString, float aValue, } void nsSVGAngle::SetBaseValueInSpecifiedUnits(float aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mBaseVal == aValue) { return; } @@ -124,7 +124,7 @@ void nsSVGAngle::SetBaseValueInSpecifiedUnits(float aValue, } nsresult nsSVGAngle::ConvertToSpecifiedUnits(uint16_t unitType, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; if (mBaseValUnit == uint8_t(unitType)) return NS_OK; @@ -148,7 +148,7 @@ nsresult nsSVGAngle::ConvertToSpecifiedUnits(uint16_t unitType, nsresult nsSVGAngle::NewValueSpecifiedUnits(uint16_t unitType, float valueInSpecifiedUnits, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { NS_ENSURE_FINITE(valueInSpecifiedUnits, NS_ERROR_ILLEGAL_VALUE); if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; @@ -174,7 +174,7 @@ nsresult nsSVGAngle::NewValueSpecifiedUnits(uint16_t unitType, return NS_OK; } -already_AddRefed nsSVGAngle::ToDOMBaseVal(nsSVGElement* aSVGElement) { +already_AddRefed nsSVGAngle::ToDOMBaseVal(SVGElement* aSVGElement) { RefPtr domBaseVal = sBaseSVGAngleTearoffTable.GetTearoff(this); if (!domBaseVal) { domBaseVal = new SVGAngle(this, aSVGElement, SVGAngle::BaseValue); @@ -184,7 +184,7 @@ already_AddRefed nsSVGAngle::ToDOMBaseVal(nsSVGElement* aSVGElement) { return domBaseVal.forget(); } -already_AddRefed nsSVGAngle::ToDOMAnimVal(nsSVGElement* aSVGElement) { +already_AddRefed nsSVGAngle::ToDOMAnimVal(SVGElement* aSVGElement) { RefPtr domAnimVal = sAnimSVGAngleTearoffTable.GetTearoff(this); if (!domAnimVal) { domAnimVal = new SVGAngle(this, aSVGElement, SVGAngle::AnimValue); @@ -207,7 +207,7 @@ SVGAngle::~SVGAngle() { /* Implementation */ nsresult nsSVGAngle::SetBaseValueString(const nsAString& aValueAsString, - nsSVGElement* aSVGElement, + SVGElement* aSVGElement, bool aDoSetAttr) { float value; uint16_t unitType; @@ -247,7 +247,7 @@ void nsSVGAngle::GetAnimValueString(nsAString& aValueAsString) const { } void nsSVGAngle::SetBaseValue(float aValue, uint8_t aUnit, - nsSVGElement* aSVGElement, bool aDoSetAttr) { + SVGElement* aSVGElement, bool aDoSetAttr) { float valueInSpecifiedUnits = aValue / GetDegreesPerUnit(aUnit); if (aUnit == mBaseValUnit && mBaseVal == valueInSpecifiedUnits) { return; @@ -270,7 +270,7 @@ void nsSVGAngle::SetBaseValue(float aValue, uint8_t aUnit, } void nsSVGAngle::SetAnimValue(float aValue, uint8_t aUnit, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal == aValue && mAnimValUnit == aUnit) { return; } @@ -281,7 +281,7 @@ void nsSVGAngle::SetAnimValue(float aValue, uint8_t aUnit, } already_AddRefed nsSVGAngle::ToDOMAnimatedAngle( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedAngle = sSVGAnimatedAngleTearoffTable.GetTearoff(this); if (!domAnimatedAngle) { @@ -296,7 +296,7 @@ SVGAnimatedAngle::~SVGAnimatedAngle() { sSVGAnimatedAngleTearoffTable.RemoveTearoff(mVal); } -UniquePtr nsSVGAngle::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGAngle::ToSMILAttr(SVGElement* aSVGElement) { if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) { SVGMarkerElement* marker = static_cast(aSVGElement); return MakeUnique(marker->GetOrientType(), this, aSVGElement); diff --git a/dom/svg/nsSVGAngle.h b/dom/svg/nsSVGAngle.h index bdbb58572398..56c394eabdc1 100644 --- a/dom/svg/nsSVGAngle.h +++ b/dom/svg/nsSVGAngle.h @@ -16,7 +16,6 @@ class nsISupports; class nsSMILValue; -class nsSVGElement; namespace mozilla { @@ -25,12 +24,14 @@ class nsSVGOrientType; class SVGAngle; class SVGAnimatedAngle; class SVGAnimationElement; +class SVGElement; } // namespace dom } // namespace mozilla class nsSVGAngle { friend class mozilla::dom::SVGAngle; friend class mozilla::dom::SVGAnimatedAngle; + typedef mozilla::dom::SVGElement SVGElement; public: void Init(uint8_t aAttrEnum = 0xff, float aValue = 0, @@ -42,8 +43,8 @@ class nsSVGAngle { mIsAnimated = false; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement, + bool aDoSetAttr); void GetBaseValueString(nsAString& aValue) const; void GetAnimValueString(nsAString& aValue) const; @@ -54,9 +55,9 @@ class nsSVGAngle { return mAnimVal * GetDegreesPerUnit(mAnimValUnit); } - void SetBaseValue(float aValue, uint8_t aUnit, nsSVGElement* aSVGElement, + void SetBaseValue(float aValue, uint8_t aUnit, SVGElement* aSVGElement, bool aDoSetAttr); - void SetAnimValue(float aValue, uint8_t aUnit, nsSVGElement* aSVGElement); + void SetAnimValue(float aValue, uint8_t aUnit, SVGElement* aSVGElement); uint8_t GetBaseValueUnit() const { return mBaseValUnit; } uint8_t GetAnimValueUnit() const { return mAnimValUnit; } @@ -65,8 +66,8 @@ class nsSVGAngle { static nsresult ToDOMSVGAngle(nsISupports** aResult); already_AddRefed ToDOMAnimatedAngle( - nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); static bool GetValueFromString(const nsAString& aString, float& aValue, uint16_t* aUnitType); @@ -80,15 +81,14 @@ class nsSVGAngle { uint8_t mAttrEnum; // element specified tracking for attribute bool mIsAnimated; - void SetBaseValueInSpecifiedUnits(float aValue, nsSVGElement* aSVGElement); + void SetBaseValueInSpecifiedUnits(float aValue, SVGElement* aSVGElement); nsresult NewValueSpecifiedUnits(uint16_t aUnitType, float aValue, - nsSVGElement* aSVGElement); - nsresult ConvertToSpecifiedUnits(uint16_t aUnitType, - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + nsresult ConvertToSpecifiedUnits(uint16_t aUnitType, SVGElement* aSVGElement); already_AddRefed ToDOMBaseVal( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); already_AddRefed ToDOMAnimVal( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); public: // We do not currently implemente a SMILAngle struct because in SVG 1.1 the @@ -99,7 +99,7 @@ class nsSVGAngle { struct SMILOrient final : public nsISMILAttr { public: SMILOrient(mozilla::dom::nsSVGOrientType* aOrientType, nsSVGAngle* aAngle, - nsSVGElement* aSVGElement) + SVGElement* aSVGElement) : mOrientType(aOrientType), mAngle(aAngle), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long @@ -107,7 +107,7 @@ class nsSVGAngle { // die during that. mozilla::dom::nsSVGOrientType* mOrientType; nsSVGAngle* mAngle; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGAnimatedTransformList.cpp b/dom/svg/nsSVGAnimatedTransformList.cpp index 2245323a0b65..068612e75ba6 100644 --- a/dom/svg/nsSVGAnimatedTransformList.cpp +++ b/dom/svg/nsSVGAnimatedTransformList.cpp @@ -22,7 +22,7 @@ using namespace mozilla::dom::SVGTransform_Binding; namespace mozilla { nsresult nsSVGAnimatedTransformList::SetBaseValueString( - const nsAString& aValue, nsSVGElement* aSVGElement) { + const nsAString& aValue, SVGElement* aSVGElement) { SVGTransformList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); if (NS_FAILED(rv)) { @@ -33,7 +33,7 @@ nsresult nsSVGAnimatedTransformList::SetBaseValueString( } nsresult nsSVGAnimatedTransformList::SetBaseValue( - const SVGTransformList& aValue, nsSVGElement* aSVGElement) { + const SVGTransformList& aValue, SVGElement* aSVGElement) { SVGAnimatedTransformList* domWrapper = SVGAnimatedTransformList::GetDOMWrapperIfExists(this); if (domWrapper) { @@ -49,7 +49,7 @@ nsresult nsSVGAnimatedTransformList::SetBaseValue( bool hadTransform = HasTransform(); // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. nsresult rv = mBaseVal.CopyFrom(aValue); @@ -82,7 +82,7 @@ void nsSVGAnimatedTransformList::ClearBaseValue() { } nsresult nsSVGAnimatedTransformList::SetAnimValue( - const SVGTransformList& aValue, nsSVGElement* aElement) { + const SVGTransformList& aValue, SVGElement* aElement) { bool prevSet = HasTransform() || aElement->GetAnimateMotionTransform(); SVGAnimatedTransformList* domWrapper = SVGAnimatedTransformList::GetDOMWrapperIfExists(this); @@ -125,7 +125,7 @@ nsresult nsSVGAnimatedTransformList::SetAnimValue( return NS_OK; } -void nsSVGAnimatedTransformList::ClearAnimValue(nsSVGElement* aElement) { +void nsSVGAnimatedTransformList::ClearAnimValue(SVGElement* aElement) { SVGAnimatedTransformList* domWrapper = SVGAnimatedTransformList::GetDOMWrapperIfExists(this); if (domWrapper) { @@ -153,7 +153,7 @@ bool nsSVGAnimatedTransformList::IsExplicitlySet() const { // There are three ways an animated list can become set: // 1) Markup -- we set mIsAttrSet to true on any successful call to // SetBaseValueString and clear it on ClearBaseValue (as called by - // nsSVGElement::UnsetAttr or a failed nsSVGElement::ParseAttribute) + // SVGElement::UnsetAttr or a failed SVGElement::ParseAttribute) // 2) DOM call -- simply fetching the baseVal doesn't mean the transform value // has been set. It is set if that baseVal has one or more transforms in // the list. @@ -162,7 +162,7 @@ bool nsSVGAnimatedTransformList::IsExplicitlySet() const { } UniquePtr nsSVGAnimatedTransformList::ToSMILAttr( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGAnimatedTransformList.h b/dom/svg/nsSVGAnimatedTransformList.h index c631f5115c54..1edb5bd578cc 100644 --- a/dom/svg/nsSVGAnimatedTransformList.h +++ b/dom/svg/nsSVGAnimatedTransformList.h @@ -15,12 +15,12 @@ class nsAtom; class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; +class SVGElement; class SVGTransform; } // namespace dom @@ -57,10 +57,10 @@ class nsSVGAnimatedTransformList { const SVGTransformList& GetBaseValue() const { return mBaseVal; } nsresult SetBaseValue(const SVGTransformList& aValue, - nsSVGElement* aSVGElement); + dom::SVGElement* aSVGElement); nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement); + dom::SVGElement* aSVGElement); void ClearBaseValue(); @@ -69,9 +69,9 @@ class nsSVGAnimatedTransformList { } nsresult SetAnimValue(const SVGTransformList& aNewAnimValue, - nsSVGElement* aElement); + dom::SVGElement* aElement); - void ClearAnimValue(nsSVGElement* aElement); + void ClearAnimValue(dom::SVGElement* aElement); /** * Returns true if the corresponding transform attribute is set (or animated) @@ -107,7 +107,7 @@ class nsSVGAnimatedTransformList { return mRequiresFrameReconstruction; } - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(dom::SVGElement* aSVGElement); private: // mAnimVal is a pointer to allow us to determine if we're being animated or @@ -124,7 +124,7 @@ class nsSVGAnimatedTransformList { struct SMILAnimatedTransformList : public nsISMILAttr { public: SMILAnimatedTransformList(nsSVGAnimatedTransformList* aVal, - nsSVGElement* aSVGElement) + dom::SVGElement* aSVGElement) : mVal(aVal), mElement(aSVGElement) {} // nsISMILAttr methods @@ -145,7 +145,7 @@ class nsSVGAnimatedTransformList { // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGAnimatedTransformList* mVal; - nsSVGElement* mElement; + dom::SVGElement* mElement; }; }; diff --git a/dom/svg/nsSVGBoolean.cpp b/dom/svg/nsSVGBoolean.cpp index 9c29c980c522..60213971ce63 100644 --- a/dom/svg/nsSVGBoolean.cpp +++ b/dom/svg/nsSVGBoolean.cpp @@ -48,7 +48,7 @@ static nsresult GetValueFromAtom(const nsAtom* aValueAsAtom, bool* aValue) { } nsresult nsSVGBoolean::SetBaseValueAtom(const nsAtom* aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { bool val = false; nsresult rv = GetValueFromAtom(aValue, &val); @@ -64,7 +64,7 @@ nsresult nsSVGBoolean::SetBaseValueAtom(const nsAtom* aValue, } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. return NS_OK; } @@ -73,7 +73,7 @@ nsAtom* nsSVGBoolean::GetBaseValueAtom() const { return mBaseVal ? nsGkAtoms::_true : nsGkAtoms::_false; } -void nsSVGBoolean::SetBaseValue(bool aValue, nsSVGElement* aSVGElement) { +void nsSVGBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) { if (aValue == mBaseVal) { return; } @@ -87,7 +87,7 @@ void nsSVGBoolean::SetBaseValue(bool aValue, nsSVGElement* aSVGElement) { aSVGElement->DidChangeBoolean(mAttrEnum); } -void nsSVGBoolean::SetAnimValue(bool aValue, nsSVGElement* aSVGElement) { +void nsSVGBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal == aValue) { return; } @@ -97,7 +97,7 @@ void nsSVGBoolean::SetAnimValue(bool aValue, nsSVGElement* aSVGElement) { } already_AddRefed nsSVGBoolean::ToDOMAnimatedBoolean( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedBoolean = SVGAnimatedBooleanTearoffTable().GetTearoff(this); if (!domAnimatedBoolean) { @@ -112,7 +112,7 @@ SVGAnimatedBoolean::~SVGAnimatedBoolean() { SVGAnimatedBooleanTearoffTable().RemoveTearoff(mVal); } -UniquePtr nsSVGBoolean::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGBoolean::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGBoolean.h b/dom/svg/nsSVGBoolean.h index 2b64653c77b9..eb1d862ab0b3 100644 --- a/dom/svg/nsSVGBoolean.h +++ b/dom/svg/nsSVGBoolean.h @@ -15,35 +15,37 @@ class nsAtom; class nsSMILValue; -class nsSVGElement; namespace mozilla { namespace dom { class SVGAnimationElement; class SVGAnimatedBoolean; +class SVGElement; } // namespace dom } // namespace mozilla class nsSVGBoolean { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(uint8_t aAttrEnum = 0xff, bool aValue = false) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; mIsAnimated = false; } - nsresult SetBaseValueAtom(const nsAtom* aValue, nsSVGElement* aSVGElement); + nsresult SetBaseValueAtom(const nsAtom* aValue, SVGElement* aSVGElement); nsAtom* GetBaseValueAtom() const; - void SetBaseValue(bool aValue, nsSVGElement* aSVGElement); + void SetBaseValue(bool aValue, SVGElement* aSVGElement); bool GetBaseValue() const { return mBaseVal; } - void SetAnimValue(bool aValue, nsSVGElement* aSVGElement); + void SetAnimValue(bool aValue, SVGElement* aSVGElement); bool GetAnimValue() const { return mAnimVal; } already_AddRefed ToDOMAnimatedBoolean( - nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: bool mAnimVal; @@ -54,14 +56,14 @@ class nsSVGBoolean { public: struct SMILBool : public nsISMILAttr { public: - SMILBool(nsSVGBoolean* aVal, nsSVGElement* aSVGElement) + SMILBool(nsSVGBoolean* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGBoolean* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGClass.cpp b/dom/svg/nsSVGClass.cpp index e5d4afad23bc..7872ae796235 100644 --- a/dom/svg/nsSVGClass.cpp +++ b/dom/svg/nsSVGClass.cpp @@ -8,7 +8,7 @@ #include "mozilla/dom/SVGAnimatedString.h" #include "mozilla/Move.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSMILValue.h" #include "SMILStringType.h" @@ -19,7 +19,7 @@ struct DOMAnimatedString final : public SVGAnimatedString { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString) - DOMAnimatedString(nsSVGClass* aVal, nsSVGElement* aSVGElement) + DOMAnimatedString(nsSVGClass* aVal, SVGElement* aSVGElement) : SVGAnimatedString(aSVGElement), mVal(aVal) {} nsSVGClass* mVal; // kept alive because it belongs to content @@ -49,15 +49,15 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMAnimatedString) NS_INTERFACE_MAP_END already_AddRefed nsSVGClass::ToDOMAnimatedString( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr result = new DOMAnimatedString(this, aSVGElement); return result.forget(); } /* Implementation */ -void nsSVGClass::SetBaseValue(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr) { +void nsSVGClass::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, + bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); aSVGElement->SetMayHaveClass(); @@ -70,12 +70,12 @@ void nsSVGClass::SetBaseValue(const nsAString& aValue, } void nsSVGClass::GetBaseValue(nsAString& aValue, - const nsSVGElement* aSVGElement) const { + const SVGElement* aSVGElement) const { aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue); } void nsSVGClass::GetAnimValue(nsAString& aResult, - const nsSVGElement* aSVGElement) const { + const SVGElement* aSVGElement) const { if (mAnimVal) { aResult = *mAnimVal; return; @@ -85,7 +85,7 @@ void nsSVGClass::GetAnimValue(nsAString& aResult, } void nsSVGClass::SetAnimValue(const nsAString& aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mAnimVal && mAnimVal->Equals(aValue)) { return; } @@ -102,7 +102,7 @@ void DOMAnimatedString::GetAnimVal(nsAString& aResult) { mVal->GetAnimValue(aResult, mSVGElement); } -UniquePtr nsSVGClass::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGClass::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGClass.h b/dom/svg/nsSVGClass.h index 5b6134078280..fe34102708c7 100644 --- a/dom/svg/nsSVGClass.h +++ b/dom/svg/nsSVGClass.h @@ -15,30 +15,31 @@ #include "mozilla/Attributes.h" #include "mozilla/UniquePtr.h" -class nsSVGElement; - namespace mozilla { namespace dom { class SVGAnimatedString; +class SVGElement; } // namespace dom } // namespace mozilla class nsSVGClass { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init() { mAnimVal = nullptr; } - void SetBaseValue(const nsAString& aValue, nsSVGElement* aSVGElement, + void SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, bool aDoSetAttr); - void GetBaseValue(nsAString& aValue, const nsSVGElement* aSVGElement) const; + void GetBaseValue(nsAString& aValue, const SVGElement* aSVGElement) const; - void SetAnimValue(const nsAString& aValue, nsSVGElement* aSVGElement); - void GetAnimValue(nsAString& aValue, const nsSVGElement* aSVGElement) const; + void SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement); + void GetAnimValue(nsAString& aValue, const SVGElement* aSVGElement) const; bool IsAnimated() const { return !!mAnimVal; } already_AddRefed ToDOMAnimatedString( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: nsAutoPtr mAnimVal; @@ -46,14 +47,14 @@ class nsSVGClass { public: struct SMILString : public nsISMILAttr { public: - SMILString(nsSVGClass* aVal, nsSVGElement* aSVGElement) + SMILString(nsSVGClass* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGClass* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGEnum.cpp b/dom/svg/nsSVGEnum.cpp index 82d97b74111b..5a4997b50e1b 100644 --- a/dom/svg/nsSVGEnum.cpp +++ b/dom/svg/nsSVGEnum.cpp @@ -8,7 +8,7 @@ #include "nsSVGAttrTearoffTable.h" #include "nsSVGEnum.h" #include "nsAtom.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSMILValue.h" #include "SMILEnumType.h" @@ -18,8 +18,8 @@ using namespace mozilla::dom; static nsSVGAttrTearoffTable sSVGAnimatedEnumTearoffTable; -const nsSVGEnumMapping* nsSVGEnum::GetMapping(nsSVGElement* aSVGElement) { - nsSVGElement::EnumAttributesInfo info = aSVGElement->GetEnumInfo(); +const nsSVGEnumMapping* nsSVGEnum::GetMapping(SVGElement* aSVGElement) { + SVGElement::EnumAttributesInfo info = aSVGElement->GetEnumInfo(); NS_ASSERTION(info.mEnumCount > 0 && mAttrEnum < info.mEnumCount, "mapping request for a non-attrib enum"); @@ -28,7 +28,7 @@ const nsSVGEnumMapping* nsSVGEnum::GetMapping(nsSVGElement* aSVGElement) { } nsresult nsSVGEnum::SetBaseValueAtom(const nsAtom* aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { const nsSVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -42,7 +42,7 @@ nsresult nsSVGEnum::SetBaseValueAtom(const nsAtom* aValue, aSVGElement->AnimationNeedsResample(); } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. } return NS_OK; @@ -53,7 +53,7 @@ nsresult nsSVGEnum::SetBaseValueAtom(const nsAtom* aValue, return NS_ERROR_DOM_TYPE_ERR; } -nsAtom* nsSVGEnum::GetBaseValueAtom(nsSVGElement* aSVGElement) { +nsAtom* nsSVGEnum::GetBaseValueAtom(SVGElement* aSVGElement) { const nsSVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -66,7 +66,7 @@ nsAtom* nsSVGEnum::GetBaseValueAtom(nsSVGElement* aSVGElement) { return nsGkAtoms::_empty; } -nsresult nsSVGEnum::SetBaseValue(uint16_t aValue, nsSVGElement* aSVGElement) { +nsresult nsSVGEnum::SetBaseValue(uint16_t aValue, SVGElement* aSVGElement) { const nsSVGEnumMapping* mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { @@ -88,7 +88,7 @@ nsresult nsSVGEnum::SetBaseValue(uint16_t aValue, nsSVGElement* aSVGElement) { return NS_ERROR_DOM_TYPE_ERR; } -void nsSVGEnum::SetAnimValue(uint16_t aValue, nsSVGElement* aSVGElement) { +void nsSVGEnum::SetAnimValue(uint16_t aValue, SVGElement* aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -98,7 +98,7 @@ void nsSVGEnum::SetAnimValue(uint16_t aValue, nsSVGElement* aSVGElement) { } already_AddRefed nsSVGEnum::ToDOMAnimatedEnum( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedEnum = sSVGAnimatedEnumTearoffTable.GetTearoff(this); if (!domAnimatedEnum) { @@ -113,7 +113,7 @@ nsSVGEnum::DOMAnimatedEnum::~DOMAnimatedEnum() { sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal); } -UniquePtr nsSVGEnum::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGEnum::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGEnum.h b/dom/svg/nsSVGEnum.h index ff5536e0d1a9..9f1c8e3347ef 100644 --- a/dom/svg/nsSVGEnum.h +++ b/dom/svg/nsSVGEnum.h @@ -10,7 +10,7 @@ #include "nsCycleCollectionParticipant.h" #include "nsError.h" #include "nsISMILAttr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGAnimatedEnumeration.h" #include "mozilla/UniquePtr.h" @@ -33,6 +33,8 @@ struct nsSVGEnumMapping { class nsSVGEnum { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(uint8_t aAttrEnum, uint16_t aValue) { mAnimVal = mBaseVal = uint8_t(aValue); mAttrEnum = aAttrEnum; @@ -40,19 +42,19 @@ class nsSVGEnum { mIsBaseSet = false; } - nsresult SetBaseValueAtom(const nsAtom* aValue, nsSVGElement* aSVGElement); - nsAtom* GetBaseValueAtom(nsSVGElement* aSVGElement); - nsresult SetBaseValue(uint16_t aValue, nsSVGElement* aSVGElement); + nsresult SetBaseValueAtom(const nsAtom* aValue, SVGElement* aSVGElement); + nsAtom* GetBaseValueAtom(SVGElement* aSVGElement); + nsresult SetBaseValue(uint16_t aValue, SVGElement* aSVGElement); uint16_t GetBaseValue() const { return mBaseVal; } - void SetAnimValue(uint16_t aValue, nsSVGElement* aSVGElement); + void SetAnimValue(uint16_t aValue, SVGElement* aSVGElement); uint16_t GetAnimValue() const { return mAnimVal; } bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedEnum( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: nsSVGEnumValue mAnimVal; @@ -61,11 +63,11 @@ class nsSVGEnum { bool mIsAnimated; bool mIsBaseSet; - const nsSVGEnumMapping* GetMapping(nsSVGElement* aSVGElement); + const nsSVGEnumMapping* GetMapping(SVGElement* aSVGElement); public: struct DOMAnimatedEnum final : public mozilla::dom::SVGAnimatedEnumeration { - DOMAnimatedEnum(nsSVGEnum* aVal, nsSVGElement* aSVGElement) + DOMAnimatedEnum(nsSVGEnum* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedEnumeration(aSVGElement), mVal(aVal) {} virtual ~DOMAnimatedEnum(); @@ -88,14 +90,14 @@ class nsSVGEnum { struct SMILEnum : public nsISMILAttr { public: - SMILEnum(nsSVGEnum* aVal, nsSVGElement* aSVGElement) + SMILEnum(nsSVGEnum* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGEnum* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGFilters.cpp b/dom/svg/nsSVGFilters.cpp index e1dafc6eb927..a26506d651cd 100644 --- a/dom/svg/nsSVGFilters.cpp +++ b/dom/svg/nsSVGFilters.cpp @@ -6,7 +6,7 @@ #include "mozilla/ArrayUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsGkAtoms.h" #include "nsSVGNumber2.h" #include "nsSVGNumberPair.h" @@ -51,7 +51,7 @@ using namespace mozilla::gfx; //--------------------Filter Element Base Class----------------------- -nsSVGElement::LengthInfo nsSVGFE::sLengthInfo[4] = { +SVGElement::LengthInfo nsSVGFE::sLengthInfo[4] = { {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X}, {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE, @@ -128,7 +128,7 @@ nsSVGFE::IsAttributeMapped(const nsAtom* name) const { } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods bool nsSVGFE::StyleIsSetToSRGB() { nsIFrame* frame = GetPrimaryFrame(); @@ -159,7 +159,7 @@ Size nsSVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance, return Size(kernelX, kernelY); } -nsSVGElement::LengthAttributesInfo nsSVGFE::GetLengthInfo() { +SVGElement::LengthAttributesInfo nsSVGFE::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); } @@ -167,11 +167,11 @@ nsSVGElement::LengthAttributesInfo nsSVGFE::GetLengthInfo() { namespace mozilla { namespace dom { -nsSVGElement::NumberListInfo +SVGElement::NumberListInfo SVGComponentTransferFunctionElement::sNumberListInfo[1] = { {nsGkAtoms::tableValues}}; -nsSVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] = { +SVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] = { {nsGkAtoms::slope, 1, false}, {nsGkAtoms::intercept, 0, false}, {nsGkAtoms::amplitude, 1, false}, @@ -186,7 +186,7 @@ nsSVGEnumMapping SVGComponentTransferFunctionElement::sTypeMap[] = { {nsGkAtoms::gamma, SVG_FECOMPONENTTRANSFER_TYPE_GAMMA}, {nullptr, 0}}; -nsSVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] = { +SVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] = { {nsGkAtoms::type, sTypeMap, SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY}}; //---------------------------------------------------------------------- @@ -293,20 +293,20 @@ void SVGComponentTransferFunctionElement::ComputeAttributes( } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberListAttributesInfo +SVGElement::NumberListAttributesInfo SVGComponentTransferFunctionElement::GetNumberListInfo() { return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo, ArrayLength(sNumberListInfo)); } -nsSVGElement::EnumAttributesInfo +SVGElement::EnumAttributesInfo SVGComponentTransferFunctionElement::GetEnumInfo() { return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo)); } -nsSVGElement::NumberAttributesInfo +SVGElement::NumberAttributesInfo SVGComponentTransferFunctionElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); @@ -374,16 +374,16 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncAElement) //-------------------------------------------------------------------- // -nsSVGElement::NumberInfo SVGFELightingElement::sNumberInfo[4] = { +SVGElement::NumberInfo SVGFELightingElement::sNumberInfo[4] = { {nsGkAtoms::surfaceScale, 1, false}, {nsGkAtoms::diffuseConstant, 1, false}, {nsGkAtoms::specularConstant, 1, false}, {nsGkAtoms::specularExponent, 1, false}}; -nsSVGElement::NumberPairInfo SVGFELightingElement::sNumberPairInfo[1] = { +SVGElement::NumberPairInfo SVGFELightingElement::sNumberPairInfo[1] = { {nsGkAtoms::kernelUnitLength, 0, 0}}; -nsSVGElement::StringInfo SVGFELightingElement::sStringInfo[2] = { +SVGElement::StringInfo SVGFELightingElement::sStringInfo[2] = { {nsGkAtoms::result, kNameSpaceID_None, true}, {nsGkAtoms::in, kNameSpaceID_None, true}}; @@ -462,20 +462,19 @@ bool SVGFELightingElement::AttributeAffectsRendering(int32_t aNameSpaceID, } //---------------------------------------------------------------------- -// nsSVGElement methods +// SVGElement methods -nsSVGElement::NumberAttributesInfo SVGFELightingElement::GetNumberInfo() { +SVGElement::NumberAttributesInfo SVGFELightingElement::GetNumberInfo() { return NumberAttributesInfo(mNumberAttributes, sNumberInfo, ArrayLength(sNumberInfo)); } -nsSVGElement::NumberPairAttributesInfo -SVGFELightingElement::GetNumberPairInfo() { +SVGElement::NumberPairAttributesInfo SVGFELightingElement::GetNumberPairInfo() { return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo, ArrayLength(sNumberPairInfo)); } -nsSVGElement::StringAttributesInfo SVGFELightingElement::GetStringInfo() { +SVGElement::StringAttributesInfo SVGFELightingElement::GetStringInfo() { return StringAttributesInfo(mStringAttributes, sStringInfo, ArrayLength(sStringInfo)); } diff --git a/dom/svg/nsSVGFilters.h b/dom/svg/nsSVGFilters.h index 83d3b837e34f..edce1bd0d1ba 100644 --- a/dom/svg/nsSVGFilters.h +++ b/dom/svg/nsSVGFilters.h @@ -11,7 +11,7 @@ #include "nsImageLoadingContent.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGNumber2.h" #include "nsSVGNumberPair.h" #include "FilterSupport.h" @@ -20,14 +20,15 @@ class nsSVGFilterInstance; class nsSVGNumberPair; struct nsSVGStringInfo { - nsSVGStringInfo(const nsSVGString* aString, nsSVGElement* aElement) + nsSVGStringInfo(const nsSVGString* aString, + mozilla::dom::SVGElement* aElement) : mString(aString), mElement(aElement) {} const nsSVGString* mString; - nsSVGElement* mElement; + mozilla::dom::SVGElement* mElement; }; -typedef nsSVGElement nsSVGFEBase; +typedef mozilla::dom::SVGElement nsSVGFEBase; #define NS_SVG_FE_CID \ { \ @@ -83,7 +84,7 @@ class nsSVGFE : public nsSVGFEBase { // nsIContent interface NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; - // nsSVGElement interface + // SVGElement interface virtual nsresult Clone(mozilla::dom::NodeInfo*, nsINode** aResult) const override = 0; @@ -140,7 +141,7 @@ class nsSVGFE : public nsSVGFEBase { bool StyleIsSetToSRGB(); - // nsSVGElement specializations: + // SVGElement specializations: virtual LengthAttributesInfo GetLengthInfo() override; Size GetKernelUnitLength(nsSVGFilterInstance* aInstance, @@ -153,7 +154,7 @@ class nsSVGFE : public nsSVGFEBase { NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFE, NS_SVG_FE_CID) -typedef nsSVGElement SVGFEUnstyledElementBase; +typedef mozilla::dom::SVGElement SVGFEUnstyledElementBase; class SVGFEUnstyledElement : public SVGFEUnstyledElementBase { protected: diff --git a/dom/svg/nsSVGInteger.cpp b/dom/svg/nsSVGInteger.cpp index c6c06eedac52..7b5528649767 100644 --- a/dom/svg/nsSVGInteger.cpp +++ b/dom/svg/nsSVGInteger.cpp @@ -20,7 +20,7 @@ static nsSVGAttrTearoffTable sSVGAnimatedIntegerTearoffTable; nsresult nsSVGInteger::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement) { + SVGElement *aSVGElement) { int32_t value; if (!SVGContentUtils::ParseInteger(aValueAsString, value)) { @@ -42,7 +42,7 @@ void nsSVGInteger::GetBaseValueString(nsAString &aValueAsString) { aValueAsString.AppendInt(mBaseVal); } -void nsSVGInteger::SetBaseValue(int aValue, nsSVGElement *aSVGElement) { +void nsSVGInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { // We can't just rely on SetParsedAttrValue (as called by DidChangeInteger) // detecting redundant changes since it will compare false if the existing // attribute value has an associated serialized version (a string value) even @@ -61,7 +61,7 @@ void nsSVGInteger::SetBaseValue(int aValue, nsSVGElement *aSVGElement) { aSVGElement->DidChangeInteger(mAttrEnum); } -void nsSVGInteger::SetAnimValue(int aValue, nsSVGElement *aSVGElement) { +void nsSVGInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -71,7 +71,7 @@ void nsSVGInteger::SetAnimValue(int aValue, nsSVGElement *aSVGElement) { } already_AddRefed nsSVGInteger::ToDOMAnimatedInteger( - nsSVGElement *aSVGElement) { + SVGElement *aSVGElement) { RefPtr domAnimatedInteger = sSVGAnimatedIntegerTearoffTable.GetTearoff(this); if (!domAnimatedInteger) { @@ -86,7 +86,7 @@ nsSVGInteger::DOMAnimatedInteger::~DOMAnimatedInteger() { sSVGAnimatedIntegerTearoffTable.RemoveTearoff(mVal); } -UniquePtr nsSVGInteger::ToSMILAttr(nsSVGElement *aSVGElement) { +UniquePtr nsSVGInteger::ToSMILAttr(SVGElement *aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGInteger.h b/dom/svg/nsSVGInteger.h index daf6e0cf0180..270a41916dcf 100644 --- a/dom/svg/nsSVGInteger.h +++ b/dom/svg/nsSVGInteger.h @@ -11,7 +11,7 @@ #include "nsError.h" #include "SVGAnimatedInteger.h" #include "nsISMILAttr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/UniquePtr.h" @@ -25,6 +25,8 @@ class SVGAnimationElement; class nsSVGInteger { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(uint8_t aAttrEnum = 0xff, int32_t aValue = 0) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; @@ -32,14 +34,13 @@ class nsSVGInteger { mIsBaseSet = false; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(int32_t aValue, nsSVGElement* aSVGElement); + void SetBaseValue(int32_t aValue, SVGElement* aSVGElement); int32_t GetBaseValue() const { return mBaseVal; } - void SetAnimValue(int aValue, nsSVGElement* aSVGElement); + void SetAnimValue(int aValue, SVGElement* aSVGElement); int GetAnimValue() const { return mAnimVal; } // Returns true if the animated value of this integer has been explicitly @@ -50,8 +51,8 @@ class nsSVGInteger { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedInteger( - nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: int32_t mAnimVal; @@ -62,7 +63,7 @@ class nsSVGInteger { public: struct DOMAnimatedInteger final : public mozilla::dom::SVGAnimatedInteger { - DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement) + DOMAnimatedInteger(nsSVGInteger* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedInteger(aSVGElement), mVal(aVal) {} virtual ~DOMAnimatedInteger(); @@ -83,14 +84,14 @@ class nsSVGInteger { struct SMILInteger : public nsISMILAttr { public: - SMILInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement) + SMILInteger(nsSVGInteger* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGInteger* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGIntegerPair.cpp b/dom/svg/nsSVGIntegerPair.cpp index 96402fffe6cd..5ddadfa865c8 100644 --- a/dom/svg/nsSVGIntegerPair.cpp +++ b/dom/svg/nsSVGIntegerPair.cpp @@ -54,7 +54,7 @@ static nsresult ParseIntegerOptionalInteger(const nsAString& aValue, } nsresult nsSVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { int32_t val[2]; nsresult rv = ParseIntegerOptionalInteger(aValueAsString, val); @@ -74,7 +74,7 @@ nsresult nsSVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString, } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. return NS_OK; } @@ -89,7 +89,7 @@ void nsSVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const { } void nsSVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { uint32_t index = (aPairIndex == eFirst ? 0 : 1); if (mIsBaseSet && mBaseVal[index] == aValue) { return; @@ -107,7 +107,7 @@ void nsSVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex, } void nsSVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) { return; } @@ -126,7 +126,7 @@ void nsSVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2, } void nsSVGIntegerPair::SetAnimValue(const int32_t aValue[2], - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) { return; } @@ -137,7 +137,7 @@ void nsSVGIntegerPair::SetAnimValue(const int32_t aValue[2], } already_AddRefed nsSVGIntegerPair::ToDOMAnimatedInteger( - PairIndex aIndex, nsSVGElement* aSVGElement) { + PairIndex aIndex, SVGElement* aSVGElement) { RefPtr domAnimatedInteger = aIndex == eFirst ? sSVGFirstAnimatedIntegerTearoffTable.GetTearoff(this) : sSVGSecondAnimatedIntegerTearoffTable.GetTearoff(this); @@ -162,7 +162,7 @@ nsSVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() { } } -UniquePtr nsSVGIntegerPair::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGIntegerPair.h b/dom/svg/nsSVGIntegerPair.h index b71230c6647d..f6d7e3b3355a 100644 --- a/dom/svg/nsSVGIntegerPair.h +++ b/dom/svg/nsSVGIntegerPair.h @@ -10,7 +10,7 @@ #include "nsCycleCollectionParticipant.h" #include "nsError.h" #include "nsISMILAttr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGAnimatedInteger.h" #include "mozilla/UniquePtr.h" @@ -25,6 +25,8 @@ class SVGAnimationElement; class nsSVGIntegerPair { public: + typedef mozilla::dom::SVGElement SVGElement; + enum PairIndex { eFirst, eSecond }; void Init(uint8_t aAttrEnum = 0xff, int32_t aValue1 = 0, @@ -36,18 +38,15 @@ class nsSVGIntegerPair { mIsBaseSet = false; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement); void GetBaseValueString(nsAString& aValue) const; - void SetBaseValue(int32_t aValue, PairIndex aIndex, - nsSVGElement* aSVGElement); - void SetBaseValues(int32_t aValue1, int32_t aValue2, - nsSVGElement* aSVGElement); + void SetBaseValue(int32_t aValue, PairIndex aIndex, SVGElement* aSVGElement); + void SetBaseValues(int32_t aValue1, int32_t aValue2, SVGElement* aSVGElement); int32_t GetBaseValue(PairIndex aIndex) const { return mBaseVal[aIndex == eFirst ? 0 : 1]; } - void SetAnimValue(const int32_t aValue[2], nsSVGElement* aSVGElement); + void SetAnimValue(const int32_t aValue[2], SVGElement* aSVGElement); int32_t GetAnimValue(PairIndex aIndex) const { return mAnimVal[aIndex == eFirst ? 0 : 1]; } @@ -60,8 +59,8 @@ class nsSVGIntegerPair { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedInteger( - PairIndex aIndex, nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + PairIndex aIndex, SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: int32_t mAnimVal[2]; @@ -73,7 +72,7 @@ class nsSVGIntegerPair { public: struct DOMAnimatedInteger final : public mozilla::dom::SVGAnimatedInteger { DOMAnimatedInteger(nsSVGIntegerPair* aVal, PairIndex aIndex, - nsSVGElement* aSVGElement) + SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedInteger(aSVGElement), mVal(aVal), mIndex(aIndex) {} @@ -97,14 +96,14 @@ class nsSVGIntegerPair { struct SMILIntegerPair : public nsISMILAttr { public: - SMILIntegerPair(nsSVGIntegerPair* aVal, nsSVGElement* aSVGElement) + SMILIntegerPair(nsSVGIntegerPair* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGIntegerPair* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGLength2.cpp b/dom/svg/nsSVGLength2.cpp index 62d011e5b134..3dc9fa9aabf6 100644 --- a/dom/svg/nsSVGLength2.cpp +++ b/dom/svg/nsSVGLength2.cpp @@ -105,7 +105,7 @@ static float FixAxisLength(float aLength) { return aLength; } -SVGElementMetrics::SVGElementMetrics(nsSVGElement* aSVGElement, +SVGElementMetrics::SVGElementMetrics(SVGElement* aSVGElement, SVGViewportElement* aCtx) : mSVGElement(aSVGElement), mCtx(aCtx) {} @@ -173,7 +173,7 @@ float UserSpaceMetricsWithSize::GetAxisLength(uint8_t aCtxType) const { return FixAxisLength(length); } -float nsSVGLength2::GetPixelsPerUnit(nsSVGElement* aSVGElement, +float nsSVGLength2::GetPixelsPerUnit(SVGElement* aSVGElement, uint8_t aUnitType) const { return GetPixelsPerUnit(SVGElementMetrics(aSVGElement), aUnitType); } @@ -188,7 +188,7 @@ float nsSVGLength2::GetPixelsPerUnit(nsIFrame* aFrame, nsIContent* content = aFrame->GetContent(); if (content->IsSVGElement()) { return GetPixelsPerUnit( - SVGElementMetrics(static_cast(content)), aUnitType); + SVGElementMetrics(static_cast(content)), aUnitType); } return GetPixelsPerUnit(NonSVGFrameUserSpaceMetrics(aFrame), aUnitType); } @@ -225,7 +225,7 @@ float nsSVGLength2::GetPixelsPerUnit(const UserSpaceMetrics& aMetrics, } void nsSVGLength2::SetBaseValueInSpecifiedUnits(float aValue, - nsSVGElement* aSVGElement, + SVGElement* aSVGElement, bool aDoSetAttr) { if (mIsBaseSet && mBaseVal == aValue) { return; @@ -248,7 +248,7 @@ void nsSVGLength2::SetBaseValueInSpecifiedUnits(float aValue, } nsresult nsSVGLength2::ConvertToSpecifiedUnits(uint16_t unitType, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; if (mIsBaseSet && mSpecifiedUnitType == uint8_t(unitType)) return NS_OK; @@ -284,7 +284,7 @@ nsresult nsSVGLength2::ConvertToSpecifiedUnits(uint16_t unitType, nsresult nsSVGLength2::NewValueSpecifiedUnits(uint16_t unitType, float valueInSpecifiedUnits, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { NS_ENSURE_FINITE(valueInSpecifiedUnits, NS_ERROR_ILLEGAL_VALUE); if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; @@ -308,7 +308,7 @@ nsresult nsSVGLength2::NewValueSpecifiedUnits(uint16_t unitType, } nsresult nsSVGLength2::ToDOMBaseVal(DOMSVGLength** aResult, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domBaseVal = DOMSVGLength::GetTearOff(this, aSVGElement, false); @@ -317,7 +317,7 @@ nsresult nsSVGLength2::ToDOMBaseVal(DOMSVGLength** aResult, } nsresult nsSVGLength2::ToDOMAnimVal(DOMSVGLength** aResult, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimVal = DOMSVGLength::GetTearOff(this, aSVGElement, true); @@ -328,7 +328,7 @@ nsresult nsSVGLength2::ToDOMAnimVal(DOMSVGLength** aResult, /* Implementation */ nsresult nsSVGLength2::SetBaseValueString(const nsAString& aValueAsString, - nsSVGElement* aSVGElement, + SVGElement* aSVGElement, bool aDoSetAttr) { float value; uint16_t unitType; @@ -369,7 +369,7 @@ void nsSVGLength2::GetAnimValueString(nsAString& aValueAsString) const { GetValueString(aValueAsString, mAnimVal, mSpecifiedUnitType); } -nsresult nsSVGLength2::SetBaseValue(float aValue, nsSVGElement* aSVGElement, +nsresult nsSVGLength2::SetBaseValue(float aValue, SVGElement* aSVGElement, bool aDoSetAttr) { float pixelsPerUnit = GetPixelsPerUnit(aSVGElement, mSpecifiedUnitType); if (pixelsPerUnit == 0.0f) { @@ -386,7 +386,7 @@ nsresult nsSVGLength2::SetBaseValue(float aValue, nsSVGElement* aSVGElement, } void nsSVGLength2::SetAnimValueInSpecifiedUnits(float aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mAnimVal == aValue && mIsAnimated) { return; } @@ -395,7 +395,7 @@ void nsSVGLength2::SetAnimValueInSpecifiedUnits(float aValue, aSVGElement->DidAnimateLength(mAttrEnum); } -nsresult nsSVGLength2::SetAnimValue(float aValue, nsSVGElement* aSVGElement) { +nsresult nsSVGLength2::SetAnimValue(float aValue, SVGElement* aSVGElement) { float valueInSpecifiedUnits = aValue / GetPixelsPerUnit(aSVGElement, mSpecifiedUnitType); @@ -407,7 +407,7 @@ nsresult nsSVGLength2::SetAnimValue(float aValue, nsSVGElement* aSVGElement) { } already_AddRefed nsSVGLength2::ToDOMAnimatedLength( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr svgAnimatedLength = sSVGAnimatedLengthTearoffTable.GetTearoff(this); if (!svgAnimatedLength) { @@ -422,7 +422,7 @@ SVGAnimatedLength::~SVGAnimatedLength() { sSVGAnimatedLengthTearoffTable.RemoveTearoff(mVal); } -UniquePtr nsSVGLength2::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGLength2::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGLength2.h b/dom/svg/nsSVGLength2.h index e551c10faecd..285862c61ec2 100644 --- a/dom/svg/nsSVGLength2.h +++ b/dom/svg/nsSVGLength2.h @@ -15,7 +15,7 @@ #include "nsError.h" #include "nsISMILAttr.h" #include "nsMathUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "SVGContentUtils.h" #include "mozilla/gfx/Rect.h" @@ -51,9 +51,10 @@ class UserSpaceMetricsWithSize : public UserSpaceMetrics { class SVGElementMetrics : public UserSpaceMetrics { public: + typedef mozilla::dom::SVGElement SVGElement; typedef mozilla::dom::SVGViewportElement SVGViewportElement; - explicit SVGElementMetrics(nsSVGElement* aSVGElement, + explicit SVGElementMetrics(SVGElement* aSVGElement, SVGViewportElement* aCtx = nullptr); virtual float GetEmLength() const override; @@ -63,7 +64,7 @@ class SVGElementMetrics : public UserSpaceMetrics { private: bool EnsureCtx() const; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; mutable SVGViewportElement* mCtx; }; @@ -86,7 +87,9 @@ class nsSVGLength2 { friend class mozilla::dom::SVGAnimatedLength; friend class mozilla::DOMSVGLength; typedef mozilla::dom::UserSpaceMetrics UserSpaceMetrics; + typedef mozilla::dom::SVGElement SVGElement; typedef mozilla::dom::SVGViewportElement SVGViewportElement; + typedef mozilla::SVGContentUtils SVGContentUtils; public: void Init(uint8_t aCtxType = mozilla::SVGContentUtils::XY, @@ -110,16 +113,16 @@ class nsSVGLength2 { return *this; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement, + bool aDoSetAttr); void GetBaseValueString(nsAString& aValue) const; void GetAnimValueString(nsAString& aValue) const; - float GetBaseValue(nsSVGElement* aSVGElement) const { + float GetBaseValue(SVGElement* aSVGElement) const { return mBaseVal * GetPixelsPerUnit(aSVGElement, mSpecifiedUnitType); } - float GetAnimValue(nsSVGElement* aSVGElement) const { + float GetAnimValue(SVGElement* aSVGElement) const { return mAnimVal * GetPixelsPerUnit(aSVGElement, mSpecifiedUnitType); } float GetAnimValue(nsIFrame* aFrame) const { @@ -154,9 +157,9 @@ class nsSVGLength2 { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedLength( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: float mAnimVal; @@ -172,7 +175,7 @@ class nsSVGLength2 { float GetPixelsPerUnit(nsIFrame* aFrame, uint8_t aUnitType) const; float GetPixelsPerUnit(const UserSpaceMetrics& aMetrics, uint8_t aUnitType) const; - float GetPixelsPerUnit(nsSVGElement* aSVGElement, uint8_t aUnitType) const; + float GetPixelsPerUnit(SVGElement* aSVGElement, uint8_t aUnitType) const; float GetPixelsPerUnit(SVGViewportElement* aCtx, uint8_t aUnitType) const; // SetBaseValue and SetAnimValue set the value in user units. This may fail @@ -180,32 +183,30 @@ class nsSVGLength2 { // font-size is 0. // SetBaseValueInSpecifiedUnits and SetAnimValueInSpecifiedUnits do not // perform unit conversion and are therefore infallible. - nsresult SetBaseValue(float aValue, nsSVGElement* aSVGElement, - bool aDoSetAttr); - void SetBaseValueInSpecifiedUnits(float aValue, nsSVGElement* aSVGElement, + nsresult SetBaseValue(float aValue, SVGElement* aSVGElement, bool aDoSetAttr); + void SetBaseValueInSpecifiedUnits(float aValue, SVGElement* aSVGElement, bool aDoSetAttr); - nsresult SetAnimValue(float aValue, nsSVGElement* aSVGElement); - void SetAnimValueInSpecifiedUnits(float aValue, nsSVGElement* aSVGElement); + nsresult SetAnimValue(float aValue, SVGElement* aSVGElement); + void SetAnimValueInSpecifiedUnits(float aValue, SVGElement* aSVGElement); nsresult NewValueSpecifiedUnits(uint16_t aUnitType, float aValue, - nsSVGElement* aSVGElement); - nsresult ConvertToSpecifiedUnits(uint16_t aUnitType, - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + nsresult ConvertToSpecifiedUnits(uint16_t aUnitType, SVGElement* aSVGElement); nsresult ToDOMBaseVal(mozilla::DOMSVGLength** aResult, - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); nsresult ToDOMAnimVal(mozilla::DOMSVGLength** aResult, - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); public: struct SMILLength : public nsISMILAttr { public: - SMILLength(nsSVGLength2* aVal, nsSVGElement* aSVGElement) + SMILLength(nsSVGLength2* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGLength2* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGNumber2.cpp b/dom/svg/nsSVGNumber2.cpp index 6ecd119da50e..9af2c27c40a9 100644 --- a/dom/svg/nsSVGNumber2.cpp +++ b/dom/svg/nsSVGNumber2.cpp @@ -42,7 +42,7 @@ static bool GetValueFromString(const nsAString& aString, } nsresult nsSVGNumber2::SetBaseValueString(const nsAString& aValueAsString, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { float val; if (!GetValueFromString(aValueAsString, @@ -60,7 +60,7 @@ nsresult nsSVGNumber2::SetBaseValueString(const nsAString& aValueAsString, } // We don't need to call DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. return NS_OK; } @@ -70,7 +70,7 @@ void nsSVGNumber2::GetBaseValueString(nsAString& aValueAsString) { aValueAsString.AppendFloat(mBaseVal); } -void nsSVGNumber2::SetBaseValue(float aValue, nsSVGElement* aSVGElement) { +void nsSVGNumber2::SetBaseValue(float aValue, SVGElement* aSVGElement) { if (mIsBaseSet && aValue == mBaseVal) { return; } @@ -85,7 +85,7 @@ void nsSVGNumber2::SetBaseValue(float aValue, nsSVGElement* aSVGElement) { aSVGElement->DidChangeNumber(mAttrEnum); } -void nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement* aSVGElement) { +void nsSVGNumber2::SetAnimValue(float aValue, SVGElement* aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -95,7 +95,7 @@ void nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement* aSVGElement) { } already_AddRefed nsSVGNumber2::ToDOMAnimatedNumber( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedNumber = sSVGAnimatedNumberTearoffTable.GetTearoff(this); if (!domAnimatedNumber) { @@ -110,7 +110,7 @@ nsSVGNumber2::DOMAnimatedNumber::~DOMAnimatedNumber() { sSVGAnimatedNumberTearoffTable.RemoveTearoff(mVal); } -UniquePtr nsSVGNumber2::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGNumber2::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGNumber2.h b/dom/svg/nsSVGNumber2.h index 93ac23dd08fa..750fb0a8fb41 100644 --- a/dom/svg/nsSVGNumber2.h +++ b/dom/svg/nsSVGNumber2.h @@ -11,7 +11,7 @@ #include "nsError.h" #include "nsISMILAttr.h" #include "nsMathUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/FloatingPoint.h" #include "mozilla/dom/SVGAnimatedNumber.h" @@ -27,6 +27,8 @@ class SVGAnimationElement; class nsSVGNumber2 { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(uint8_t aAttrEnum = 0xff, float aValue = 0) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; @@ -34,13 +36,12 @@ class nsSVGNumber2 { mIsBaseSet = false; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(float aValue, nsSVGElement* aSVGElement); + void SetBaseValue(float aValue, SVGElement* aSVGElement); float GetBaseValue() const { return mBaseVal; } - void SetAnimValue(float aValue, nsSVGElement* aSVGElement); + void SetAnimValue(float aValue, SVGElement* aSVGElement); float GetAnimValue() const { return mAnimVal; } // Returns true if the animated value of this number has been explicitly @@ -51,8 +52,8 @@ class nsSVGNumber2 { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedNumber( - nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: float mAnimVal; @@ -63,7 +64,7 @@ class nsSVGNumber2 { public: struct DOMAnimatedNumber final : public mozilla::dom::SVGAnimatedNumber { - DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement* aSVGElement) + DOMAnimatedNumber(nsSVGNumber2* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedNumber(aSVGElement), mVal(aVal) {} virtual ~DOMAnimatedNumber(); @@ -85,14 +86,14 @@ class nsSVGNumber2 { struct SMILNumber : public nsISMILAttr { public: - SMILNumber(nsSVGNumber2* aVal, nsSVGElement* aSVGElement) + SMILNumber(nsSVGNumber2* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGNumber2* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGNumberPair.cpp b/dom/svg/nsSVGNumberPair.cpp index 6add6a16ff06..98a6205ce6fc 100644 --- a/dom/svg/nsSVGNumberPair.cpp +++ b/dom/svg/nsSVGNumberPair.cpp @@ -50,7 +50,7 @@ static nsresult ParseNumberOptionalNumber(const nsAString& aValue, } nsresult nsSVGNumberPair::SetBaseValueString(const nsAString& aValueAsString, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { float val[2]; nsresult rv = ParseNumberOptionalNumber(aValueAsString, val); @@ -69,7 +69,7 @@ nsresult nsSVGNumberPair::SetBaseValueString(const nsAString& aValueAsString, } // We don't need to call Will/DidChange* here - we're only called by - // nsSVGElement::ParseAttribute under Element::SetAttr, + // SVGElement::ParseAttribute under Element::SetAttr, // which takes care of notifying. return NS_OK; } @@ -84,7 +84,7 @@ void nsSVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const { } void nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { uint32_t index = (aPairIndex == eFirst ? 0 : 1); if (mIsBaseSet && mBaseVal[index] == aValue) { return; @@ -101,7 +101,7 @@ void nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, } void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) { return; } @@ -119,7 +119,7 @@ void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2, } void nsSVGNumberPair::SetAnimValue(const float aValue[2], - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) { return; } @@ -130,7 +130,7 @@ void nsSVGNumberPair::SetAnimValue(const float aValue[2], } already_AddRefed nsSVGNumberPair::ToDOMAnimatedNumber( - PairIndex aIndex, nsSVGElement* aSVGElement) { + PairIndex aIndex, SVGElement* aSVGElement) { RefPtr domAnimatedNumber = aIndex == eFirst ? sSVGFirstAnimatedNumberTearoffTable.GetTearoff(this) : sSVGSecondAnimatedNumberTearoffTable.GetTearoff(this); @@ -154,7 +154,7 @@ nsSVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() { } } -UniquePtr nsSVGNumberPair::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGNumberPair.h b/dom/svg/nsSVGNumberPair.h index 045b5f061824..cb75812bca74 100644 --- a/dom/svg/nsSVGNumberPair.h +++ b/dom/svg/nsSVGNumberPair.h @@ -11,7 +11,7 @@ #include "nsError.h" #include "nsISMILAttr.h" #include "nsMathUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGAnimatedNumber.h" #include "mozilla/FloatingPoint.h" @@ -27,6 +27,8 @@ class SVGAnimationElement; class nsSVGNumberPair { public: + typedef mozilla::dom::SVGElement SVGElement; + enum PairIndex { eFirst, eSecond }; void Init(uint8_t aAttrEnum = 0xff, float aValue1 = 0, float aValue2 = 0) { @@ -37,16 +39,15 @@ class nsSVGNumberPair { mIsBaseSet = false; } - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement); void GetBaseValueString(nsAString& aValue) const; - void SetBaseValue(float aValue, PairIndex aIndex, nsSVGElement* aSVGElement); - void SetBaseValues(float aValue1, float aValue2, nsSVGElement* aSVGElement); + void SetBaseValue(float aValue, PairIndex aIndex, SVGElement* aSVGElement); + void SetBaseValues(float aValue1, float aValue2, SVGElement* aSVGElement); float GetBaseValue(PairIndex aIndex) const { return mBaseVal[aIndex == eFirst ? 0 : 1]; } - void SetAnimValue(const float aValue[2], nsSVGElement* aSVGElement); + void SetAnimValue(const float aValue[2], SVGElement* aSVGElement); float GetAnimValue(PairIndex aIndex) const { return mAnimVal[aIndex == eFirst ? 0 : 1]; } @@ -59,8 +60,8 @@ class nsSVGNumberPair { bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } already_AddRefed ToDOMAnimatedNumber( - PairIndex aIndex, nsSVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + PairIndex aIndex, SVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: float mAnimVal[2]; @@ -72,7 +73,7 @@ class nsSVGNumberPair { public: struct DOMAnimatedNumber final : public mozilla::dom::SVGAnimatedNumber { DOMAnimatedNumber(nsSVGNumberPair* aVal, PairIndex aIndex, - nsSVGElement* aSVGElement) + SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedNumber(aSVGElement), mVal(aVal), mIndex(aIndex) {} @@ -97,14 +98,14 @@ class nsSVGNumberPair { struct SMILNumberPair : public nsISMILAttr { public: - SMILNumberPair(nsSVGNumberPair* aVal, nsSVGElement* aSVGElement) + SMILNumberPair(nsSVGNumberPair* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGNumberPair* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGString.cpp b/dom/svg/nsSVGString.cpp index a247929c7b8d..0f5feaa2f732 100644 --- a/dom/svg/nsSVGString.cpp +++ b/dom/svg/nsSVGString.cpp @@ -35,8 +35,8 @@ SVGAnimatedStringTearoffTable() { /* Implementation */ -void nsSVGString::SetBaseValue(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr) { +void nsSVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, + bool aDoSetAttr) { NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue"); mIsBaseSet = true; @@ -51,7 +51,7 @@ void nsSVGString::SetBaseValue(const nsAString& aValue, } void nsSVGString::GetAnimValue(nsAString& aResult, - const nsSVGElement* aSVGElement) const { + const SVGElement* aSVGElement) const { if (mAnimVal) { aResult = *mAnimVal; return; @@ -61,7 +61,7 @@ void nsSVGString::GetAnimValue(nsAString& aResult, } void nsSVGString::SetAnimValue(const nsAString& aValue, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (aSVGElement->IsStringAnimatable(mAttrEnum)) { if (mAnimVal && mAnimVal->Equals(aValue)) { return; @@ -75,7 +75,7 @@ void nsSVGString::SetAnimValue(const nsAString& aValue, } already_AddRefed nsSVGString::ToDOMAnimatedString( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedString = SVGAnimatedStringTearoffTable().GetTearoff(this); if (!domAnimatedString) { @@ -90,7 +90,7 @@ nsSVGString::DOMAnimatedString::~DOMAnimatedString() { SVGAnimatedStringTearoffTable().RemoveTearoff(mVal); } -UniquePtr nsSVGString::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGString::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGString.h b/dom/svg/nsSVGString.h index a958a1c4adba..f1f470eb60fe 100644 --- a/dom/svg/nsSVGString.h +++ b/dom/svg/nsSVGString.h @@ -9,27 +9,29 @@ #include "nsAutoPtr.h" #include "nsError.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/dom/SVGAnimatedString.h" #include "mozilla/UniquePtr.h" class nsSVGString { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(uint8_t aAttrEnum) { mAnimVal = nullptr; mAttrEnum = aAttrEnum; mIsBaseSet = false; } - void SetBaseValue(const nsAString& aValue, nsSVGElement* aSVGElement, + void SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement, bool aDoSetAttr); - void GetBaseValue(nsAString& aValue, const nsSVGElement* aSVGElement) const { + void GetBaseValue(nsAString& aValue, const SVGElement* aSVGElement) const { aSVGElement->GetStringBaseValue(mAttrEnum, aValue); } - void SetAnimValue(const nsAString& aValue, nsSVGElement* aSVGElement); - void GetAnimValue(nsAString& aValue, const nsSVGElement* aSVGElement) const; + void SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement); + void GetAnimValue(nsAString& aValue, const SVGElement* aSVGElement) const; // Returns true if the animated value of this string has been explicitly // set (either by animation, or by taking on the base value which has been @@ -39,9 +41,9 @@ class nsSVGString { bool IsExplicitlySet() const { return !!mAnimVal || mIsBaseSet; } already_AddRefed ToDOMAnimatedString( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: nsAutoPtr mAnimVal; @@ -53,7 +55,7 @@ class nsSVGString { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString) - DOMAnimatedString(nsSVGString* aVal, nsSVGElement* aSVGElement) + DOMAnimatedString(nsSVGString* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGAnimatedString(aSVGElement), mVal(aVal) {} nsSVGString* mVal; // kept alive because it belongs to content @@ -76,14 +78,14 @@ class nsSVGString { }; struct SMILString : public nsISMILAttr { public: - SMILString(nsSVGString* aVal, nsSVGElement* aSVGElement) + SMILString(nsSVGString* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGString* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/dom/svg/nsSVGViewBox.cpp b/dom/svg/nsSVGViewBox.cpp index 865aaca64781..88386ecadea5 100644 --- a/dom/svg/nsSVGViewBox.cpp +++ b/dom/svg/nsSVGViewBox.cpp @@ -116,7 +116,7 @@ bool nsSVGViewBox::HasRect() const { } void nsSVGViewBox::SetAnimValue(const nsSVGViewBoxRect& aRect, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (!mAnimVal) { // it's okay if allocation fails - and no point in reporting that mAnimVal = new nsSVGViewBoxRect(aRect); @@ -130,7 +130,7 @@ void nsSVGViewBox::SetAnimValue(const nsSVGViewBoxRect& aRect, } void nsSVGViewBox::SetBaseValue(const nsSVGViewBoxRect& aRect, - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (!mHasBaseVal || mBaseVal == aRect) { // This method is used to set a single x, y, width // or height value. It can't create a base value @@ -152,7 +152,7 @@ void nsSVGViewBox::SetBaseValue(const nsSVGViewBoxRect& aRect, } nsresult nsSVGViewBox::SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement, + SVGElement* aSVGElement, bool aDoSetAttr) { nsSVGViewBoxRect viewBox; @@ -192,7 +192,7 @@ void nsSVGViewBox::GetBaseValueString(nsAString& aValue) const { } already_AddRefed nsSVGViewBox::ToSVGAnimatedRect( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { RefPtr domAnimatedRect = sSVGAnimatedRectTearoffTable.GetTearoff(this); if (!domAnimatedRect) { @@ -204,7 +204,7 @@ already_AddRefed nsSVGViewBox::ToSVGAnimatedRect( } already_AddRefed nsSVGViewBox::ToDOMBaseVal( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if (!mHasBaseVal || mBaseVal.none) { return nullptr; } @@ -223,7 +223,7 @@ nsSVGViewBox::DOMBaseVal::~DOMBaseVal() { } already_AddRefed nsSVGViewBox::ToDOMAnimVal( - nsSVGElement* aSVGElement) { + SVGElement* aSVGElement) { if ((mAnimVal && mAnimVal->none) || (!mAnimVal && (!mHasBaseVal || mBaseVal.none))) { return nullptr; @@ -266,7 +266,7 @@ void nsSVGViewBox::DOMBaseVal::SetHeight(float aHeight, ErrorResult& aRv) { mVal->SetBaseValue(rect, mSVGElement); } -UniquePtr nsSVGViewBox::ToSMILAttr(nsSVGElement* aSVGElement) { +UniquePtr nsSVGViewBox::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } diff --git a/dom/svg/nsSVGViewBox.h b/dom/svg/nsSVGViewBox.h index bb1a24252711..cb4083fe05c2 100644 --- a/dom/svg/nsSVGViewBox.h +++ b/dom/svg/nsSVGViewBox.h @@ -13,7 +13,7 @@ #include "mozilla/dom/SVGAnimatedRect.h" #include "mozilla/dom/SVGIRect.h" #include "nsISMILAttr.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/Attributes.h" #include "mozilla/UniquePtr.h" #include "nsSVGAttrTearoffTable.h" @@ -47,6 +47,8 @@ struct nsSVGViewBoxRect { class nsSVGViewBox { public: + typedef mozilla::dom::SVGElement SVGElement; + void Init(); /** @@ -71,26 +73,26 @@ class nsSVGViewBox { } const nsSVGViewBoxRect& GetBaseValue() const { return mBaseVal; } - void SetBaseValue(const nsSVGViewBoxRect& aRect, nsSVGElement* aSVGElement); + void SetBaseValue(const nsSVGViewBoxRect& aRect, SVGElement* aSVGElement); const nsSVGViewBoxRect& GetAnimValue() const { return mAnimVal ? *mAnimVal : mBaseVal; } - void SetAnimValue(const nsSVGViewBoxRect& aRect, nsSVGElement* aSVGElement); + void SetAnimValue(const nsSVGViewBoxRect& aRect, SVGElement* aSVGElement); - nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement* aSVGElement, bool aDoSetAttr); + nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement, + bool aDoSetAttr); void GetBaseValueString(nsAString& aValue) const; already_AddRefed ToSVGAnimatedRect( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); already_AddRefed ToDOMBaseVal( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); already_AddRefed ToDOMAnimVal( - nsSVGElement* aSVGElement); + SVGElement* aSVGElement); - mozilla::UniquePtr ToSMILAttr(nsSVGElement* aSVGElement); + mozilla::UniquePtr ToSMILAttr(SVGElement* aSVGElement); private: nsSVGViewBoxRect mBaseVal; @@ -102,11 +104,11 @@ class nsSVGViewBox { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMBaseVal) - DOMBaseVal(nsSVGViewBox* aVal, nsSVGElement* aSVGElement) + DOMBaseVal(nsSVGViewBox* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {} nsSVGViewBox* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; float X() const final { return mVal->GetBaseValue().x; } @@ -131,11 +133,11 @@ class nsSVGViewBox { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimVal) - DOMAnimVal(nsSVGViewBox* aVal, nsSVGElement* aSVGElement) + DOMAnimVal(nsSVGViewBox* aVal, SVGElement* aSVGElement) : mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {} nsSVGViewBox* mVal; // kept alive because it belongs to content - RefPtr mSVGElement; + RefPtr mSVGElement; // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. @@ -183,14 +185,14 @@ class nsSVGViewBox { struct SMILViewBox : public nsISMILAttr { public: - SMILViewBox(nsSVGViewBox* aVal, nsSVGElement* aSVGElement) + SMILViewBox(nsSVGViewBox* aVal, SVGElement* aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} // These will stay alive because a nsISMILAttr only lives as long // as the Compositing step, and DOM elements don't get a chance to // die during that. nsSVGViewBox* mVal; - nsSVGElement* mSVGElement; + SVGElement* mSVGElement; // nsISMILAttr methods virtual nsresult ValueFromString( diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 3c5a229539ef..d8a5e77b0d27 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -9438,7 +9438,7 @@ static nsRect ComputeSVGReferenceRect(nsIFrame* aFrame, } case StyleGeometryBox::ViewBox: { nsIContent* content = aFrame->GetContent(); - nsSVGElement* element = static_cast(content); + SVGElement* element = static_cast(content); SVGViewportElement* svgElement = element->GetCtx(); MOZ_ASSERT(svgElement); diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 582d574c9af2..96ab7a6a6828 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -24,6 +24,7 @@ #include "mozilla/dom/Selection.h" #include "mozilla/dom/ServiceWorkerRegistrar.h" #include "mozilla/dom/ServiceWorkerRegistration.h" +#include "mozilla/dom/SVGElement.h" #include "mozilla/gfx/2D.h" #include "mozilla/layers/PLayerTransaction.h" #include "mozilla/ShapeUtils.h" @@ -53,7 +54,6 @@ #include "nsImageFrame.h" #include "nsSubDocumentFrame.h" #include "SVGObserverUtils.h" -#include "nsSVGElement.h" #include "nsSVGClipPathFrame.h" #include "GeckoProfiler.h" #include "nsViewManager.h" @@ -8563,7 +8563,7 @@ bool nsDisplayEffectsBase::ValidateSVGFrame() { NS_ASSERTION(false, "why?"); return false; } - if (!static_cast(content)->HasValidDimensions()) { + if (!static_cast(content)->HasValidDimensions()) { return false; // The SVG spec says not to draw filters for this } } diff --git a/layout/style/GeckoBindings.cpp b/layout/style/GeckoBindings.cpp index c7d4d60be89e..f7aa4ed1f7d5 100644 --- a/layout/style/GeckoBindings.cpp +++ b/layout/style/GeckoBindings.cpp @@ -43,7 +43,6 @@ #include "nsString.h" #include "nsStyleStruct.h" #include "nsStyleUtil.h" -#include "nsSVGElement.h" #include "nsTArray.h" #include "nsTransitionManager.h" #include "nsWindowSizes.h" @@ -73,6 +72,7 @@ #include "mozilla/dom/HTMLBodyElement.h" #include "mozilla/dom/HTMLSlotElement.h" #include "mozilla/dom/MediaList.h" +#include "mozilla/dom/SVGElement.h" #include "mozilla/LookAndFeel.h" #include "mozilla/URLExtraData.h" #include "mozilla/dom/CSSMozDocumentRule.h" @@ -383,7 +383,7 @@ Gecko_GetHTMLPresentationAttrDeclarationBlock( RawGeckoElementBorrowed aElement) { const nsMappedAttributes* attrs = aElement->GetMappedAttributes(); if (!attrs) { - auto* svg = nsSVGElement::FromNodeOrNull(aElement); + auto* svg = SVGElement::FromNodeOrNull(aElement); if (svg) { if (auto decl = svg->GetContentDeclarationBlock()) { return decl->RefRawStrong(); @@ -2342,7 +2342,7 @@ bool Gecko_IsMainThread() { return NS_IsMainThread(); } const nsAttrValue* Gecko_GetSVGAnimatedClass(RawGeckoElementBorrowed aElement) { MOZ_ASSERT(aElement->IsSVGElement()); - return static_cast(aElement)->GetAnimatedClassName(); + return static_cast(aElement)->GetAnimatedClassName(); } bool Gecko_AssertClassAttrValueIsSane(const nsAttrValue* aValue) { diff --git a/layout/svg/SVGGeometryFrame.cpp b/layout/svg/SVGGeometryFrame.cpp index 35a2291c8ca3..1d4b84cc5058 100644 --- a/layout/svg/SVGGeometryFrame.cpp +++ b/layout/svg/SVGGeometryFrame.cpp @@ -214,7 +214,7 @@ bool SVGGeometryFrame::IsSVGTransformed( aFromParentTransform); } - nsSVGElement* content = static_cast(GetContent()); + SVGElement* content = static_cast(GetContent()); nsSVGAnimatedTransformList* transformList = content->GetAnimatedTransformList(); if ((transformList && transformList->HasTransform()) || @@ -230,7 +230,7 @@ bool SVGGeometryFrame::IsSVGTransformed( void SVGGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) { - if (!static_cast(GetContent())->HasValidDimensions() || + if (!static_cast(GetContent())->HasValidDimensions() || (!IsVisibleForPainting() && aBuilder->IsForPainting())) { return; } @@ -731,9 +731,9 @@ void SVGGeometryFrame::Render(gfxContext* aContext, uint32_t aRenderComponents, if (strokePattern.GetPattern()) { SVGContentUtils::AutoStrokeOptions strokeOptions; - SVGContentUtils::GetStrokeOptions( - &strokeOptions, static_cast(GetContent()), Style(), - contextPaint); + SVGContentUtils::GetStrokeOptions(&strokeOptions, + static_cast(GetContent()), + Style(), contextPaint); // GetStrokeOptions may set the line width to zero as an optimization if (strokeOptions.mLineWidth <= 0) { return; diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 9368b75775b4..515016ed1621 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -2795,8 +2795,8 @@ void SVGTextDrawPathCallbacks::StrokeGeometry() { MOZ_ASSERT(false, "Our nsTextFrame's parent's content should be SVG"); return; } - nsSVGElement* svgOwner = - static_cast(mFrame->GetParent()->GetContent()); + SVGElement* svgOwner = + static_cast(mFrame->GetParent()->GetContent()); // Apply any stroke-specific transform gfxMatrix outerSVGToUser; @@ -4247,7 +4247,7 @@ bool SVGTextFrame::ResolvePositionsForNode(nsIContent* aContent, MOZ_ASSERT(aContent->IsSVGElement()); // We have a text content element that can have x/y/dx/dy/rotate attributes. - nsSVGElement* element = static_cast(aContent); + SVGElement* element = static_cast(aContent); // Get x, y, dx, dy. SVGUserUnitList x, y, dx, dy; @@ -5006,7 +5006,7 @@ bool SVGTextFrame::ShouldRenderAsPath(nsTextFrame* aFrame, // Text has a stroke. if (style->HasStroke() && - SVGContentUtils::CoordToFloat(static_cast(GetContent()), + SVGContentUtils::CoordToFloat(static_cast(GetContent()), style->mStrokeWidth) > 0) { return true; } diff --git a/layout/svg/nsCSSClipPathInstance.cpp b/layout/svg/nsCSSClipPathInstance.cpp index a83595fb52f3..dbfc05be3dad 100644 --- a/layout/svg/nsCSSClipPathInstance.cpp +++ b/layout/svg/nsCSSClipPathInstance.cpp @@ -17,7 +17,7 @@ #include "nsCSSRendering.h" #include "nsIFrame.h" #include "nsLayoutUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGUtils.h" #include "nsSVGViewBox.h" diff --git a/layout/svg/nsFilterInstance.cpp b/layout/svg/nsFilterInstance.cpp index b7f9d83ca9dc..7e96ac5a847b 100644 --- a/layout/svg/nsFilterInstance.cpp +++ b/layout/svg/nsFilterInstance.cpp @@ -49,7 +49,7 @@ FilterDescription nsFilterInstance::GetFilterDescription( static UniquePtr UserSpaceMetricsForFrame(nsIFrame* aFrame) { if (aFrame->GetContent()->IsSVGElement()) { - nsSVGElement* element = static_cast(aFrame->GetContent()); + SVGElement* element = static_cast(aFrame->GetContent()); return MakeUnique(element); } return MakeUnique(aFrame); diff --git a/layout/svg/nsSVGClipPathFrame.cpp b/layout/svg/nsSVGClipPathFrame.cpp index 04d2f8766677..a85292042921 100644 --- a/layout/svg/nsSVGClipPathFrame.cpp +++ b/layout/svg/nsSVGClipPathFrame.cpp @@ -216,7 +216,7 @@ void nsSVGClipPathFrame::PaintFrameIntoMask(nsIFrame* aFrame, nsIContent* childContent = child->GetContent(); if (childContent->IsSVGElement()) { toChildsUserSpace = - static_cast(childContent) + static_cast(childContent) ->PrependLocalTransformsTo(mMatrixForChildren, eUserSpaceToParent); } @@ -298,7 +298,7 @@ bool nsSVGClipPathFrame::PointIsInsideClipPath(nsIFrame* aClippedFrame, if (SVGFrame) { gfxPoint pointForChild = point; gfxMatrix m = - static_cast(kid->GetContent()) + static_cast(kid->GetContent()) ->PrependLocalTransformsTo(gfxMatrix(), eUserSpaceToParent); if (!m.IsIdentity()) { if (!m.Invert()) { @@ -453,7 +453,7 @@ SVGBBox nsSVGClipPathFrame::GetBBoxForClipPathFrame(const SVGBBox& aBBox, nsIContent* node = GetContent()->GetFirstChild(); SVGBBox unionBBox, tmpBBox; for (; node; node = node->GetNextSibling()) { - nsSVGElement* svgNode = static_cast(node); + SVGElement* svgNode = static_cast(node); nsIFrame* frame = svgNode->GetPrimaryFrame(); if (frame) { nsSVGDisplayableFrame* svg = do_QueryFrame(frame); diff --git a/layout/svg/nsSVGContainerFrame.cpp b/layout/svg/nsSVGContainerFrame.cpp index 09f8b8eb8da1..8efa0c5749e4 100644 --- a/layout/svg/nsSVGContainerFrame.cpp +++ b/layout/svg/nsSVGContainerFrame.cpp @@ -12,7 +12,7 @@ #include "mozilla/RestyleManager.h" #include "nsCSSFrameConstructor.h" #include "SVGObserverUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGUtils.h" #include "nsSVGAnimatedTransformList.h" #include "SVGTextFrame.h" @@ -133,7 +133,7 @@ void nsSVGDisplayContainerFrame::BuildDisplayList( nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) { // mContent could be a XUL element so check for an SVG element before casting if (mContent->IsSVGElement() && - !static_cast(GetContent())->HasValidDimensions()) { + !static_cast(GetContent())->HasValidDimensions()) { return; } DisplayOutline(aBuilder, aLists); @@ -208,7 +208,7 @@ bool nsSVGDisplayContainerFrame::IsSVGTransformed( // mContent could be a XUL element so check for an SVG element before casting if (mContent->IsSVGElement()) { - nsSVGElement* content = static_cast(GetContent()); + SVGElement* content = static_cast(GetContent()); nsSVGAnimatedTransformList* transformList = content->GetAnimatedTransformList(); if ((transformList && transformList->HasTransform()) || @@ -242,7 +242,7 @@ void nsSVGDisplayContainerFrame::PaintSVG(gfxContext& aContext, gfxMatrix matrix = aTransform; if (GetContent()->IsSVGElement()) { // must check before cast - matrix = static_cast(GetContent()) + matrix = static_cast(GetContent()) ->PrependLocalTransformsTo(matrix, eChildToUserSpace); if (matrix.IsSingular()) { return; @@ -255,7 +255,7 @@ void nsSVGDisplayContainerFrame::PaintSVG(gfxContext& aContext, // include the transform to the passed frame's user space, so add it: const nsIContent* content = kid->GetContent(); if (content->IsSVGElement()) { // must check before cast - const nsSVGElement* element = static_cast(content); + const SVGElement* element = static_cast(content); if (!element->HasValidDimensions()) { continue; // nothing to paint for kid } @@ -385,12 +385,11 @@ SVGBBox nsSVGDisplayContainerFrame::GetBBoxContribution( // content could be a XUL element so check for an SVG element before casting if (svgKid && (!content->IsSVGElement() || - static_cast(content)->HasValidDimensions())) { + static_cast(content)->HasValidDimensions())) { gfxMatrix transform = gfx::ThebesMatrix(aToBBoxUserspace); if (content->IsSVGElement()) { - transform = - static_cast(content)->PrependLocalTransformsTo( - transform); + transform = static_cast(content)->PrependLocalTransformsTo( + transform); } // We need to include zero width/height vertical/horizontal lines, so we // have to use UnionEdges. @@ -409,7 +408,7 @@ gfxMatrix nsSVGDisplayContainerFrame::GetCanvasTM() { nsSVGContainerFrame* parent = static_cast(GetParent()); - nsSVGElement* content = static_cast(GetContent()); + SVGElement* content = static_cast(GetContent()); gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM()); diff --git a/layout/svg/nsSVGFilterFrame.cpp b/layout/svg/nsSVGFilterFrame.cpp index d8f20a079d18..1ee14187eab5 100644 --- a/layout/svg/nsSVGFilterFrame.cpp +++ b/layout/svg/nsSVGFilterFrame.cpp @@ -12,7 +12,7 @@ #include "gfxUtils.h" #include "nsGkAtoms.h" #include "SVGObserverUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "mozilla/dom/SVGFilterElement.h" #include "nsSVGFilterInstance.h" #include "nsSVGIntegrationUtils.h" diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 66f09c61d052..b80202d1ea2e 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -145,7 +145,7 @@ void nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext, void nsSVGForeignObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) { - if (!static_cast(GetContent())->HasValidDimensions()) { + if (!static_cast(GetContent())->HasValidDimensions()) { return; } nsDisplayList newList; @@ -170,7 +170,7 @@ bool nsSVGForeignObjectFrame::IsSVGTransformed( aFromParentTransform); } - nsSVGElement* content = static_cast(GetContent()); + SVGElement* content = static_cast(GetContent()); nsSVGAnimatedTransformList* transformList = content->GetAnimatedTransformList(); if ((transformList && transformList->HasTransform()) || @@ -240,7 +240,7 @@ void nsSVGForeignObjectFrame::PaintSVG(gfxContext& aContext, if (StyleDisplay()->IsScrollableOverflow()) { float x, y, width, height; - static_cast(GetContent()) + static_cast(GetContent()) ->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr); gfxRect clipRect = @@ -289,7 +289,7 @@ nsIFrame* nsSVGForeignObjectFrame::GetFrameForPoint(const gfxPoint& aPoint) { } float x, y, width, height; - static_cast(GetContent()) + static_cast(GetContent()) ->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr); if (!gfxRect(x, y, width, height).Contains(aPoint) || diff --git a/layout/svg/nsSVGGFrame.cpp b/layout/svg/nsSVGGFrame.cpp index be752806f7e5..c1366c96fa77 100644 --- a/layout/svg/nsSVGGFrame.cpp +++ b/layout/svg/nsSVGGFrame.cpp @@ -31,7 +31,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsSVGGFrame) void nsSVGGFrame::Init(nsIContent* aContent, nsContainerFrame* aParent, nsIFrame* aPrevInFlow) { NS_ASSERTION(aContent->IsSVGElement() && - static_cast(aContent)->IsTransformable(), + static_cast(aContent)->IsTransformable(), "The element doesn't support nsIDOMSVGTransformable"); nsSVGDisplayContainerFrame::Init(aContent, aParent, aPrevInFlow); diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp index d87d352c076e..4d91363105e0 100644 --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -18,7 +18,7 @@ #include "gfxContext.h" #include "nsSVGClipPathFrame.h" #include "SVGObserverUtils.h" -#include "nsSVGElement.h" +#include "SVGElement.h" #include "nsSVGFilterPaintCallback.h" #include "nsSVGMaskFrame.h" #include "nsSVGPaintServerFrame.h" @@ -616,7 +616,7 @@ static bool ValidateSVGFrame(nsIFrame* aFrame) { #endif const nsIContent* content = aFrame->GetContent(); - if (!static_cast(content)->HasValidDimensions()) { + if (!static_cast(content)->HasValidDimensions()) { // The SVG spec says not to draw _anything_ return false; } diff --git a/layout/svg/nsSVGMarkerFrame.cpp b/layout/svg/nsSVGMarkerFrame.cpp index c7f4e19080f2..7095cbd4f341 100644 --- a/layout/svg/nsSVGMarkerFrame.cpp +++ b/layout/svg/nsSVGMarkerFrame.cpp @@ -199,7 +199,7 @@ nsSVGMarkerFrame::AutoMarkerReferencer::AutoMarkerReferencer( mFrame->mMarkedFrame = aMarkedFrame; SVGViewportElement* ctx = - static_cast(aMarkedFrame->GetContent())->GetCtx(); + static_cast(aMarkedFrame->GetContent())->GetCtx(); mFrame->SetParentCoordCtxProvider(ctx); } diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index 70d8b9e2bb15..2e7adf876c44 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -114,7 +114,7 @@ already_AddRefed nsSVGMaskFrame::GetMaskForMaskedFrame( } gfxMatrix m = mMatrixForChildren; if (kid->GetContent()->IsSVGElement()) { - m = static_cast(kid->GetContent()) + m = static_cast(kid->GetContent()) ->PrependLocalTransformsTo(m, eUserSpaceToParent); } nsSVGUtils::PaintFrameWithEffects(kid, *tmpCtx, m, aParams.imgParams); diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 47d00d0137dd..fb9ac3254db2 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -359,7 +359,7 @@ already_AddRefed nsSVGPatternFrame::PaintPattern( } gfxMatrix tm = *(patternWithChildren->mCTM); if (kid->GetContent()->IsSVGElement()) { - tm = static_cast(kid->GetContent()) + tm = static_cast(kid->GetContent()) ->PrependLocalTransformsTo(tm, eUserSpaceToParent); } @@ -626,7 +626,7 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const nsSVGViewBox &aViewBox, scaleY = callerBBox.Height(); } else { if (targetContent->IsSVGElement()) { - ctx = static_cast(targetContent)->GetCtx(); + ctx = static_cast(targetContent)->GetCtx(); } scaleX = scaleY = MaxExpansion(callerCTM); } diff --git a/layout/svg/nsSVGSwitchFrame.cpp b/layout/svg/nsSVGSwitchFrame.cpp index 534a4acc004d..ad4b5e650959 100644 --- a/layout/svg/nsSVGSwitchFrame.cpp +++ b/layout/svg/nsSVGSwitchFrame.cpp @@ -98,7 +98,7 @@ void nsSVGSwitchFrame::PaintSVG(gfxContext& aContext, if (kid) { gfxMatrix tm = aTransform; if (kid->GetContent()->IsSVGElement()) { - tm = static_cast(kid->GetContent()) + tm = static_cast(kid->GetContent()) ->PrependLocalTransformsTo(tm, eUserSpaceToParent); } nsSVGUtils::PaintFrameWithEffects(kid, aContext, tm, aImgParams, @@ -118,9 +118,9 @@ nsIFrame* nsSVGSwitchFrame::GetFrameForPoint(const gfxPoint& aPoint) { // Transform the point from our SVG user space to our child's. gfxPoint point = aPoint; gfxMatrix m = - static_cast(GetContent()) + static_cast(GetContent()) ->PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace); - m = static_cast(kid->GetContent()) + m = static_cast(kid->GetContent()) ->PrependLocalTransformsTo(m, eUserSpaceToParent); if (!m.IsIdentity()) { if (!m.Invert()) { @@ -199,7 +199,7 @@ SVGBBox nsSVGSwitchFrame::GetBBoxContribution(const Matrix& aToBBoxUserspace, nsIContent* content = kid->GetContent(); gfxMatrix transform = ThebesMatrix(aToBBoxUserspace); if (content->IsSVGElement()) { - transform = static_cast(content)->PrependLocalTransformsTo( + transform = static_cast(content)->PrependLocalTransformsTo( transform); } return svgKid->GetBBoxContribution(ToMatrix(transform), aFlags); diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 13b081e8281d..823715ee54e5 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -240,8 +240,7 @@ Size nsSVGUtils::GetContextSize(const nsIFrame* aFrame) { Size size; MOZ_ASSERT(aFrame->GetContent()->IsSVGElement(), "bad cast"); - const nsSVGElement* element = - static_cast(aFrame->GetContent()); + const SVGElement* element = static_cast(aFrame->GetContent()); SVGViewportElement* ctx = element->GetCtx(); if (ctx) { @@ -279,7 +278,7 @@ float nsSVGUtils::ObjectSpace(const gfxRect& aRect, axis; } -float nsSVGUtils::UserSpace(nsSVGElement* aSVGElement, +float nsSVGUtils::UserSpace(SVGElement* aSVGElement, const nsSVGLength2* aLength) { return aLength->GetAnimValue(aSVGElement); } @@ -362,7 +361,7 @@ gfxMatrix nsSVGUtils::GetUserToCanvasTM(nsIFrame* aFrame) { gfxMatrix tm; if (svgFrame) { - nsSVGElement* content = static_cast(aFrame->GetContent()); + SVGElement* content = static_cast(aFrame->GetContent()); tm = content->PrependLocalTransformsTo(GetCanvasTM(aFrame->GetParent()), eUserSpaceToParent); } @@ -599,7 +598,7 @@ void nsSVGUtils::PaintFrameWithEffects(nsIFrame* aFrame, gfxContext& aContext, const nsIContent* content = aFrame->GetContent(); if (content->IsSVGElement() && - !static_cast(content)->HasValidDimensions()) { + !static_cast(content)->HasValidDimensions()) { return; } @@ -831,7 +830,7 @@ nsIFrame* nsSVGUtils::HitTestChildren(nsSVGDisplayContainerFrame* aFrame, gfxPoint point = aPoint; if (aFrame->GetContent()->IsSVGElement()) { // must check before cast gfxMatrix m = - static_cast(aFrame->GetContent()) + static_cast(aFrame->GetContent()) ->PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace); if (!m.IsIdentity()) { if (!m.Invert()) { @@ -850,7 +849,7 @@ nsIFrame* nsSVGUtils::HitTestChildren(nsSVGDisplayContainerFrame* aFrame, if (SVGFrame) { const nsIContent* content = current->GetContent(); if (content->IsSVGElement() && - !static_cast(content)->HasValidDimensions()) { + !static_cast(content)->HasValidDimensions()) { continue; } // GetFrameForPoint() expects a point in its frame's SVG user space, so @@ -858,7 +857,7 @@ nsIFrame* nsSVGUtils::HitTestChildren(nsSVGDisplayContainerFrame* aFrame, gfxPoint p = point; if (content->IsSVGElement()) { // must check before cast gfxMatrix m = - static_cast(content)->PrependLocalTransformsTo( + static_cast(content)->PrependLocalTransformsTo( gfxMatrix(), eUserSpaceToParent); if (!m.IsIdentity()) { if (!m.Invert()) { @@ -1012,7 +1011,7 @@ gfxRect nsSVGUtils::GetBBox(nsIFrame* aFrame, uint32_t aFlags, nsIContent* content = aFrame->GetContent(); if (content->IsSVGElement() && - !static_cast(content)->HasValidDimensions()) { + !static_cast(content)->HasValidDimensions()) { return gfxRect(); } @@ -1046,7 +1045,7 @@ gfxRect nsSVGUtils::GetBBox(nsIFrame* aFrame, uint32_t aFlags, // NOTE: When changing this to apply to other frame types, make sure to // also update nsSVGUtils::FrameSpaceInCSSPxToUserSpaceOffset. MOZ_ASSERT(content->IsSVGElement(), "bad cast"); - nsSVGElement* element = static_cast(content); + SVGElement* element = static_cast(content); matrix = element->PrependLocalTransformsTo(matrix, eChildToUserSpace); } gfxRect bbox = @@ -1130,7 +1129,7 @@ gfxPoint nsSVGUtils::FrameSpaceInCSSPxToUserSpaceOffset(nsIFrame* aFrame) { // transform, so we need to do the same here. if (aFrame->IsSVGForeignObjectFrame()) { gfxMatrix transform = - static_cast(aFrame->GetContent()) + static_cast(aFrame->GetContent()) ->PrependLocalTransformsTo(gfxMatrix(), eChildToUserSpace); NS_ASSERTION(!transform.HasNonTranslation(), "we're relying on this being an offset-only transform"); @@ -1166,7 +1165,7 @@ gfxRect nsSVGUtils::GetRelativeRect(uint16_t aUnits, const nsSVGLength2* aXYWH, } nsIContent* content = aFrame->GetContent(); if (content->IsSVGElement()) { - nsSVGElement* svgElement = static_cast(content); + SVGElement* svgElement = static_cast(content); return GetRelativeRect(aUnits, aXYWH, aBBox, SVGElementMetrics(svgElement)); } return GetRelativeRect(aUnits, aXYWH, aBBox, @@ -1241,7 +1240,7 @@ bool nsSVGUtils::GetNonScalingStrokeTransform(nsIFrame* aFrame, MOZ_ASSERT(content->IsSVGElement(), "bad cast"); *aUserToOuterSVG = ThebesMatrix( - SVGContentUtils::GetCTM(static_cast(content), true)); + SVGContentUtils::GetCTM(static_cast(content), true)); return !aUserToOuterSVG->IsIdentity(); } @@ -1532,7 +1531,7 @@ float nsSVGUtils::GetStrokeWidth(nsIFrame* aFrame, content = content->GetParent(); } - nsSVGElement* ctx = static_cast(content); + SVGElement* ctx = static_cast(content); return SVGContentUtils::CoordToFloat(ctx, style->mStrokeWidth); } @@ -1541,7 +1540,7 @@ void nsSVGUtils::SetupStrokeGeometry(nsIFrame* aFrame, gfxContext* aContext, SVGContextPaint* aContextPaint) { SVGContentUtils::AutoStrokeOptions strokeOptions; SVGContentUtils::GetStrokeOptions( - &strokeOptions, static_cast(aFrame->GetContent()), + &strokeOptions, static_cast(aFrame->GetContent()), aFrame->Style(), aContextPaint); if (strokeOptions.mLineWidth <= 0) { @@ -1622,7 +1621,7 @@ void nsSVGUtils::PaintSVGGlyph(Element* aElement, gfxContext* aContext) { if (frame->GetContent()->IsSVGElement()) { // PaintSVG() expects the passed transform to be the transform to its own // SVG user space, so we need to account for any 'transform' attribute: - m = static_cast(frame->GetContent()) + m = static_cast(frame->GetContent()) ->PrependLocalTransformsTo(gfxMatrix(), eUserSpaceToParent); } @@ -1644,7 +1643,7 @@ bool nsSVGUtils::GetSVGGlyphExtents(Element* aElement, gfxMatrix transform(aSVGToAppSpace); nsIContent* content = frame->GetContent(); if (content->IsSVGElement()) { - transform = static_cast(content)->PrependLocalTransformsTo( + transform = static_cast(content)->PrependLocalTransformsTo( aSVGToAppSpace); } diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index 7a210814dfd6..bcd305c89c3c 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -36,7 +36,6 @@ class nsIFrame; class nsPresContext; class nsStyleSVGPaint; class nsSVGDisplayContainerFrame; -class nsSVGElement; class nsSVGEnum; class nsSVGLength2; class nsSVGOuterSVGFrame; @@ -51,6 +50,7 @@ struct SVGContextPaintImpl; class SVGGeometryFrame; namespace dom { class Element; +class SVGElement; class UserSpaceMetrics; } // namespace dom namespace gfx { @@ -154,6 +154,7 @@ class MOZ_RAII SVGAutoRenderState { class nsSVGUtils { public: typedef mozilla::dom::Element Element; + typedef mozilla::dom::SVGElement SVGElement; typedef mozilla::gfx::AntialiasMode AntialiasMode; typedef mozilla::gfx::DrawTarget DrawTarget; typedef mozilla::gfx::FillRule FillRule; @@ -230,8 +231,7 @@ class nsSVGUtils { Input: content - object to be used for determining user space Input: length - length to be converted */ - static float UserSpace(nsSVGElement* aSVGElement, - const nsSVGLength2* aLength); + static float UserSpace(SVGElement* aSVGElement, const nsSVGLength2* aLength); static float UserSpace(nsIFrame* aFrame, const nsSVGLength2* aLength); static float UserSpace(const mozilla::dom::UserSpaceMetrics& aMetrics, const nsSVGLength2* aLength); diff --git a/layout/svg/nsSVGViewportFrame.cpp b/layout/svg/nsSVGViewportFrame.cpp index 53a5ad99971b..e3900b380c2e 100644 --- a/layout/svg/nsSVGViewportFrame.cpp +++ b/layout/svg/nsSVGViewportFrame.cpp @@ -231,7 +231,7 @@ nsIFrame* nsSVGViewportFrame::GetFrameForPoint(const gfxPoint& aPoint) { if (StyleDisplay()->IsScrollableOverflow()) { Rect clip; - static_cast(GetContent()) + static_cast(GetContent()) ->GetAnimatedLengthValues(&clip.x, &clip.y, &clip.width, &clip.height, nullptr); if (!clip.Contains(ToPoint(aPoint))) {