mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Cache important rule the first time the rule is matched so we don't rely on the declaration for it past that point. (Bug 522595) r=bzbarsky
This commit is contained in:
parent
4ee286e827
commit
cec495c863
@ -1409,23 +1409,16 @@ nsCSSDeclaration* CSSStyleRuleImpl::GetDeclaration(void) const
|
||||
|
||||
nsIStyleRule* CSSStyleRuleImpl::GetImportantRule(void)
|
||||
{
|
||||
if (!mDeclaration->HasImportantData()) {
|
||||
NS_ASSERTION(!mImportantRule, "immutable, so should be no important rule");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (!mImportantRule) {
|
||||
mImportantRule = new CSSImportantRule(mDeclaration);
|
||||
if (!mImportantRule)
|
||||
return nsnull;
|
||||
NS_ADDREF(mImportantRule);
|
||||
}
|
||||
return mImportantRule;
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
CSSStyleRuleImpl::RuleMatched()
|
||||
{
|
||||
if (mDeclaration->HasImportantData() && !mImportantRule) {
|
||||
mImportantRule = new CSSImportantRule(mDeclaration);
|
||||
NS_IF_ADDREF(mImportantRule);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
Reference in New Issue
Block a user