Bug 577976 - Part 2: Remove forwarding methods to nsCSSRule from Rule classes, r=bzbarsky
authorCraig Topper <craig.topper@gmail.com>
Sat, 07 Aug 2010 22:30:57 -0700
changeset 64681 f2685fc02b6bea19c3406875f6dd5d7b2fcf078a
parent 64680 592aacaf042d61e425d8cf05d4339b6a0bb2b1d3
child 64682 7e119e22b856b359b201601934bd194194d8cd98
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs577976
milestone2.2a1pre
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 577976 - Part 2: Remove forwarding methods to nsCSSRule from Rule classes, r=bzbarsky
layout/style/GroupRule.h
layout/style/ImportRule.h
layout/style/StyleRule.cpp
layout/style/StyleRule.h
layout/style/nsCSSRule.h
layout/style/nsCSSRules.cpp
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -70,16 +70,17 @@ protected:
 public:
 
   // Implement part of nsISupports.
   NS_IMETHOD_(nsrefcnt) AddRef();
   NS_IMETHOD_(nsrefcnt) Release();
 
   // implement part of nsIStyleRule and nsICSSRule
   DECL_STYLE_RULE_INHERIT_NO_DOMRULE
+  virtual void SetStyleSheet(nsCSSStyleSheet* aSheet);
 
   // to help implement nsIStyleRule
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 
 public:
   void AppendStyleRule(nsICSSRule* aRule);
--- a/layout/style/ImportRule.h
+++ b/layout/style/ImportRule.h
@@ -59,16 +59,20 @@ private:
   // for |Clone|
   ImportRule(const ImportRule& aCopy);
   ~ImportRule();
 public:
   NS_DECL_ISUPPORTS
 
   DECL_STYLE_RULE_INHERIT
 
+#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
+  using nsCSSRule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
+#endif
+
   // nsIStyleRule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
 #endif
 
   // nsICSSRule methods
   virtual PRInt32 GetType() const;
   virtual already_AddRefed<nsICSSRule> Clone() const;
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1371,35 +1371,16 @@ StyleRule::RuleMatched()
     mWasMatched = PR_TRUE;
     mDeclaration->SetImmutable();
     if (mDeclaration->HasImportantData()) {
       NS_ADDREF(mImportantRule = new ImportantRule(mDeclaration));
     }
   }
 }
 
-/* virtual */ already_AddRefed<nsIStyleSheet>
-StyleRule::GetStyleSheet() const
-{
-// XXX What about inner, etc.
-  return nsCSSRule::GetStyleSheet();
-}
-
-/* virtual */ void
-StyleRule::SetStyleSheet(nsCSSStyleSheet* aSheet)
-{
-  nsCSSRule::SetStyleSheet(aSheet);
-}
-
-/* virtual */ void
-StyleRule::SetParentRule(GroupRule* aRule)
-{
-  nsCSSRule::SetParentRule(aRule);
-}
-
 /* virtual */ PRInt32
 StyleRule::GetType() const
 {
   return nsICSSRule::STYLE_RULE;
 }
 
 /* virtual */ already_AddRefed<nsICSSRule>
 StyleRule::Clone() const
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -343,20 +343,16 @@ public:
   void SetCssText(const nsAString& aCssText);
   nsCSSStyleSheet* GetParentStyleSheet() { return mSheet; }
   GroupRule* GetParentRule() { return mParentRule; }
   void GetSelectorText(nsAString& aSelectorText);
   void SetSelectorText(const nsAString& aSelectorText);
 
   virtual PRInt32 GetType() const;
 
-  virtual already_AddRefed<nsIStyleSheet> GetStyleSheet() const;
-  virtual void SetStyleSheet(nsCSSStyleSheet* aSheet);
-  virtual void SetParentRule(GroupRule* aRule);
-
   virtual already_AddRefed<nsICSSRule> Clone() const;
 
   nsIDOMCSSRule* GetDOMRuleWeak(nsresult* aResult);
 
   // The new mapping function.
   virtual void MapRuleInfoInto(nsRuleData* aRuleData);
 
 #ifdef DEBUG
--- a/layout/style/nsCSSRule.h
+++ b/layout/style/nsCSSRule.h
@@ -49,19 +49,16 @@ template<class T> struct already_AddRefe
 
 namespace mozilla {
 namespace css {
 class GroupRule;
 }
 }
 
 #define DECL_STYLE_RULE_INHERIT_NO_DOMRULE  \
-virtual already_AddRefed<nsIStyleSheet> GetStyleSheet() const; \
-virtual void SetStyleSheet(nsCSSStyleSheet* aSheet); \
-virtual void SetParentRule(mozilla::css::GroupRule* aRule); \
 virtual void MapRuleInfoInto(nsRuleData* aRuleData);
 
 #define DECL_STYLE_RULE_INHERIT  \
 DECL_STYLE_RULE_INHERIT_NO_DOMRULE \
 virtual nsIDOMCSSRule* GetDOMRuleWeak(nsresult* aResult);
 
 class nsCSSRule : public nsICSSRule {
 protected:
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -66,25 +66,20 @@
 #include "nsDOMError.h"
 #include "nsStyleUtil.h"
 #include "mozilla/css/Declaration.h"
 #include "nsPrintfCString.h"
 
 namespace css = mozilla::css;
 
 #define IMPL_STYLE_RULE_INHERIT(_class, super) \
-/* virtual */ already_AddRefed<nsIStyleSheet> _class::GetStyleSheet() const { return super::GetStyleSheet(); }  \
-/* virtual */ void _class::SetStyleSheet(nsCSSStyleSheet* aSheet) { super::SetStyleSheet(aSheet); }  \
-/* virtual */ void _class::SetParentRule(css::GroupRule* aRule) { super::SetParentRule(aRule); }  \
 nsIDOMCSSRule* _class::GetDOMRuleWeak(nsresult *aResult) { *aResult = NS_OK; return this; }  \
 /* virtual */ void _class::MapRuleInfoInto(nsRuleData* aRuleData) { }
 
 #define IMPL_STYLE_RULE_INHERIT2(_class, super) \
-/* virtual */ already_AddRefed<nsIStyleSheet> _class::GetStyleSheet() const { return super::GetStyleSheet(); }  \
-/* virtual */ void  _class::SetParentRule(css::GroupRule* aRule) { super::SetParentRule(aRule); }  \
 /* virtual */ void _class::MapRuleInfoInto(nsRuleData* aRuleData) { }
 
 
 // base class for all rule types in a CSS style sheet
 
 /* virtual */ already_AddRefed<nsIStyleSheet>
 nsCSSRule::GetStyleSheet() const
 {