Bug 1258017 - Use an nsCOMPtr to hold onto the nsIStyleRule. r=dbaron

This commit is contained in:
Bobby Holley 2016-03-24 18:26:46 -07:00
parent 4f8c8b64aa
commit fcdabfac83
2 changed files with 2 additions and 8 deletions

View File

@ -1523,10 +1523,6 @@ nsRuleNode::nsRuleNode(nsPresContext* aContext, nsRuleNode* aParent,
mChildren.asVoid = nullptr;
MOZ_COUNT_CTOR(nsRuleNode);
if (mRule) {
mRule->AddRef();
}
NS_ASSERTION(IsRoot() || GetLevel() == aLevel, "not enough bits");
NS_ASSERTION(IsRoot() || IsImportantRule() == aIsImportant, "yikes");
/* If IsRoot(), then aContext->StyleSet() is typically null at this
@ -1552,9 +1548,6 @@ nsRuleNode::~nsRuleNode()
MOZ_COUNT_DTOR(nsRuleNode);
if (mStyleData.mResetData || mStyleData.mInheritedData)
mStyleData.Destroy(mDependentBits, mPresContext);
if (mRule) {
mRule->Release();
}
}
nsRuleNode*

View File

@ -420,7 +420,8 @@ private:
// most specific rule matched to the least
// specific rule (which is the optimal order to
// use for lookups of style properties.
nsIStyleRule* const mRule; // [STRONG] A pointer to our specific rule.
const nsCOMPtr<nsIStyleRule> mRule; // A pointer to our specific rule.
nsRuleNode* mNextSibling; // This value should be used only by the
// parent, since the parent may store