Bug 1427512 - Part 17: Remove nsICSSStyleRuleDOMWrapper. r=xidorn
This interface is unused since
bug 1427419.
MozReview-Commit-ID: HJH628fhfK6
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -19,17 +19,16 @@
#include "nsIDOMElement.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIDOMDocument.h"
#include "nsIDOMCharacterData.h"
#include "nsRuleNode.h"
#include "nsIStyleRule.h"
#include "mozilla/css/StyleRule.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
#include "nsIDOMWindow.h"
#include "nsXBLBinding.h"
#include "nsXBLPrototypeBinding.h"
#include "nsIMutableArray.h"
#include "nsBindingManager.h"
#include "ChildIterator.h"
#include "nsComputedDOMStyle.h"
#include "mozilla/EventStateManager.h"
--- a/layout/style/ServoStyleRule.cpp
+++ b/layout/style/ServoStyleRule.cpp
@@ -120,23 +120,17 @@ ServoStyleRuleDeclaration::GetServoCSSPa
ServoStyleRule::ServoStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
uint32_t aLine, uint32_t aColumn)
: BindingStyleRule(aLine, aColumn)
, mRawRule(aRawRule)
, mDecls(Servo_StyleRule_GetStyle(mRawRule).Consume())
{
}
-// QueryInterface implementation for ServoStyleRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ServoStyleRule)
- NS_INTERFACE_MAP_ENTRY(nsICSSStyleRuleDOMWrapper)
-NS_INTERFACE_MAP_END_INHERITING(css::Rule)
-
-NS_IMPL_ADDREF_INHERITED(ServoStyleRule, css::Rule)
-NS_IMPL_RELEASE_INHERITED(ServoStyleRule, css::Rule)
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(ServoStyleRule, css::Rule)
NS_IMPL_CYCLE_COLLECTION_CLASS(ServoStyleRule)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ServoStyleRule, css::Rule)
// Keep this in sync with IsCCLeaf.
// Trace the wrapper for our declaration. This just expands out
// NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
@@ -198,25 +192,16 @@ ServoStyleRule::List(FILE* out, int32_t
for (int32_t i = 0; i < aIndent; i++) {
str.AppendLiteral(" ");
}
Servo_StyleRule_Debug(mRawRule, &str);
fprintf_stderr(out, "%s\n", str.get());
}
#endif
-/* nsICSSStyleRuleDOMWrapper implementation */
-
-NS_IMETHODIMP
-ServoStyleRule::GetCSSStyleRule(BindingStyleRule **aResult)
-{
- NS_ADDREF(*aResult = this);
- return NS_OK;
-}
-
/* CSSRule implementation */
uint16_t
ServoStyleRule::Type() const
{
return CSSRuleBinding::STYLE_RULE;
}
--- a/layout/style/ServoStyleRule.h
+++ b/layout/style/ServoStyleRule.h
@@ -8,18 +8,16 @@
#ifndef mozilla_ServoStyleRule_h
#define mozilla_ServoStyleRule_h
#include "mozilla/BindingStyleRule.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/WeakPtr.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
#include "nsDOMCSSDeclaration.h"
namespace mozilla {
namespace dom {
class DocGroup;
} // namespace dom
@@ -54,33 +52,29 @@ private:
inline ServoStyleRule* Rule();
inline const ServoStyleRule* Rule() const;
RefPtr<ServoDeclarationBlock> mDecls;
};
class ServoStyleRule final : public BindingStyleRule
- , public nsICSSStyleRuleDOMWrapper
, public SupportsWeakPtr<ServoStyleRule>
{
public:
ServoStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
uint32_t aLine, uint32_t aColumn);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(ServoStyleRule,
css::Rule)
bool IsCCLeaf() const final MOZ_MUST_OVERRIDE;
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(ServoStyleRule)
- // nsICSSStyleRuleDOMWrapper
- NS_IMETHOD GetCSSStyleRule(BindingStyleRule **aResult) override;
-
uint32_t GetSelectorCount() override;
nsresult GetSelectorText(uint32_t aSelectorIndex,
nsAString& aText) override;
nsresult GetSpecificity(uint32_t aSelectorIndex,
uint64_t* aSpecificity) override;
nsresult SelectorMatchesElement(dom::Element* aElement,
uint32_t aSelectorIndex,
const nsAString& aPseudo,
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1189,24 +1189,16 @@ nsICSSDeclaration*
StyleRule::Style()
{
if (!mDOMDeclaration) {
mDOMDeclaration.reset(new DOMCSSDeclarationImpl(this));
}
return mDOMDeclaration.get();
}
-NS_IMETHODIMP
-StyleRule::GetCSSStyleRule(BindingStyleRule **aResult)
-{
- *aResult = this;
- NS_ADDREF(*aResult);
- return NS_OK;
-}
-
StyleRule::StyleRule(nsCSSSelectorList* aSelector,
Declaration* aDeclaration,
uint32_t aLineNumber,
uint32_t aColumnNumber)
: BindingStyleRule(aLineNumber, aColumnNumber),
mSelector(aSelector),
mDeclaration(aDeclaration)
{
@@ -1242,17 +1234,16 @@ StyleRule::DropReferences()
// QueryInterface implementation for StyleRule
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleRule)
if (aIID.Equals(NS_GET_IID(mozilla::css::StyleRule))) {
*aInstancePtr = this;
NS_ADDREF_THIS();
return NS_OK;
}
else
- NS_INTERFACE_MAP_ENTRY(nsICSSStyleRuleDOMWrapper)
NS_INTERFACE_MAP_END_INHERITING(Rule)
NS_IMPL_ADDREF_INHERITED(StyleRule, Rule)
NS_IMPL_RELEASE_INHERITED(StyleRule, Rule)
NS_IMPL_CYCLE_COLLECTION_CLASS(StyleRule)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(StyleRule, Rule)
// Keep this in sync with IsCCLeaf.
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -17,17 +17,16 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/UniquePtr.h"
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsCSSPseudoElements.h"
#include "nsIStyleRule.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
class nsAtom;
struct nsCSSSelectorList;
namespace mozilla {
enum class CSSPseudoClassType : uint8_t;
class CSSStyleSheet;
} // namespace mozilla
@@ -313,35 +312,31 @@ private:
class DOMCSSDeclarationImpl;
namespace mozilla {
namespace css {
class Declaration;
class StyleRule final : public BindingStyleRule
- , public nsICSSStyleRuleDOMWrapper
{
public:
StyleRule(nsCSSSelectorList* aSelector,
Declaration *aDeclaration,
uint32_t aLineNumber, uint32_t aColumnNumber);
private:
// for |Clone|
StyleRule(const StyleRule& aCopy);
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_RULE_IMPL_CID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(StyleRule, Rule)
bool IsCCLeaf() const override;
- // nsICSSStyleRuleDOMWrapper
- NS_IMETHOD GetCSSStyleRule(BindingStyleRule **aResult) override;
-
uint32_t GetSelectorCount() override;
nsresult GetSelectorText(uint32_t aSelectorIndex,
nsAString& aText) override;
nsresult GetSpecificity(uint32_t aSelectorIndex,
uint64_t* aSpecificity) override;
nsresult SelectorMatchesElement(dom::Element* aElement,
uint32_t aSelectorIndex,
const nsAString& aPseudo,
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -50,17 +50,16 @@ EXPORTS += [
'nsCSSRuleProcessor.h',
'nsCSSScanner.h',
'nsCSSValue.h',
'nsDOMCSSAttrDeclaration.h',
'nsDOMCSSDeclaration.h',
'nsDOMCSSRGBColor.h',
'nsICSSDeclaration.h',
'nsICSSLoaderObserver.h',
- 'nsICSSStyleRuleDOMWrapper.h',
'nsIStyleRule.h',
'nsIStyleRuleProcessor.h',
'nsLayoutStylesheetCache.h',
'nsMediaFeatures.h',
'nsMediaList.h',
'nsRuleData.h',
'nsRuleNode.h',
'nsRuleProcessorData.h',
deleted file mode 100644
--- a/layout/style/nsICSSStyleRuleDOMWrapper.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-/*
- * interface to provide DOM inspector with access to internal interfaces
- * via DOM interface
- */
-
-#ifndef nsICSSStyleRuleDOMWrapper_h_
-#define nsICSSStyleRuleDOMWrapper_h_
-
-// IID for the nsICSSStyleRuleDOMWrapper interface
-// {cee1bbb6-0a32-4cf3-8d42-ba3938e9ecaa}
-#define NS_ICSS_STYLE_RULE_DOM_WRAPPER_IID \
-{0xcee1bbb6, 0x0a32, 0x4cf3, {0x8d, 0x42, 0xba, 0x39, 0x38, 0xe9, 0xec, 0xaa}}
-
-namespace mozilla {
-class BindingStyleRule;
-} // namespace mozilla
-
-class nsICSSStyleRuleDOMWrapper : public nsISupports {
-public:
- NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSS_STYLE_RULE_DOM_WRAPPER_IID)
-
- NS_IMETHOD GetCSSStyleRule(mozilla::BindingStyleRule** aResult) = 0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSStyleRuleDOMWrapper,
- NS_ICSS_STYLE_RULE_DOM_WRAPPER_IID)
-
-#endif /* !defined(nsICSSStyleRuleDOMWrapper_h_) */