Bug 1515607 - Move nsSVGFE into the mozilla::dom namespace r=dholbert
authorlongsonr <longsonr@gmail.com>
Fri, 21 Dec 2018 12:32:35 +0000
changeset 451672 00d55a99831bd9ce0e4e5fc58fb06d27feff6fbc
parent 451671 b5496201ffc3170c3249d1c08138948507c8b99c
child 451673 38dac70dcec66ea4c5f14da8ae600aa6ccca9389
child 451707 527fcd973d9fdeb1a6f5e9eed01aaa5ab55640f2
push id35250
push userrgurzau@mozilla.com
push dateFri, 21 Dec 2018 16:36:26 +0000
treeherdermozilla-central@38dac70dcec6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1515607
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515607 - Move nsSVGFE into the mozilla::dom namespace r=dholbert
dom/svg/SVGFEBlendElement.h
dom/svg/SVGFEColorMatrixElement.h
dom/svg/SVGFEComponentTransferElement.h
dom/svg/SVGFECompositeElement.h
dom/svg/SVGFEConvolveMatrixElement.h
dom/svg/SVGFEDisplacementMapElement.h
dom/svg/SVGFEDropShadowElement.h
dom/svg/SVGFEFloodElement.h
dom/svg/SVGFEGaussianBlurElement.h
dom/svg/SVGFEImageElement.h
dom/svg/SVGFEMergeElement.h
dom/svg/SVGFEMorphologyElement.h
dom/svg/SVGFEOffsetElement.h
dom/svg/SVGFETileElement.h
dom/svg/SVGFETurbulenceElement.h
dom/svg/nsSVGFilters.cpp
dom/svg/nsSVGFilters.h
layout/svg/SVGFEContainerFrame.cpp
layout/svg/SVGFELeafFrame.cpp
layout/svg/nsSVGFilterFrame.cpp
layout/svg/nsSVGFilterInstance.cpp
layout/svg/nsSVGFilterInstance.h
--- a/dom/svg/SVGFEBlendElement.h
+++ b/dom/svg/SVGFEBlendElement.h
@@ -10,17 +10,17 @@
 #include "nsSVGFilters.h"
 #include "nsSVGEnum.h"
 
 nsresult NS_NewSVGFEBlendElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEBlendElementBase;
+typedef SVGFE SVGFEBlendElementBase;
 
 class SVGFEBlendElement : public SVGFEBlendElementBase {
   friend nsresult(::NS_NewSVGFEBlendElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEBlendElement(
--- a/dom/svg/SVGFEColorMatrixElement.h
+++ b/dom/svg/SVGFEColorMatrixElement.h
@@ -12,17 +12,17 @@
 #include "SVGAnimatedNumberList.h"
 
 nsresult NS_NewSVGFEColorMatrixElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEColorMatrixElementBase;
+typedef SVGFE SVGFEColorMatrixElementBase;
 
 class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase {
   friend nsresult(::NS_NewSVGFEColorMatrixElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEColorMatrixElement(
--- a/dom/svg/SVGFEComponentTransferElement.h
+++ b/dom/svg/SVGFEComponentTransferElement.h
@@ -4,24 +4,24 @@
  * 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/. */
 
 #ifndef mozilla_dom_SVGFEComponentTransferElement_h
 #define mozilla_dom_SVGFEComponentTransferElement_h
 
 #include "nsSVGFilters.h"
 
-typedef nsSVGFE SVGFEComponentTransferElementBase;
-
 nsresult NS_NewSVGFEComponentTransferElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
+typedef SVGFE SVGFEComponentTransferElementBase;
+
 class SVGFEComponentTransferElement : public SVGFEComponentTransferElementBase {
   friend nsresult(::NS_NewSVGFEComponentTransferElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEComponentTransferElement(
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
--- a/dom/svg/SVGFECompositeElement.h
+++ b/dom/svg/SVGFECompositeElement.h
@@ -12,17 +12,17 @@
 #include "nsSVGNumber2.h"
 
 nsresult NS_NewSVGFECompositeElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFECompositeElementBase;
+typedef SVGFE SVGFECompositeElementBase;
 
 class SVGFECompositeElement : public SVGFECompositeElementBase {
   friend nsresult(::NS_NewSVGFECompositeElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFECompositeElement(
--- a/dom/svg/SVGFEConvolveMatrixElement.h
+++ b/dom/svg/SVGFEConvolveMatrixElement.h
@@ -20,17 +20,17 @@ nsresult NS_NewSVGFEConvolveMatrixElemen
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 class DOMSVGAnimatedNumberList;
 
 namespace dom {
 class SVGAnimatedBoolean;
 
-typedef nsSVGFE SVGFEConvolveMatrixElementBase;
+typedef SVGFE SVGFEConvolveMatrixElementBase;
 
 class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase {
   friend nsresult(::NS_NewSVGFEConvolveMatrixElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEConvolveMatrixElement(
--- a/dom/svg/SVGFEDisplacementMapElement.h
+++ b/dom/svg/SVGFEDisplacementMapElement.h
@@ -11,17 +11,17 @@
 #include "nsSVGFilters.h"
 
 nsresult NS_NewSVGFEDisplacementMapElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEDisplacementMapElementBase;
+typedef SVGFE SVGFEDisplacementMapElementBase;
 
 class SVGFEDisplacementMapElement : public SVGFEDisplacementMapElementBase {
  protected:
   friend nsresult(::NS_NewSVGFEDisplacementMapElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
   explicit SVGFEDisplacementMapElement(
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
--- a/dom/svg/SVGFEDropShadowElement.h
+++ b/dom/svg/SVGFEDropShadowElement.h
@@ -13,17 +13,17 @@
 #include "nsSVGString.h"
 
 nsresult NS_NewSVGFEDropShadowElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEDropShadowElementBase;
+typedef SVGFE SVGFEDropShadowElementBase;
 
 class SVGFEDropShadowElement : public SVGFEDropShadowElementBase {
   friend nsresult(::NS_NewSVGFEDropShadowElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEDropShadowElement(
--- a/dom/svg/SVGFEFloodElement.h
+++ b/dom/svg/SVGFEFloodElement.h
@@ -10,17 +10,17 @@
 #include "nsSVGFilters.h"
 
 nsresult NS_NewSVGFEFloodElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEFloodElementBase;
+typedef SVGFE SVGFEFloodElementBase;
 
 class SVGFEFloodElement : public SVGFEFloodElementBase {
   friend nsresult(::NS_NewSVGFEFloodElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEFloodElement(
--- a/dom/svg/SVGFEGaussianBlurElement.h
+++ b/dom/svg/SVGFEGaussianBlurElement.h
@@ -12,17 +12,17 @@
 #include "nsSVGString.h"
 
 nsresult NS_NewSVGFEGaussianBlurElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEGaussianBlurElementBase;
+typedef SVGFE SVGFEGaussianBlurElementBase;
 
 class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase {
   friend nsresult(::NS_NewSVGFEGaussianBlurElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEGaussianBlurElement(
--- a/dom/svg/SVGFEImageElement.h
+++ b/dom/svg/SVGFEImageElement.h
@@ -13,17 +13,17 @@
 class SVGFEImageFrame;
 
 nsresult NS_NewSVGFEImageElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEImageElementBase;
+typedef SVGFE SVGFEImageElementBase;
 
 class SVGFEImageElement final : public SVGFEImageElementBase,
                                 public nsImageLoadingContent {
   friend class ::SVGFEImageFrame;
 
  protected:
   friend nsresult(::NS_NewSVGFEImageElement(
       nsIContent** aResult,
--- a/dom/svg/SVGFEMergeElement.h
+++ b/dom/svg/SVGFEMergeElement.h
@@ -10,17 +10,17 @@
 #include "nsSVGFilters.h"
 
 nsresult NS_NewSVGFEMergeElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEMergeElementBase;
+typedef SVGFE SVGFEMergeElementBase;
 
 class SVGFEMergeElement : public SVGFEMergeElementBase {
   friend nsresult(::NS_NewSVGFEMergeElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEMergeElement(
--- a/dom/svg/SVGFEMorphologyElement.h
+++ b/dom/svg/SVGFEMorphologyElement.h
@@ -13,17 +13,17 @@
 #include "nsSVGString.h"
 
 nsresult NS_NewSVGFEMorphologyElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEMorphologyElementBase;
+typedef SVGFE SVGFEMorphologyElementBase;
 
 class SVGFEMorphologyElement : public SVGFEMorphologyElementBase {
   friend nsresult(::NS_NewSVGFEMorphologyElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEMorphologyElement(
--- a/dom/svg/SVGFEOffsetElement.h
+++ b/dom/svg/SVGFEOffsetElement.h
@@ -12,17 +12,17 @@
 #include "nsSVGString.h"
 
 nsresult NS_NewSVGFEOffsetElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFEOffsetElementBase;
+typedef SVGFE SVGFEOffsetElementBase;
 
 class SVGFEOffsetElement : public SVGFEOffsetElementBase {
   friend nsresult(::NS_NewSVGFEOffsetElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFEOffsetElement(
--- a/dom/svg/SVGFETileElement.h
+++ b/dom/svg/SVGFETileElement.h
@@ -10,17 +10,17 @@
 #include "nsSVGFilters.h"
 
 nsresult NS_NewSVGFETileElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFETileElementBase;
+typedef SVGFE SVGFETileElementBase;
 
 class SVGFETileElement : public SVGFETileElementBase {
   friend nsresult(::NS_NewSVGFETileElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFETileElement(
--- a/dom/svg/SVGFETurbulenceElement.h
+++ b/dom/svg/SVGFETurbulenceElement.h
@@ -14,17 +14,17 @@
 #include "nsSVGString.h"
 
 nsresult NS_NewSVGFETurbulenceElement(
     nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
-typedef nsSVGFE SVGFETurbulenceElementBase;
+typedef SVGFE SVGFETurbulenceElementBase;
 
 class SVGFETurbulenceElement : public SVGFETurbulenceElementBase {
   friend nsresult(::NS_NewSVGFETurbulenceElement(
       nsIContent** aResult,
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
  protected:
   explicit SVGFETurbulenceElement(
--- a/dom/svg/nsSVGFilters.cpp
+++ b/dom/svg/nsSVGFilters.cpp
@@ -40,138 +40,136 @@
 #include "mozilla/dom/SVGFESpotLightElement.h"
 #include "mozilla/dom/SVGLengthBinding.h"
 
 #if defined(XP_WIN)
 // Prevent Windows redefining LoadImage
 #undef LoadImage
 #endif
 
-using namespace mozilla;
-using namespace mozilla::dom;
 using namespace mozilla::gfx;
 
+namespace mozilla {
+namespace dom {
+
 //--------------------Filter Element Base Class-----------------------
 
-SVGElement::LengthInfo nsSVGFE::sLengthInfo[4] = {
+SVGElement::LengthInfo SVGFE::sLengthInfo[4] = {
     {nsGkAtoms::x, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE,
      SVGContentUtils::X},
     {nsGkAtoms::y, 0, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE,
      SVGContentUtils::Y},
     {nsGkAtoms::width, 100, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE,
      SVGContentUtils::X},
     {nsGkAtoms::height, 100, SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE,
      SVGContentUtils::Y}};
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
-NS_IMPL_ADDREF_INHERITED(nsSVGFE, nsSVGFEBase)
-NS_IMPL_RELEASE_INHERITED(nsSVGFE, nsSVGFEBase)
+NS_IMPL_ADDREF_INHERITED(SVGFE, SVGFEBase)
+NS_IMPL_RELEASE_INHERITED(SVGFE, SVGFEBase)
 
-NS_INTERFACE_MAP_BEGIN(nsSVGFE)
-  NS_INTERFACE_MAP_ENTRY_CONCRETE(nsSVGFE)
-NS_INTERFACE_MAP_END_INHERITING(nsSVGFEBase)
+NS_INTERFACE_MAP_BEGIN(SVGFE)
+  NS_INTERFACE_MAP_ENTRY_CONCRETE(SVGFE)
+NS_INTERFACE_MAP_END_INHERITING(SVGFEBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-void nsSVGFE::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) {}
+void SVGFE::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) {}
 
-bool nsSVGFE::OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
-                              nsIPrincipal* aReferencePrincipal) {
+bool SVGFE::OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
+                            nsIPrincipal* aReferencePrincipal) {
   // This is the default implementation for OutputIsTainted.
   // Our output is tainted if we have at least one tainted input.
   for (uint32_t i = 0; i < aInputsAreTainted.Length(); i++) {
     if (aInputsAreTainted[i]) {
       return true;
     }
   }
   return false;
 }
 
-bool nsSVGFE::AttributeAffectsRendering(int32_t aNameSpaceID,
-                                        nsAtom* aAttribute) const {
+bool SVGFE::AttributeAffectsRendering(int32_t aNameSpaceID,
+                                      nsAtom* aAttribute) const {
   return aNameSpaceID == kNameSpaceID_None &&
          (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y ||
           aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
           aAttribute == nsGkAtoms::result);
 }
 
-already_AddRefed<SVGAnimatedLength> nsSVGFE::X() {
+already_AddRefed<SVGAnimatedLength> SVGFE::X() {
   return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
 }
 
-already_AddRefed<SVGAnimatedLength> nsSVGFE::Y() {
+already_AddRefed<SVGAnimatedLength> SVGFE::Y() {
   return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
 }
 
-already_AddRefed<SVGAnimatedLength> nsSVGFE::Width() {
+already_AddRefed<SVGAnimatedLength> SVGFE::Width() {
   return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
 }
 
-already_AddRefed<SVGAnimatedLength> nsSVGFE::Height() {
+already_AddRefed<SVGAnimatedLength> SVGFE::Height() {
   return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
 }
 
-already_AddRefed<SVGAnimatedString> nsSVGFE::Result() {
+already_AddRefed<SVGAnimatedString> SVGFE::Result() {
   return GetResultImageName().ToDOMAnimatedString(this);
 }
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 NS_IMETHODIMP_(bool)
-nsSVGFE::IsAttributeMapped(const nsAtom* name) const {
+SVGFE::IsAttributeMapped(const nsAtom* name) const {
   static const MappedAttributeEntry* const map[] = {sFiltersMap};
 
   return FindAttributeDependence(name, map) ||
-         nsSVGFEBase::IsAttributeMapped(name);
+         SVGFEBase::IsAttributeMapped(name);
 }
 
 //----------------------------------------------------------------------
 // SVGElement methods
 
-bool nsSVGFE::StyleIsSetToSRGB() {
+bool SVGFE::StyleIsSetToSRGB() {
   nsIFrame* frame = GetPrimaryFrame();
   if (!frame) return false;
 
   ComputedStyle* style = frame->Style();
   return style->StyleSVG()->mColorInterpolationFilters ==
          NS_STYLE_COLOR_INTERPOLATION_SRGB;
 }
 
-/* virtual */ bool nsSVGFE::HasValidDimensions() const {
+/* virtual */ bool SVGFE::HasValidDimensions() const {
   return (!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() ||
           mLengthAttributes[ATTR_WIDTH].GetAnimValInSpecifiedUnits() > 0) &&
          (!mLengthAttributes[ATTR_HEIGHT].IsExplicitlySet() ||
           mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0);
 }
 
-Size nsSVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance,
-                                  nsSVGNumberPair* aKernelUnitLength) {
+Size SVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance,
+                                nsSVGNumberPair* aKernelUnitLength) {
   if (!aKernelUnitLength->IsExplicitlySet()) {
     return Size(1, 1);
   }
 
   float kernelX = aInstance->GetPrimitiveNumber(
       SVGContentUtils::X, aKernelUnitLength, nsSVGNumberPair::eFirst);
   float kernelY = aInstance->GetPrimitiveNumber(
       SVGContentUtils::Y, aKernelUnitLength, nsSVGNumberPair::eSecond);
   return Size(kernelX, kernelY);
 }
 
-SVGElement::LengthAttributesInfo nsSVGFE::GetLengthInfo() {
+SVGElement::LengthAttributesInfo SVGFE::GetLengthInfo() {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
-namespace mozilla {
-namespace dom {
-
 SVGElement::NumberListInfo
     SVGComponentTransferFunctionElement::sNumberListInfo[1] = {
         {nsGkAtoms::tableValues}};
 
 SVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] = {
     {nsGkAtoms::slope, 1, false},
     {nsGkAtoms::intercept, 0, false},
     {nsGkAtoms::amplitude, 1, false},
--- a/dom/svg/nsSVGFilters.h
+++ b/dom/svg/nsSVGFilters.h
@@ -23,43 +23,46 @@ struct nsSVGStringInfo {
   nsSVGStringInfo(const nsSVGString* aString,
                   mozilla::dom::SVGElement* aElement)
       : mString(aString), mElement(aElement) {}
 
   const nsSVGString* mString;
   mozilla::dom::SVGElement* mElement;
 };
 
-typedef mozilla::dom::SVGElement nsSVGFEBase;
+namespace mozilla {
+namespace dom {
+
+typedef SVGElement SVGFEBase;
 
 #define NS_SVG_FE_CID                                \
   {                                                  \
     0x60483958, 0xd229, 0x4a77, {                    \
       0x96, 0xb2, 0x62, 0x3e, 0x69, 0x95, 0x1e, 0x0e \
     }                                                \
   }
 
 /**
  * Base class for filter primitive elements
  * Children of those elements e.g. feMergeNode
  * derive from SVGFEUnstyledElement instead
  */
-class nsSVGFE : public nsSVGFEBase {
-  friend class nsSVGFilterInstance;
+class SVGFE : public SVGFEBase {
+  friend class ::nsSVGFilterInstance;
 
  protected:
   typedef mozilla::gfx::SourceSurface SourceSurface;
   typedef mozilla::gfx::Size Size;
   typedef mozilla::gfx::IntRect IntRect;
   typedef mozilla::gfx::ColorSpace ColorSpace;
   typedef mozilla::gfx::FilterPrimitiveDescription FilterPrimitiveDescription;
 
-  explicit nsSVGFE(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
-      : nsSVGFEBase(std::move(aNodeInfo)) {}
-  virtual ~nsSVGFE() {}
+  explicit SVGFE(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
+      : SVGFEBase(std::move(aNodeInfo)) {}
+  virtual ~SVGFE() {}
 
  public:
   typedef mozilla::gfx::PrimitiveAttributes PrimitiveAttributes;
 
   ColorSpace GetInputColorSpace(int32_t aInputIndex,
                                 ColorSpace aUnchangedInputColorSpace) {
     return OperatesOnSRGB(aInputIndex,
                           aUnchangedInputColorSpace == ColorSpace::SRGB)
@@ -147,19 +150,19 @@ class nsSVGFE : public nsSVGFEBase {
   Size GetKernelUnitLength(nsSVGFilterInstance* aInstance,
                            nsSVGNumberPair* aKernelUnitLength);
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   nsSVGLength2 mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFE, NS_SVG_FE_CID)
+NS_DEFINE_STATIC_IID_ACCESSOR(SVGFE, NS_SVG_FE_CID)
 
-typedef mozilla::dom::SVGElement SVGFEUnstyledElementBase;
+typedef SVGElement SVGFEUnstyledElementBase;
 
 class SVGFEUnstyledElement : public SVGFEUnstyledElementBase {
  protected:
   explicit SVGFEUnstyledElement(
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
       : SVGFEUnstyledElementBase(std::move(aNodeInfo)) {}
 
  public:
@@ -167,22 +170,19 @@ class SVGFEUnstyledElement : public SVGF
                          nsINode** aResult) const override = 0;
 
   // returns true if changes to the attribute should cause us to
   // repaint the filter
   virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
                                          nsAtom* aAttribute) const = 0;
 };
 
-namespace mozilla {
-namespace dom {
-
 //------------------------------------------------------------
 
-typedef nsSVGFE SVGFELightingElementBase;
+typedef SVGFE SVGFELightingElementBase;
 
 class SVGFELightingElement : public SVGFELightingElementBase {
  protected:
   explicit SVGFELightingElement(
       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
       : SVGFELightingElementBase(std::move(aNodeInfo)) {}
 
   virtual ~SVGFELightingElement() {}
--- a/layout/svg/SVGFEContainerFrame.cpp
+++ b/layout/svg/SVGFEContainerFrame.cpp
@@ -76,17 +76,17 @@ void SVGFEContainerFrame::Init(nsIConten
 
   nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
 }
 #endif /* DEBUG */
 
 nsresult SVGFEContainerFrame::AttributeChanged(int32_t aNameSpaceID,
                                                nsAtom* aAttribute,
                                                int32_t aModType) {
-  nsSVGFE* element = static_cast<nsSVGFE*>(GetContent());
+  dom::SVGFE* element = static_cast<dom::SVGFE*>(GetContent());
   if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
     MOZ_ASSERT(
         GetParent()->IsSVGFilterFrame(),
         "Observers observe the filter, so that's what we must invalidate");
     SVGObserverUtils::InvalidateDirectRenderingObservers(GetParent());
   }
 
   return nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
--- a/layout/svg/SVGFELeafFrame.cpp
+++ b/layout/svg/SVGFELeafFrame.cpp
@@ -74,17 +74,17 @@ void SVGFELeafFrame::Init(nsIContent* aC
 
   nsFrame::Init(aContent, aParent, aPrevInFlow);
 }
 #endif /* DEBUG */
 
 nsresult SVGFELeafFrame::AttributeChanged(int32_t aNameSpaceID,
                                           nsAtom* aAttribute,
                                           int32_t aModType) {
-  nsSVGFE* element = static_cast<nsSVGFE*>(GetContent());
+  SVGFE* element = static_cast<SVGFE*>(GetContent());
   if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
     MOZ_ASSERT(
         GetParent()->IsSVGFilterFrame(),
         "Observers observe the filter, so that's what we must invalidate");
     SVGObserverUtils::InvalidateDirectRenderingObservers(GetParent());
   }
 
   return nsFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
--- a/layout/svg/nsSVGFilterFrame.cpp
+++ b/layout/svg/nsSVGFilterFrame.cpp
@@ -82,18 +82,18 @@ const nsSVGLength2* nsSVGFilterFrame::Ge
               : &static_cast<SVGFilterElement*>(aDefault)
                      ->mLengthAttributes[aIndex];
 }
 
 const SVGFilterElement* nsSVGFilterFrame::GetFilterContent(
     nsIContent* aDefault) {
   for (nsIContent* child = mContent->GetFirstChild(); child;
        child = child->GetNextSibling()) {
-    RefPtr<nsSVGFE> primitive;
-    CallQueryInterface(child, (nsSVGFE**)getter_AddRefs(primitive));
+    RefPtr<SVGFE> primitive;
+    CallQueryInterface(child, (SVGFE**)getter_AddRefs(primitive));
     if (primitive) {
       return static_cast<SVGFilterElement*>(GetContent());
     }
   }
 
   // Before we recurse, make sure we'll break reference loops and over long
   // reference chains:
   static int16_t sRefChainLengthCounter = AutoReferenceChainGuard::noChain;
--- a/layout/svg/nsSVGFilterInstance.cpp
+++ b/layout/svg/nsSVGFilterInstance.cpp
@@ -207,20 +207,20 @@ gfxRect nsSVGFilterInstance::UserSpaceTo
     const gfxRect& aUserSpaceRect) const {
   gfxRect filterSpaceRect = aUserSpaceRect;
   filterSpaceRect.Scale(mUserSpaceToFilterSpaceScale.width,
                         mUserSpaceToFilterSpaceScale.height);
   return filterSpaceRect;
 }
 
 IntRect nsSVGFilterInstance::ComputeFilterPrimitiveSubregion(
-    nsSVGFE* aFilterElement,
+    SVGFE* aFilterElement,
     const nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
     const nsTArray<int32_t>& aInputIndices) {
-  nsSVGFE* fE = aFilterElement;
+  SVGFE* fE = aFilterElement;
 
   IntRect defaultFilterSubregion(0, 0, 0, 0);
   if (fE->SubregionIsUnionOfRegions()) {
     for (uint32_t i = 0; i < aInputIndices.Length(); ++i) {
       int32_t inputIndex = aInputIndices[i];
       bool isStandardInput =
           inputIndex < 0 || inputIndex == mSourceGraphicIndex;
       IntRect inputSubregion =
@@ -229,27 +229,27 @@ IntRect nsSVGFilterInstance::ComputeFilt
 
       defaultFilterSubregion = defaultFilterSubregion.Union(inputSubregion);
     }
   } else {
     defaultFilterSubregion = mFilterSpaceBounds;
   }
 
   gfxRect feArea = nsSVGUtils::GetRelativeRect(
-      mPrimitiveUnits, &fE->mLengthAttributes[nsSVGFE::ATTR_X], mTargetBBox,
+      mPrimitiveUnits, &fE->mLengthAttributes[SVGFE::ATTR_X], mTargetBBox,
       mMetrics);
   Rect region = ToRect(UserSpaceToFilterSpace(feArea));
 
-  if (!fE->mLengthAttributes[nsSVGFE::ATTR_X].IsExplicitlySet())
+  if (!fE->mLengthAttributes[SVGFE::ATTR_X].IsExplicitlySet())
     region.x = defaultFilterSubregion.X();
-  if (!fE->mLengthAttributes[nsSVGFE::ATTR_Y].IsExplicitlySet())
+  if (!fE->mLengthAttributes[SVGFE::ATTR_Y].IsExplicitlySet())
     region.y = defaultFilterSubregion.Y();
-  if (!fE->mLengthAttributes[nsSVGFE::ATTR_WIDTH].IsExplicitlySet())
+  if (!fE->mLengthAttributes[SVGFE::ATTR_WIDTH].IsExplicitlySet())
     region.width = defaultFilterSubregion.Width();
-  if (!fE->mLengthAttributes[nsSVGFE::ATTR_HEIGHT].IsExplicitlySet())
+  if (!fE->mLengthAttributes[SVGFE::ATTR_HEIGHT].IsExplicitlySet())
     region.height = defaultFilterSubregion.Height();
 
   // We currently require filter primitive subregions to be pixel-aligned.
   // Following the spec, any pixel partially in the region is included
   // in the region.
   region.RoundOut();
   return RoundedToInt(region);
 }
@@ -310,17 +310,17 @@ int32_t nsSVGFilterInstance::GetOrCreate
 
   aPrimitiveDescrs.AppendElement(std::move(descr));
   mSourceAlphaIndex = aPrimitiveDescrs.Length() - 1;
   mSourceAlphaAvailable = true;
   return mSourceAlphaIndex;
 }
 
 nsresult nsSVGFilterInstance::GetSourceIndices(
-    nsSVGFE* aPrimitiveElement,
+    SVGFE* aPrimitiveElement,
     nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
     const nsDataHashtable<nsStringHashKey, int32_t>& aImageTable,
     nsTArray<int32_t>& aSourceIndices) {
   AutoTArray<nsSVGStringInfo, 2> sources;
   aPrimitiveElement->GetSourceImageNames(sources);
 
   for (uint32_t j = 0; j < sources.Length(); j++) {
     nsAutoString str;
@@ -361,35 +361,35 @@ nsresult nsSVGFilterInstance::BuildPrimi
   if (mSourceGraphicIndex >= 0) {
     FilterPrimitiveDescription& sourceDescr =
         aPrimitiveDescrs[mSourceGraphicIndex];
     sourceDescr.SetPrimitiveSubregion(
         sourceDescr.PrimitiveSubregion().Intersect(mFilterSpaceBounds));
   }
 
   // Get the filter primitive elements.
-  nsTArray<RefPtr<nsSVGFE>> primitives;
+  nsTArray<RefPtr<SVGFE>> primitives;
   for (nsIContent* child = mFilterElement->nsINode::GetFirstChild(); child;
        child = child->GetNextSibling()) {
-    RefPtr<nsSVGFE> primitive;
-    CallQueryInterface(child, (nsSVGFE**)getter_AddRefs(primitive));
+    RefPtr<SVGFE> primitive;
+    CallQueryInterface(child, (SVGFE**)getter_AddRefs(primitive));
     if (primitive) {
       primitives.AppendElement(primitive);
     }
   }
 
   // Maps source image name to source index.
   nsDataHashtable<nsStringHashKey, int32_t> imageTable(8);
 
   // The principal that we check principals of any loaded images against.
   nsCOMPtr<nsIPrincipal> principal = mTargetContent->NodePrincipal();
 
   for (uint32_t primitiveElementIndex = 0;
        primitiveElementIndex < primitives.Length(); ++primitiveElementIndex) {
-    nsSVGFE* filter = primitives[primitiveElementIndex];
+    SVGFE* filter = primitives[primitiveElementIndex];
 
     AutoTArray<int32_t, 2> sourceIndices;
     nsresult rv =
         GetSourceIndices(filter, aPrimitiveDescrs, imageTable, sourceIndices);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
--- a/layout/svg/nsSVGFilterInstance.h
+++ b/layout/svg/nsSVGFilterInstance.h
@@ -64,16 +64,17 @@ class SVGFilterElement;
  *   "filter space point" = (10, 10) * 2
  *   "filter space point" = (20, 20)
  */
 class nsSVGFilterInstance {
   typedef mozilla::gfx::Point3D Point3D;
   typedef mozilla::gfx::IntRect IntRect;
   typedef mozilla::gfx::SourceSurface SourceSurface;
   typedef mozilla::gfx::FilterPrimitiveDescription FilterPrimitiveDescription;
+  typedef mozilla::dom::SVGFE SVGFE;
   typedef mozilla::dom::UserSpaceMetrics UserSpaceMetrics;
 
  public:
   /**
    * @param aFilter The SVG filter reference from the style system. This class
    *   stores aFilter by reference, so callers should avoid modifying or
    *   deleting aFilter during the lifetime of nsSVGFilterInstance.
    * @param aTargetContent The filtered element.
@@ -134,17 +135,17 @@ class nsSVGFilterInstance {
    * Finds the filter frame associated with this SVG filter.
    */
   nsSVGFilterFrame* GetFilterFrame(nsIFrame* aTargetFrame);
 
   /**
    * Computes the filter primitive subregion for the given primitive.
    */
   IntRect ComputeFilterPrimitiveSubregion(
-      nsSVGFE* aFilterElement,
+      SVGFE* aFilterElement,
       const nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
       const nsTArray<int32_t>& aInputIndices);
 
   /**
    * Takes the input indices of a filter primitive and returns for each input
    * whether the input's output is tainted.
    */
   void GetInputsAreTainted(
@@ -179,17 +180,17 @@ class nsSVGFilterInstance {
   /**
    * Finds the index in aPrimitiveDescrs of each input to aPrimitiveElement.
    * For example, if aPrimitiveElement is:
    *   <feGaussianBlur in="another-primitive" .../>
    * Then, the resulting aSourceIndices will contain the index of the
    * FilterPrimitiveDescription representing "another-primitive".
    */
   nsresult GetSourceIndices(
-      nsSVGFE* aPrimitiveElement,
+      SVGFE* aPrimitiveElement,
       nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
       const nsDataHashtable<nsStringHashKey, int32_t>& aImageTable,
       nsTArray<int32_t>& aSourceIndices);
 
   /**
    * Compute the filter region in user space, filter space, and filter
    * space.
    */