diff --git a/layout/style/Rule.h b/layout/style/Rule.h index f00490efe0de..6b5af0954b13 100644 --- a/layout/style/Rule.h +++ b/layout/style/Rule.h @@ -27,8 +27,7 @@ class GroupRule; #define DECL_STYLE_RULE_INHERIT \ DECL_STYLE_RULE_INHERIT_NO_DOMRULE \ - virtual nsIDOMCSSRule* GetDOMRule() override; \ - virtual nsIDOMCSSRule* GetExistingDOMRule() override; + virtual nsIDOMCSSRule* GetDOMRule() override; class Rule : public nsISupports { protected: @@ -113,9 +112,6 @@ public: // supposed to have a DOM rule representation (and our code wouldn't work). virtual nsIDOMCSSRule* GetDOMRule() = 0; - // Like GetDOMRule(), but won't create one if we don't have one yet - virtual nsIDOMCSSRule* GetExistingDOMRule() = 0; - // to implement methods on nsIDOMCSSRule nsresult GetParentRule(nsIDOMCSSRule** aParentRule); nsresult GetParentStyleSheet(nsIDOMCSSStyleSheet** aSheet); diff --git a/layout/style/ServoStyleRule.h b/layout/style/ServoStyleRule.h index 40d2a2444e3a..03d8f4d43fe9 100644 --- a/layout/style/ServoStyleRule.h +++ b/layout/style/ServoStyleRule.h @@ -65,7 +65,6 @@ public: int32_t GetType() const final { return css::Rule::STYLE_RULE; } already_AddRefed Clone() const final; nsIDOMCSSRule* GetDOMRule() final { return this; } - nsIDOMCSSRule* GetExistingDOMRule() final { return this; } size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final; #ifdef DEBUG void List(FILE* out = stdout, int32_t aIndent = 0) const final; diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index 9e282a3ebbab..d3740f720ba0 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -1464,12 +1464,6 @@ StyleRule::GetDOMRule() return mDOMRule; } -/* virtual */ nsIDOMCSSRule* -StyleRule::GetExistingDOMRule() -{ - return mDOMRule; -} - void StyleRule::SetDeclaration(Declaration* aDecl) { diff --git a/layout/style/StyleRule.h b/layout/style/StyleRule.h index e217c473d088..392164957ac7 100644 --- a/layout/style/StyleRule.h +++ b/layout/style/StyleRule.h @@ -348,8 +348,6 @@ public: virtual nsIDOMCSSRule* GetDOMRule() override; - virtual nsIDOMCSSRule* GetExistingDOMRule() override; - #ifdef DEBUG virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override; #endif @@ -359,6 +357,10 @@ public: private: ~StyleRule(); + // Drop our references to mDeclaration and mRule, and let them know we're + // doing that. + void DropReferences(); + private: nsCSSSelectorList* mSelector; // null for style attribute RefPtr mDeclaration; diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index af21220b5762..1530648e7104 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -43,8 +43,6 @@ using namespace mozilla::dom; #define IMPL_STYLE_RULE_INHERIT_GET_DOM_RULE_WEAK(class_, super_) \ /* virtual */ nsIDOMCSSRule* class_::GetDOMRule() \ - { return this; } \ - /* virtual */ nsIDOMCSSRule* class_::GetExistingDOMRule() \ { return this; } #define IMPL_STYLE_RULE_INHERIT(class_, super_) \ @@ -839,7 +837,6 @@ NS_INTERFACE_MAP_BEGIN(DocumentRule) NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule) NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule) NS_INTERFACE_MAP_ENTRY(nsIDOMCSSMozDocumentRule) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozilla::css::Rule) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSMozDocumentRule) NS_INTERFACE_MAP_END_INHERITING(GroupRule) diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index c70f195f65af..9dc792d8f300 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -72,10 +72,6 @@ public: { return this; } - virtual nsIDOMCSSRule* GetExistingDOMRule() override - { - return this; - } // nsIDOMCSSRule interface NS_DECL_NSIDOMCSSRULE @@ -127,10 +123,6 @@ public: { return this; } - virtual nsIDOMCSSRule* GetExistingDOMRule() override - { - return this; - } // nsIDOMCSSRule interface NS_DECL_NSIDOMCSSRULE @@ -457,10 +449,6 @@ public: { return this; } - virtual nsIDOMCSSRule* GetExistingDOMRule() override - { - return this; - } // nsIDOMCSSRule interface NS_DECL_NSIDOMCSSRULE @@ -575,10 +563,6 @@ public: { return this; } - virtual nsIDOMCSSRule* GetExistingDOMRule() override - { - return this; - } NS_DECL_ISUPPORTS_INHERITED