зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978833 patch 6 - Move ImportantStyleData from StyleRule.{h,cpp} to Declaration.{h,cpp} r=heycam
This is needed for patch 7. Note that this removes an unused "friend class StyleRule;" declaration. --HG-- extra : commitid : Fjns3SwV7M1
This commit is contained in:
Родитель
00351db8e0
Коммит
ed0b078c21
|
@ -19,6 +19,38 @@
|
|||
namespace mozilla {
|
||||
namespace css {
|
||||
|
||||
ImportantStyleData::ImportantStyleData(Declaration* aDeclaration)
|
||||
: mDeclaration(aDeclaration)
|
||||
{
|
||||
}
|
||||
|
||||
ImportantStyleData::~ImportantStyleData()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ImportantStyleData, nsIStyleRule)
|
||||
|
||||
/* virtual */ void
|
||||
ImportantStyleData::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
mDeclaration->MapImportantRuleInfoInto(aRuleData);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* virtual */ void
|
||||
ImportantStyleData::List(FILE* out, int32_t aIndent) const
|
||||
{
|
||||
// Indent
|
||||
nsAutoCString str;
|
||||
for (int32_t index = aIndent; --index >= 0; ) {
|
||||
str.AppendLiteral(" ");
|
||||
}
|
||||
|
||||
str.AppendLiteral("! important rule\n");
|
||||
fprintf_stderr(out, "%s", str.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
Declaration::Declaration()
|
||||
: mOwningRule(nullptr)
|
||||
, mImmutable(false)
|
||||
|
|
|
@ -37,6 +37,26 @@ namespace mozilla {
|
|||
namespace css {
|
||||
|
||||
class Rule;
|
||||
class Declaration;
|
||||
|
||||
class ImportantStyleData final : public nsIStyleRule
|
||||
{
|
||||
public:
|
||||
explicit ImportantStyleData(Declaration* aDeclaration);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIStyleRule interface
|
||||
virtual void MapRuleInfoInto(nsRuleData* aRuleData) override;
|
||||
#ifdef DEBUG
|
||||
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual ~ImportantStyleData();
|
||||
|
||||
RefPtr<Declaration> mDeclaration;
|
||||
};
|
||||
|
||||
// Declaration objects have unusual lifetime rules. Every declaration
|
||||
// begins life in an invalid state which ends when InitializeEmpty or
|
||||
|
|
|
@ -1038,46 +1038,6 @@ nsCSSSelectorList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) cons
|
|||
return n;
|
||||
}
|
||||
|
||||
// -- ImportantStyleData ----------------------------------
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
|
||||
ImportantStyleData::ImportantStyleData(Declaration* aDeclaration)
|
||||
: mDeclaration(aDeclaration)
|
||||
{
|
||||
}
|
||||
|
||||
ImportantStyleData::~ImportantStyleData()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ImportantStyleData, nsIStyleRule)
|
||||
|
||||
/* virtual */ void
|
||||
ImportantStyleData::MapRuleInfoInto(nsRuleData* aRuleData)
|
||||
{
|
||||
mDeclaration->MapImportantRuleInfoInto(aRuleData);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* virtual */ void
|
||||
ImportantStyleData::List(FILE* out, int32_t aIndent) const
|
||||
{
|
||||
// Indent
|
||||
nsAutoCString str;
|
||||
for (int32_t index = aIndent; --index >= 0; ) {
|
||||
str.AppendLiteral(" ");
|
||||
}
|
||||
|
||||
str.AppendLiteral("! important rule\n");
|
||||
fprintf_stderr(out, "%s", str.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace css
|
||||
} // namespace mozilla
|
||||
|
||||
// --------------------------------------------------------
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -292,29 +292,6 @@ namespace css {
|
|||
class Declaration;
|
||||
class DOMCSSStyleRule;
|
||||
|
||||
class StyleRule;
|
||||
|
||||
class ImportantStyleData final : public nsIStyleRule
|
||||
{
|
||||
public:
|
||||
explicit ImportantStyleData(Declaration* aDeclaration);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIStyleRule interface
|
||||
virtual void MapRuleInfoInto(nsRuleData* aRuleData) override;
|
||||
#ifdef DEBUG
|
||||
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual ~ImportantStyleData();
|
||||
|
||||
RefPtr<Declaration> mDeclaration;
|
||||
|
||||
friend class StyleRule;
|
||||
};
|
||||
|
||||
class StyleRule final : public Rule
|
||||
{
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче