зеркало из https://github.com/mozilla/pjs.git
Bug 321195 - stop cloning stylesheets from losing rule weighting and line numbers. r+sr=dbaron
This commit is contained in:
Родитель
1d7b2b3c0d
Коммит
b9dcf6bcee
|
@ -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).
|
||||
|
|
Загрузка…
Ссылка в новой задаче