Bug 321195 - stop cloning stylesheets from losing rule weighting and line numbers. r+sr=dbaron

This commit is contained in:
silver%warwickcompsoc.co.uk 2005-12-23 21:04:35 +00:00
Родитель 1d7b2b3c0d
Коммит b9dcf6bcee
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -743,6 +743,7 @@ MOZ_DECL_CTOR_COUNTER(nsCSSSelectorList)
nsCSSSelectorList::nsCSSSelectorList(void)
: mSelectors(nsnull),
mWeight(0),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsCSSSelectorList);
@ -796,6 +797,7 @@ nsCSSSelectorList::Clone()
delete list;
return nsnull;
}
lcopy->mWeight = l->mWeight;
*list_cur = lcopy;
list_cur = &lcopy->mNext;
@ -1263,7 +1265,8 @@ CSSStyleRuleImpl::CSSStyleRuleImpl(nsCSSSelectorList* aSelector,
mSelector(aSelector),
mDeclaration(aDeclaration),
mImportantRule(nsnull),
mDOMRule(nsnull)
mDOMRule(nsnull),
mLineNumber(0)
{
mDeclaration->AddRef();
}
@ -1274,7 +1277,8 @@ CSSStyleRuleImpl::CSSStyleRuleImpl(const CSSStyleRuleImpl& aCopy)
mSelector(aCopy.mSelector ? aCopy.mSelector->Clone() : nsnull),
mDeclaration(aCopy.mDeclaration->Clone()),
mImportantRule(nsnull),
mDOMRule(nsnull)
mDOMRule(nsnull),
mLineNumber(aCopy.mLineNumber)
{
if (mDeclaration)
mDeclaration->AddRef();
@ -1288,7 +1292,8 @@ CSSStyleRuleImpl::CSSStyleRuleImpl(CSSStyleRuleImpl& aCopy,
mSelector(aCopy.mSelector),
mDeclaration(aDeclaration),
mImportantRule(nsnull),
mDOMRule(aCopy.mDOMRule)
mDOMRule(aCopy.mDOMRule),
mLineNumber(aCopy.mLineNumber)
{
// The DOM rule is replacing |aCopy| with |this|, so transfer
// the reverse pointer as well (and transfer ownership).