Bug 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 12 Feb 2018 15:43:55 -0500
changeset 403547 606c47199b309415485694446b5ccf99d6ee0350
parent 403546 68bab9b6f40b820fb8bb387c995720f18eaf150a
child 403548 91d647c847e56cb0db2be19647507cec207b1d08
push id33436
push usernerli@mozilla.com
push dateTue, 13 Feb 2018 09:40:11 +0000
treeherdermozilla-central@38b3c1d03a59 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1436902
milestone60.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 1436902 part 2. Use NS_INLINE_DECL_REFCOUNTING_INHERITED for some classes that have otherwise-empty QI impls. r=mccr8 MozReview-Commit-ID: 95xACATqz7p
dom/events/AnimationEvent.cpp
dom/events/AnimationEvent.h
dom/events/BeforeUnloadEvent.cpp
dom/events/BeforeUnloadEvent.h
dom/events/CommandEvent.cpp
dom/events/CommandEvent.h
dom/events/InputEvent.cpp
dom/events/InputEvent.h
dom/events/KeyboardEvent.cpp
dom/events/KeyboardEvent.h
dom/events/MouseScrollEvent.cpp
dom/events/MouseScrollEvent.h
dom/events/MutationEvent.cpp
dom/events/MutationEvent.h
dom/events/SimpleGestureEvent.cpp
dom/events/SimpleGestureEvent.h
dom/events/TransitionEvent.cpp
dom/events/TransitionEvent.h
dom/events/WheelEvent.cpp
dom/events/WheelEvent.h
dom/svg/SVGPolyElement.cpp
dom/svg/SVGPolyElement.h
dom/svg/nsSVGFilters.cpp
dom/svg/nsSVGFilters.h
layout/style/ServoNamespaceRule.cpp
layout/style/ServoNamespaceRule.h
layout/style/nsCSSRules.cpp
layout/style/nsCSSRules.h
layout/xul/PopupBoxObject.cpp
layout/xul/PopupBoxObject.h
--- a/dom/events/AnimationEvent.cpp
+++ b/dom/events/AnimationEvent.cpp
@@ -21,22 +21,16 @@ AnimationEvent::AnimationEvent(EventTarg
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
   }
 }
 
-NS_INTERFACE_MAP_BEGIN(AnimationEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-NS_IMPL_ADDREF_INHERITED(AnimationEvent, Event)
-NS_IMPL_RELEASE_INHERITED(AnimationEvent, Event)
-
 //static
 already_AddRefed<AnimationEvent>
 AnimationEvent::Constructor(const GlobalObject& aGlobal,
                             const nsAString& aType,
                             const AnimationEventInit& aParam,
                             ErrorResult& aRv)
 {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
--- a/dom/events/AnimationEvent.h
+++ b/dom/events/AnimationEvent.h
@@ -16,17 +16,17 @@ namespace dom {
 
 class AnimationEvent : public Event
 {
 public:
   AnimationEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  InternalAnimationEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(AnimationEvent, Event)
 
   static already_AddRefed<AnimationEvent>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
               const AnimationEventInit& aParam,
               ErrorResult& aRv);
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
--- a/dom/events/BeforeUnloadEvent.cpp
+++ b/dom/events/BeforeUnloadEvent.cpp
@@ -4,22 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/BeforeUnloadEvent.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(BeforeUnloadEvent, Event)
-NS_IMPL_RELEASE_INHERITED(BeforeUnloadEvent, Event)
-
-NS_INTERFACE_MAP_BEGIN(BeforeUnloadEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
 void
 BeforeUnloadEvent::SetReturnValue(const nsAString& aReturnValue)
 {
   mText = aReturnValue;
 }
 
 void
 BeforeUnloadEvent::GetReturnValue(nsAString& aReturnValue)
--- a/dom/events/BeforeUnloadEvent.h
+++ b/dom/events/BeforeUnloadEvent.h
@@ -28,17 +28,17 @@ public:
     return this;
   }
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return BeforeUnloadEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(BeforeUnloadEvent, Event)
 
   void GetReturnValue(nsAString& aReturnValue);
   void SetReturnValue(const nsAString& aReturnValue);
 
 protected:
   ~BeforeUnloadEvent() {}
 
   nsString mText;
--- a/dom/events/CommandEvent.cpp
+++ b/dom/events/CommandEvent.cpp
@@ -21,22 +21,16 @@ CommandEvent::CommandEvent(EventTarget* 
   mEvent->mTime = PR_Now();
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
   }
 }
 
-NS_INTERFACE_MAP_BEGIN(CommandEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-NS_IMPL_ADDREF_INHERITED(CommandEvent, Event)
-NS_IMPL_RELEASE_INHERITED(CommandEvent, Event)
-
 void
 CommandEvent::GetCommand(nsAString& aCommand)
 {
   nsAtom* command = mEvent->AsCommandEvent()->mCommand;
   if (command) {
     command->ToString(aCommand);
   } else {
     aCommand.Truncate();
--- a/dom/events/CommandEvent.h
+++ b/dom/events/CommandEvent.h
@@ -16,17 +16,17 @@ namespace dom {
 
 class CommandEvent : public Event
 {
 public:
   CommandEvent(EventTarget* aOwner,
                nsPresContext* aPresContext,
                WidgetCommandEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(CommandEvent, Event)
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return CommandEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   void GetCommand(nsAString& aCommand);
 
--- a/dom/events/InputEvent.cpp
+++ b/dom/events/InputEvent.cpp
@@ -24,22 +24,16 @@ InputEvent::InputEvent(EventTarget* aOwn
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(InputEvent, UIEvent)
-NS_IMPL_RELEASE_INHERITED(InputEvent, UIEvent)
-
-NS_INTERFACE_MAP_BEGIN(InputEvent)
-NS_INTERFACE_MAP_END_INHERITING(UIEvent)
-
 bool
 InputEvent::IsComposing()
 {
   return mEvent->AsEditorInputEvent()->mIsComposing;
 }
 
 already_AddRefed<InputEvent>
 InputEvent::Constructor(const GlobalObject& aGlobal,
--- a/dom/events/InputEvent.h
+++ b/dom/events/InputEvent.h
@@ -16,17 +16,17 @@ namespace dom {
 
 class InputEvent : public UIEvent
 {
 public:
   InputEvent(EventTarget* aOwner,
              nsPresContext* aPresContext,
              InternalEditorInputEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(InputEvent, UIEvent)
 
   // Forward to base class
   NS_FORWARD_TO_UIEVENT
 
 
   static already_AddRefed<InputEvent> Constructor(const GlobalObject& aGlobal,
                                                   const nsAString& aType,
                                                   const InputEventInit& aParam,
--- a/dom/events/KeyboardEvent.cpp
+++ b/dom/events/KeyboardEvent.cpp
@@ -26,22 +26,16 @@ KeyboardEvent::KeyboardEvent(EventTarget
   }
   else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
     mEvent->AsKeyboardEvent()->mKeyNameIndex = KEY_NAME_INDEX_USE_STRING;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(KeyboardEvent, UIEvent)
-NS_IMPL_RELEASE_INHERITED(KeyboardEvent, UIEvent)
-
-NS_INTERFACE_MAP_BEGIN(KeyboardEvent)
-NS_INTERFACE_MAP_END_INHERITING(UIEvent)
-
 bool
 KeyboardEvent::AltKey(CallerType aCallerType)
 {
   bool altState = mEvent->AsKeyboardEvent()->IsAlt();
 
   if (!ShouldResistFingerprinting(aCallerType)) {
     return altState;
   }
--- a/dom/events/KeyboardEvent.h
+++ b/dom/events/KeyboardEvent.h
@@ -17,17 +17,17 @@ namespace dom {
 
 class KeyboardEvent : public UIEvent
 {
 public:
   KeyboardEvent(EventTarget* aOwner,
                 nsPresContext* aPresContext,
                 WidgetKeyboardEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(KeyboardEvent, UIEvent)
 
   virtual KeyboardEvent* AsKeyboardEvent() override
   {
     return this;
   }
 
   static already_AddRefed<KeyboardEvent> Constructor(
                                            const GlobalObject& aGlobal,
--- a/dom/events/MouseScrollEvent.cpp
+++ b/dom/events/MouseScrollEvent.cpp
@@ -27,22 +27,16 @@ MouseScrollEvent::MouseScrollEvent(Event
     mEvent->mRefPoint = LayoutDeviceIntPoint(0, 0);
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 
   mDetail = mEvent->AsMouseScrollEvent()->mDelta;
 }
 
-NS_IMPL_ADDREF_INHERITED(MouseScrollEvent, MouseEvent)
-NS_IMPL_RELEASE_INHERITED(MouseScrollEvent, MouseEvent)
-
-NS_INTERFACE_MAP_BEGIN(MouseScrollEvent)
-NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
-
 void
 MouseScrollEvent::InitMouseScrollEvent(const nsAString& aType,
                                        bool aCanBubble,
                                        bool aCancelable,
                                        nsGlobalWindowInner* aView,
                                        int32_t aDetail,
                                        int32_t aScreenX,
                                        int32_t aScreenY,
--- a/dom/events/MouseScrollEvent.h
+++ b/dom/events/MouseScrollEvent.h
@@ -15,17 +15,17 @@ namespace dom {
 
 class MouseScrollEvent : public MouseEvent
 {
 public:
   MouseScrollEvent(EventTarget* aOwner,
                    nsPresContext* aPresContext,
                    WidgetMouseScrollEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(MouseScrollEvent, MouseEvent)
 
   // Forward to base class
   NS_FORWARD_TO_MOUSEEVENT
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return MouseScrollEventBinding::Wrap(aCx, this, aGivenProto);
   }
--- a/dom/events/MutationEvent.cpp
+++ b/dom/events/MutationEvent.cpp
@@ -17,22 +17,16 @@ MutationEvent::MutationEvent(EventTarget
                              nsPresContext* aPresContext,
                              InternalMutationEvent* aEvent)
   : Event(aOwner, aPresContext,
           aEvent ? aEvent : new InternalMutationEvent(false, eVoidEvent))
 {
   mEventIsInternal = (aEvent == nullptr);
 }
 
-NS_INTERFACE_MAP_BEGIN(MutationEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-NS_IMPL_ADDREF_INHERITED(MutationEvent, Event)
-NS_IMPL_RELEASE_INHERITED(MutationEvent, Event)
-
 already_AddRefed<nsINode>
 MutationEvent::GetRelatedNode()
 {
   nsCOMPtr<nsINode> n =
     do_QueryInterface(mEvent->AsMutationEvent()->mRelatedNode);
   return n.forget();
 }
 
--- a/dom/events/MutationEvent.h
+++ b/dom/events/MutationEvent.h
@@ -17,17 +17,17 @@ namespace dom {
 
 class MutationEvent : public Event
 {
 public:
   MutationEvent(EventTarget* aOwner,
                 nsPresContext* aPresContext,
                 InternalMutationEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(MutationEvent, Event)
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return MutationEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   void GetPrevValue(nsAString& aPrevValue) const;
   void GetNewValue(nsAString& aNewValue) const;
--- a/dom/events/SimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.cpp
@@ -28,22 +28,16 @@ SimpleGestureEvent::SimpleGestureEvent(E
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
     mEvent->mRefPoint = LayoutDeviceIntPoint(0, 0);
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(SimpleGestureEvent, MouseEvent)
-NS_IMPL_RELEASE_INHERITED(SimpleGestureEvent, MouseEvent)
-
-NS_INTERFACE_MAP_BEGIN(SimpleGestureEvent)
-NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
-
 uint32_t
 SimpleGestureEvent::AllowedDirections() const
 {
   return mEvent->AsSimpleGestureEvent()->mAllowedDirections;
 }
 
 void
 SimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
--- a/dom/events/SimpleGestureEvent.h
+++ b/dom/events/SimpleGestureEvent.h
@@ -18,17 +18,17 @@ namespace dom {
 
 class SimpleGestureEvent : public MouseEvent
 {
 public:
   SimpleGestureEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      WidgetSimpleGestureEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(SimpleGestureEvent, MouseEvent)
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return SimpleGestureEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   uint32_t AllowedDirections() const;
   void SetAllowedDirections(uint32_t aAllowedDirections);
--- a/dom/events/TransitionEvent.cpp
+++ b/dom/events/TransitionEvent.cpp
@@ -21,22 +21,16 @@ TransitionEvent::TransitionEvent(EventTa
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
   }
 }
 
-NS_INTERFACE_MAP_BEGIN(TransitionEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-NS_IMPL_ADDREF_INHERITED(TransitionEvent, Event)
-NS_IMPL_RELEASE_INHERITED(TransitionEvent, Event)
-
 // static
 already_AddRefed<TransitionEvent>
 TransitionEvent::Constructor(const GlobalObject& aGlobal,
                              const nsAString& aType,
                              const TransitionEventInit& aParam,
                              ErrorResult& aRv)
 {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
--- a/dom/events/TransitionEvent.h
+++ b/dom/events/TransitionEvent.h
@@ -16,17 +16,17 @@ namespace dom {
 
 class TransitionEvent : public Event
 {
 public:
   TransitionEvent(EventTarget* aOwner,
                   nsPresContext* aPresContext,
                   InternalTransitionEvent* aEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(TransitionEvent, Event)
 
   static already_AddRefed<TransitionEvent>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
               const TransitionEventInit& aParam,
               ErrorResult& aRv);
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
--- a/dom/events/WheelEvent.cpp
+++ b/dom/events/WheelEvent.cpp
@@ -31,22 +31,16 @@ WheelEvent::WheelEvent(EventTarget* aOwn
   } else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
     mEvent->mRefPoint = LayoutDeviceIntPoint(0, 0);
     mEvent->AsWheelEvent()->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(WheelEvent, MouseEvent)
-NS_IMPL_RELEASE_INHERITED(WheelEvent, MouseEvent)
-
-NS_INTERFACE_MAP_BEGIN(WheelEvent)
-NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
-
 void
 WheelEvent::InitWheelEvent(const nsAString& aType,
                            bool aCanBubble,
                            bool aCancelable,
                            nsGlobalWindowInner* aView,
                            int32_t aDetail,
                            int32_t aScreenX,
                            int32_t aScreenY,
--- a/dom/events/WheelEvent.h
+++ b/dom/events/WheelEvent.h
@@ -16,17 +16,17 @@ namespace dom {
 
 class WheelEvent : public MouseEvent
 {
 public:
   WheelEvent(EventTarget* aOwner,
              nsPresContext* aPresContext,
              WidgetWheelEvent* aWheelEvent);
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(WheelEvent, MouseEvent)
 
   // Forward to base class
   NS_FORWARD_TO_MOUSEEVENT
 
   static
   already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
                                            const nsAString& aType,
                                            const WheelEventInit& aParam,
--- a/dom/svg/SVGPolyElement.cpp
+++ b/dom/svg/SVGPolyElement.cpp
@@ -8,25 +8,16 @@
 #include "DOMSVGPointList.h"
 #include "mozilla/gfx/2D.h"
 #include "SVGContentUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 //----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ADDREF_INHERITED(SVGPolyElement,SVGPolyElementBase)
-NS_IMPL_RELEASE_INHERITED(SVGPolyElement,SVGPolyElementBase)
-
-NS_INTERFACE_MAP_BEGIN(SVGPolyElement)
-NS_INTERFACE_MAP_END_INHERITING(SVGPolyElementBase)
-
-//----------------------------------------------------------------------
 // Implementation
 
 SVGPolyElement::SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGPolyElementBase(aNodeInfo)
 {
 }
 
 SVGPolyElement::~SVGPolyElement()
--- a/dom/svg/SVGPolyElement.h
+++ b/dom/svg/SVGPolyElement.h
@@ -23,17 +23,17 @@ class SVGPolyElement : public SVGPolyEle
 protected:
   explicit SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
 
   virtual ~SVGPolyElement();
 
 public:
   //interfaces
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase)
 
   // nsIContent interface
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
 
   virtual SVGAnimatedPointList* GetAnimatedPointList() override {
     return &mPoints;
   }
   virtual nsAtom* GetPointListAttrName() const override {
--- a/dom/svg/nsSVGFilters.cpp
+++ b/dom/svg/nsSVGFilters.cpp
@@ -450,25 +450,16 @@ nsSVGElement::NumberPairInfo nsSVGFELigh
 
 nsSVGElement::StringInfo nsSVGFELightingElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ADDREF_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase)
-NS_IMPL_RELEASE_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase)
-
-NS_INTERFACE_MAP_BEGIN(nsSVGFELightingElement)
-NS_INTERFACE_MAP_END_INHERITING(nsSVGFELightingElementBase)
-
-//----------------------------------------------------------------------
 // Implementation
 
 NS_IMETHODIMP_(bool)
 nsSVGFELightingElement::IsAttributeMapped(const nsAtom* name) const
 {
   static const MappedAttributeEntry* const map[] = {
     sLightingEffectsMap
   };
--- a/dom/svg/nsSVGFilters.h
+++ b/dom/svg/nsSVGFilters.h
@@ -178,17 +178,18 @@ class nsSVGFELightingElement : public ns
 protected:
   explicit nsSVGFELightingElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
     : nsSVGFELightingElementBase(aNodeInfo) {}
 
   virtual ~nsSVGFELightingElement() {}
 
 public:
   // interfaces:
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(nsSVGFELightingElement,
+                                       nsSVGFELightingElementBase)
 
   virtual bool AttributeAffectsRendering(
           int32_t aNameSpaceID, nsAtom* aAttribute) const override;
   virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
   virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
   NS_FORWARD_NSIDOMELEMENT(nsSVGFELightingElementBase::)
 
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
--- a/layout/style/ServoNamespaceRule.cpp
+++ b/layout/style/ServoNamespaceRule.cpp
@@ -11,22 +11,16 @@
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 ServoNamespaceRule::~ServoNamespaceRule()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(ServoNamespaceRule, CSSNamespaceRule)
-NS_IMPL_RELEASE_INHERITED(ServoNamespaceRule, CSSNamespaceRule)
-
-NS_INTERFACE_MAP_BEGIN(ServoNamespaceRule)
-NS_INTERFACE_MAP_END_INHERITING(CSSNamespaceRule)
-
 #ifdef DEBUG
 void
 ServoNamespaceRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
--- a/layout/style/ServoNamespaceRule.h
+++ b/layout/style/ServoNamespaceRule.h
@@ -17,17 +17,18 @@ class ServoNamespaceRule : public dom::C
 public:
   ServoNamespaceRule(already_AddRefed<RawServoNamespaceRule> aRule,
                      uint32_t aLine, uint32_t aColumn)
     : CSSNamespaceRule(aLine, aColumn)
     , mRawRule(Move(aRule))
   {
   }
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(ServoNamespaceRule,
+                                       dom::CSSNamespaceRule)
 
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final override;
 #endif
   already_AddRefed<Rule> Clone() const final override;
 
   nsAtom* GetPrefix() const final override;
   void GetURLSpec(nsString& aURLSpec) const final override;
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -385,23 +385,16 @@ DocumentRule::DocumentRule(const Documen
   , mURLs(new URL(*aCopy.mURLs))
 {
 }
 
 DocumentRule::~DocumentRule()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(DocumentRule, ConditionRule)
-NS_IMPL_RELEASE_INHERITED(DocumentRule, ConditionRule)
-
-// QueryInterface implementation for DocumentRule
-NS_INTERFACE_MAP_BEGIN(DocumentRule)
-NS_INTERFACE_MAP_END_INHERITING(dom::CSSMozDocumentRule)
-
 #ifdef DEBUG
 /* virtual */ void
 DocumentRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString indentStr;
   for (int32_t indent = aIndent; --indent >= 0; ) {
     indentStr.AppendLiteral("  ");
   }
@@ -1464,23 +1457,16 @@ CSSSupportsRule::Clone() const
 
 /* virtual */ bool
 CSSSupportsRule::UseForPresentation(nsPresContext* aPresContext,
                                    nsMediaQueryResultCacheKey& aKey)
 {
   return mUseGroup;
 }
 
-NS_IMPL_ADDREF_INHERITED(mozilla::CSSSupportsRule, dom::CSSSupportsRule)
-NS_IMPL_RELEASE_INHERITED(mozilla::CSSSupportsRule, dom::CSSSupportsRule)
-
-// QueryInterface implementation for CSSSupportsRule
-NS_INTERFACE_MAP_BEGIN(CSSSupportsRule)
-NS_INTERFACE_MAP_END_INHERITING(dom::CSSSupportsRule)
-
 void
 CSSSupportsRule::GetCssText(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@supports ");
   aCssText.Append(mCondition);
   css::GroupRule::AppendRulesToCssText(aCssText);
 }
 
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -94,17 +94,18 @@ class DocumentRule final : public dom::C
 {
 public:
   DocumentRule(uint32_t aLineNumber, uint32_t aColumnNumber);
 private:
   DocumentRule(const DocumentRule& aCopy);
   ~DocumentRule();
 public:
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(DocumentRule,
+                                       dom::CSSMozDocumentRule)
 
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<Rule> Clone() const override;
 
   // rest of GroupRule
@@ -400,17 +401,18 @@ public:
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                   nsMediaQueryResultCacheKey& aKey) override;
 
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(CSSSupportsRule,
+                                       dom::CSSSupportsRule)
 
   // WebIDL interface
   void GetCssText(nsAString& aCssText) const final override;
   void GetConditionText(nsAString& aConditionText) final override;
   void SetConditionText(const nsAString& aConditionText,
                         ErrorResult& aRv) final override;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
--- a/layout/xul/PopupBoxObject.cpp
+++ b/layout/xul/PopupBoxObject.cpp
@@ -17,21 +17,16 @@
 #include "mozilla/dom/PopupBoxObject.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/PopupBoxObjectBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(PopupBoxObject, BoxObject)
-NS_IMPL_RELEASE_INHERITED(PopupBoxObject, BoxObject)
-NS_INTERFACE_MAP_BEGIN(PopupBoxObject)
-NS_INTERFACE_MAP_END_INHERITING(BoxObject)
-
 PopupBoxObject::PopupBoxObject()
 {
 }
 
 PopupBoxObject::~PopupBoxObject()
 {
 }
 
--- a/layout/xul/PopupBoxObject.h
+++ b/layout/xul/PopupBoxObject.h
@@ -22,17 +22,17 @@ namespace dom {
 
 class DOMRect;
 class Element;
 class Event;
 
 class PopupBoxObject final : public BoxObject
 {
 public:
-  NS_DECL_ISUPPORTS_INHERITED
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(PopupBoxObject, BoxObject)
 
   // also in PopupBoxObject.webidl
   static const uint32_t ROLLUP_DEFAULT = 0;   /* widget/platform default */
   static const uint32_t ROLLUP_CONSUME = 1;   /* consume the rollup event */
   static const uint32_t ROLLUP_NO_CONSUME = 2; /* don't consume the rollup event */
 
   PopupBoxObject();