Bug 529750 part 4. Move GetImportantRule to css::StyleRule. r=dbaron

This commit is contained in:
Boris Zbarsky 2011-05-23 16:45:44 -04:00
parent 9321056fc8
commit 3ca13a1c7c
3 changed files with 26 additions and 34 deletions

View File

@ -878,31 +878,6 @@ nsCSSSelectorList::Clone(PRBool aDeep) const
namespace mozilla {
namespace css {
class StyleRule;
class ImportantRule : public nsIStyleRule {
public:
ImportantRule(Declaration *aDeclaration);
NS_DECL_ISUPPORTS
// nsIStyleRule interface
virtual void MapRuleInfoInto(nsRuleData* aRuleData);
#ifdef DEBUG
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
#endif
protected:
virtual ~ImportantRule();
// Not an owning reference; the StyleRule that owns this
// ImportantRule also owns the mDeclaration, and any rule node
// pointing to this rule keeps that StyleRule alive as well.
Declaration* mDeclaration;
friend class css::StyleRule;
};
ImportantRule::ImportantRule(Declaration* aDeclaration)
: mDeclaration(aDeclaration)
{
@ -1307,11 +1282,6 @@ NS_INTERFACE_MAP_END
NS_IMPL_ADDREF_INHERITED(StyleRule, Rule)
NS_IMPL_RELEASE_INHERITED(StyleRule, Rule)
nsIStyleRule* StyleRule::GetImportantRule()
{
return mImportantRule;
}
void
StyleRule::RuleMatched()
{

View File

@ -291,9 +291,33 @@ namespace mozilla {
namespace css {
class Declaration;
class ImportantRule;
class DOMCSSStyleRule;
class StyleRule;
class ImportantRule : public nsIStyleRule {
public:
ImportantRule(Declaration *aDeclaration);
NS_DECL_ISUPPORTS
// nsIStyleRule interface
virtual void MapRuleInfoInto(nsRuleData* aRuleData);
#ifdef DEBUG
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
#endif
protected:
virtual ~ImportantRule();
// Not an owning reference; the StyleRule that owns this
// ImportantRule also owns the mDeclaration, and any rule node
// pointing to this rule keeps that StyleRule alive as well.
Declaration* mDeclaration;
friend class StyleRule;
};
class NS_FINAL_CLASS StyleRule : public Rule
{
public:
@ -330,7 +354,7 @@ public:
already_AddRefed<StyleRule>
DeclarationChanged(Declaration* aDecl, PRBool aHandleContainer);
nsIStyleRule* GetImportantRule();
nsIStyleRule* GetImportantRule() const { return mImportantRule; }
/**
* The rule processor must call this method before calling

View File

@ -103,8 +103,6 @@ public:
*/
virtual void MapRuleInfoInto(nsRuleData* aRuleData)=0;
virtual nsIStyleRule* GetImportantRule(void) { return nsnull; }
#ifdef DEBUG
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0;
#endif