summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-05-21 15:24:31 +0800
committerMoonchild <moonchild@palemoon.org>2023-06-05 21:16:31 +0200
commit6a0203f25f8e8708b28e51514084e8cab6c13863 (patch)
tree0476cb993a0861dbda5a36fb9d31b1f3f5fc9631
parentb0dfcb147f540bd2f89fd31d7034ac913a418b31 (diff)
downloaduxp-6a0203f25f8e8708b28e51514084e8cab6c13863.tar.gz
Issue #2250 - Part 2: Ignore the ancestor filter assertion if rule matching is restricted or if the current element is under a shadow host
This only affects debug builds.
-rw-r--r--layout/style/nsCSSRuleProcessor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp
index d5d18e75a9..15e5a2456c 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