Issue #2828 - Part 3: Refactor selector matching and rule cascade data into separate files/classes

This commit is contained in:
Francis Dominic Fajardo 2025-07-17 22:13:53 +08:00 • committed by roytam1
commit 03f29e75ec
20 changed files with 4432 additions and 4171 deletions

View file

@ -47,7 +47,7 @@
#include "nsDisplayList.h"
#include "RestyleTrackerInlines.h"
#include "nsSMILAnimationController.h"
#include "nsCSSRuleProcessor.h"
#include "nsCSSRuleUtils.h"
#include "ChildIterator.h"
#include "Layers.h"
@ -2550,8 +2550,8 @@ ElementRestyler::SelectorMatchesForRestyle(Element* aElement)
return false;
}
for (nsCSSSelector* selector : mSelectorsForDescendants) {
if (nsCSSRuleProcessor::RestrictedSelectorMatches(aElement, selector,
mTreeMatchContext)) {
if (nsCSSRuleUtils::RestrictedSelectorMatches(aElement, selector,
mTreeMatchContext)) {
return true;
}
}

View file

@ -35,7 +35,7 @@
#include "nsViewManager.h"
#include "mozilla/RestyleManager.h"
#include "SurfaceCacheUtils.h"
#include "nsCSSRuleProcessor.h"
#include "nsCSSRuleUtils.h"
#include "nsRuleNode.h"
#include "gfxPlatform.h"
#include "nsCSSRules.h"
@ -1650,7 +1650,7 @@ nsPresContext::ThemeChangedInternal()
}
// This will force the system metrics to be generated the next time they're used
nsCSSRuleProcessor::FreeSystemMetrics();
nsCSSRuleUtils::FreeSystemMetrics();
// Changes to system metrics can change media queries on them, or
// :-moz-system-metric selectors (which requires eRestyle_Subtree).
@ -1691,7 +1691,7 @@ nsPresContext::SysColorChangedInternal()
}
// Invalidate cached '-moz-windows-accent-color-applies' media query:
nsCSSRuleProcessor::FreeSystemMetrics();
nsCSSRuleUtils::FreeSystemMetrics();
// Reset default background and foreground colors for the document since
// they may be using system colors