We can destroy style contexts during ruletree reconstruct. Bug 403454, r+sr=dbaron

This commit is contained in:
bzbarsky@mit.edu 2007-11-14 22:13:48 -08:00
parent 8bcb636fa4
commit 02f1bf69e6

View File

@ -858,14 +858,16 @@ nsStyleSet::NotifyStyleContextDestroyed(nsPresContext* aPresContext,
return;
NS_ASSERTION(mRuleWalker->AtRoot(), "Rule walker should be at root");
if (mOldRuleTree)
return;
// Remove style contexts from mRoots even if mOldRuleTree is non-null. This
// could be a style context from the new ruletree!
if (!aStyleContext->GetParent()) {
mRoots.RemoveElement(aStyleContext);
}
if (mOldRuleTree)
return;
if (++mDestroyedCount == kGCInterval) {
mDestroyedCount = 0;