Fix typo in nsRuleNode::ClearCachedDataInSubtree so it only clears data associated with |aRule|. This fixes a crash since nsStyleContext::ClearStyleData didn't make the same mistake and clean up dangling pointers to the incorrectly deleted data. b=105619 r=bzbarsky sr=brendan a=shaver
git-svn-id: svn://10.0.0.236/trunk@115660 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -526,6 +526,7 @@ nsRuleNode::ClearCachedData(nsIStyleRule* aRule)
|
||||
// of inline style, all nodes along this path must have exactly one child. This
|
||||
// is not a bushy subtree, and so we know that by clearing this path, we've
|
||||
// invalidated everything that we need to.
|
||||
// XXXldb What about !important :hover rules, and such?
|
||||
nsRuleNode* curr = this;
|
||||
while (curr) {
|
||||
curr->mNoneBits &= ~NS_STYLE_INHERIT_MASK;
|
||||
@@ -560,7 +561,7 @@ nsRuleNode::ClearCachedDataInSubtree(nsIStyleRule* aRule)
|
||||
mStyleData.Destroy(0, mPresContext);
|
||||
mNoneBits &= ~NS_STYLE_INHERIT_MASK;
|
||||
mDependentBits &= ~NS_STYLE_INHERIT_MASK;
|
||||
aRule = nsnull;
|
||||
aRule = nsnull; // Cause everything to be blown away in the descendants.
|
||||
}
|
||||
|
||||
if (!mParent) {
|
||||
@@ -569,7 +570,7 @@ nsRuleNode::ClearCachedDataInSubtree(nsIStyleRule* aRule)
|
||||
}
|
||||
else
|
||||
for (nsRuleList* curr = mChildren; curr; curr = curr->mNext)
|
||||
curr->mRuleNode->ClearCachedDataInSubtree(curr->mRuleNode->mRule);
|
||||
curr->mRuleNode->ClearCachedDataInSubtree(aRule);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user