mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #2488 - Part 2: Remove the DeclarationBlock class and use Declaration directly
This commit is contained in:
parent
63076e4211
commit
4d7bdedade
27 changed files with 210 additions and 356 deletions
|
|
@ -59,9 +59,14 @@ ImportantStyleData::List(FILE* out, int32_t aIndent) const
|
|||
}
|
||||
#endif
|
||||
|
||||
Declaration::Declaration()
|
||||
: mImmutable(false)
|
||||
{
|
||||
mContainer.mRaw = 0;
|
||||
}
|
||||
|
||||
Declaration::Declaration(const Declaration& aCopy)
|
||||
: DeclarationBlock(aCopy),
|
||||
mOrder(aCopy.mOrder),
|
||||
: mOrder(aCopy.mOrder),
|
||||
mVariableOrder(aCopy.mVariableOrder),
|
||||
mData(aCopy.mData ? aCopy.mData->Clone() : nullptr),
|
||||
mImportantData(aCopy.mImportantData ?
|
||||
|
|
@ -71,7 +76,8 @@ Declaration::Declaration(const Declaration& aCopy)
|
|||
nullptr),
|
||||
mImportantVariables(aCopy.mImportantVariables ?
|
||||
new CSSVariableDeclarations(*aCopy.mImportantVariables) :
|
||||
nullptr)
|
||||
nullptr),
|
||||
mImmutable(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1827,6 +1833,24 @@ Declaration::InitializeEmpty()
|
|||
mData = nsCSSCompressedDataBlock::CreateEmptyBlock();
|
||||
}
|
||||
|
||||
already_AddRefed<Declaration>
|
||||
Declaration::Clone() const
|
||||
{
|
||||
RefPtr<Declaration> result;
|
||||
result = new Declaration(*this);
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<Declaration>
|
||||
Declaration::EnsureMutable()
|
||||
{
|
||||
AssertNotExpanded();
|
||||
if (!IsMutable()) {
|
||||
return Clone();
|
||||
}
|
||||
return do_AddRef(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
Declaration::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue