Issue #1593 - Follow-up: Copy mIsRelevantLink value over rather than calling IsLink

Calling IsLink ignores whatever state we have for aTreeMatchContext and will trigger an assertion if aTreeMatchContext.mForStyling is false. This also adds a comment about what that line effectively does.
This commit is contained in:
FranklinDM 2023-02-20 01:28:13 +08:00 committed by roytam1
commit 0391e8ab09

View file

@ -1969,8 +1969,10 @@ static bool SelectorMatches(Element* aElement,
}
// Match if any selector in the argument list matches.
// FIXME: What this effectively does is bypass the "featureless"
// selector check under SelectorMatches.
NodeMatchContext nodeContext(EventStates(),
nsCSSRuleProcessor::IsLink(aElement));
aNodeMatchContext.mIsRelevantLink);
if (SelectorListMatches(aElement,
pseudoClass,
nodeContext,