Bug 978833 patch 5 - Rename ImportantRule to ImportantStyleData. r=heycam

(This is part of a longer term plan to rename nsIStyleRule to StyleData
and nsIStyleRuleProcessor to StyleDataSource.  I'm not doing all of that
here, though.)

--HG--
extra : commitid : DZGpUQO2Fey
This commit is contained in:
L. David Baron 2015-11-05 16:44:08 +08:00
Родитель 8a5bc09609
Коммит 00351db8e0
5 изменённых файлов: 18 добавлений и 17 удалений

Просмотреть файл

@ -1038,31 +1038,31 @@ nsCSSSelectorList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) cons
return n;
}
// -- ImportantRule ----------------------------------
// -- ImportantStyleData ----------------------------------
namespace mozilla {
namespace css {
ImportantRule::ImportantRule(Declaration* aDeclaration)
ImportantStyleData::ImportantStyleData(Declaration* aDeclaration)
: mDeclaration(aDeclaration)
{
}
ImportantRule::~ImportantRule()
ImportantStyleData::~ImportantStyleData()
{
}
NS_IMPL_ISUPPORTS(ImportantRule, nsIStyleRule)
NS_IMPL_ISUPPORTS(ImportantStyleData, nsIStyleRule)
/* virtual */ void
ImportantRule::MapRuleInfoInto(nsRuleData* aRuleData)
ImportantStyleData::MapRuleInfoInto(nsRuleData* aRuleData)
{
mDeclaration->MapImportantRuleInfoInto(aRuleData);
}
#ifdef DEBUG
/* virtual */ void
ImportantRule::List(FILE* out, int32_t aIndent) const
ImportantStyleData::List(FILE* out, int32_t aIndent) const
{
// Indent
nsAutoCString str;
@ -1497,7 +1497,7 @@ StyleRule::RuleMatched()
mWasMatched = true;
mDeclaration->SetImmutable();
if (mDeclaration->HasImportantData()) {
mImportantRule = new ImportantRule(mDeclaration);
mImportantRule = new ImportantStyleData(mDeclaration);
}
}
}

Просмотреть файл

@ -294,9 +294,10 @@ class DOMCSSStyleRule;
class StyleRule;
class ImportantRule final : public nsIStyleRule {
class ImportantStyleData final : public nsIStyleRule
{
public:
explicit ImportantRule(Declaration *aDeclaration);
explicit ImportantStyleData(Declaration* aDeclaration);
NS_DECL_ISUPPORTS
@ -307,7 +308,7 @@ public:
#endif
protected:
virtual ~ImportantRule();
virtual ~ImportantStyleData();
RefPtr<Declaration> mDeclaration;
@ -385,7 +386,7 @@ private:
private:
nsCSSSelectorList* mSelector; // null for style attribute
RefPtr<Declaration> mDeclaration;
RefPtr<ImportantRule> mImportantRule; // initialized by RuleMatched
RefPtr<ImportantStyleData> mImportantRule; // initialized by RuleMatched
RefPtr<DOMCSSStyleRule> mDOMRule;
private:

Просмотреть файл

@ -2701,14 +2701,14 @@ nsCSSPageRule::GetCSSRule()
return Rule::GetCSSRule();
}
css::ImportantRule*
css::ImportantStyleData*
nsCSSPageRule::GetImportantRule()
{
if (!mDeclaration->HasImportantData()) {
return nullptr;
}
if (!mImportantRule) {
mImportantRule = new css::ImportantRule(mDeclaration);
mImportantRule = new css::ImportantStyleData(mDeclaration);
}
return mImportantRule;
}

Просмотреть файл

@ -557,14 +557,14 @@ public:
void ChangeDeclaration(mozilla::css::Declaration* aDeclaration);
mozilla::css::ImportantRule* GetImportantRule();
mozilla::css::ImportantStyleData* GetImportantRule();
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
private:
RefPtr<mozilla::css::Declaration> mDeclaration;
// lazily created when needed:
RefPtr<nsCSSPageStyleDeclaration> mDOMDeclaration;
RefPtr<mozilla::css::ImportantRule> mImportantRule;
RefPtr<mozilla::css::ImportantStyleData> mImportantRule;
};
namespace mozilla {

Просмотреть файл

@ -1960,11 +1960,11 @@ nsStyleSet::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
if (aPseudoTag == nsCSSAnonBoxes::pageContent) {
// Add any @page rules that are specified.
nsTArray<nsCSSPageRule*> rules;
nsTArray<css::ImportantRule*> importantRules;
nsTArray<css::ImportantStyleData*> importantRules;
PresContext()->StyleSet()->AppendPageRules(rules);
for (uint32_t i = 0, i_end = rules.Length(); i != i_end; ++i) {
ruleWalker.Forward(rules[i]);
css::ImportantRule* importantRule = rules[i]->GetImportantRule();
css::ImportantStyleData* importantRule = rules[i]->GetImportantRule();
if (importantRule) {
importantRules.AppendElement(importantRule);
}