diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 1ecf80bc52..ff3661c73d 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -680,7 +680,11 @@ void RuleHash::EnumerateAllRules(Element* aElement, ElementDependentRuleProcesso aData->mTreeMatchContext.mAncestorFilter.HasFilter() ? &aData->mTreeMatchContext.mAncestorFilter : nullptr; #ifdef DEBUG - if (filter) { + bool isRestricted = (aData->mTreeMatchContext.mShadowHosts.Length() > 0 || + aData->mTreeMatchContext.mRestrictToSlottedPseudo || + aData->mTreeMatchContext.mOnlyMatchHostPseudo || + aData->mTreeMatchContext.mForAssignedSlot); + if (filter && !isRestricted) { filter->AssertHasAllAncestors(aElement); } #endif