diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-05-21 15:24:31 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-05-21 19:01:42 +0800 |
commit | 0627dc763966836eee5c182560c744cb5a4233bc (patch) | |
tree | cb94d7ff93b25daee2fe458c3a67300cc280964c | |
parent | c58f825821ad1b7d6d695116326118d01941f279 (diff) | |
download | uxp-0627dc763966836eee5c182560c744cb5a4233bc.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.cpp | 6 |
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 |