Issue #2112 - Follow-up: Fix broken rule node assertion

This commit is contained in:
FranklinDM 2024-03-28 20:09:30 +08:00 committed by roytam1
commit 4cdc0ce964

View file

@ -160,10 +160,10 @@ nsStyleContext::~nsStyleContext()
#endif
nsPresContext *presContext = PresContext();
DebugOnly<nsStyleSet*> geckoStyleSet = presContext->PresShell()->StyleSet()->GetAsGecko();
NS_ASSERTION(!geckoStyleSet ||
geckoStyleSet->GetRuleTree() == mSource.AsGeckoRuleNode()->RuleTree() ||
geckoStyleSet->IsInRuleTreeReconstruct(),
DebugOnly<nsStyleSet*> styleSet = presContext->PresShell()->StyleSet()->GetAsGecko();
NS_ASSERTION(!styleSet ||
styleSet->GetRuleTree() == mRuleNode->RuleTree() ||
styleSet->IsInRuleTreeReconstruct(),
"destroying style context from old rule tree too late");
if (mParent) {