From 0391e8ab09295be02d2805fd8485ee11b1db1760 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Mon, 20 Feb 2023 01:28:13 +0800 Subject: [PATCH] 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. --- layout/style/nsCSSRuleProcessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 3644e3e45b..de4ee0fc3b 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -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,