Index: Source/core/css/SelectorFilter.cpp |
diff --git a/Source/core/css/SelectorFilter.cpp b/Source/core/css/SelectorFilter.cpp |
index aedefed921e6c86a8825e2a4e13c8cead6813c42..632a7ec3f4023999d4a3655c0743fabdde6c1c01 100644 |
--- a/Source/core/css/SelectorFilter.cpp |
+++ b/Source/core/css/SelectorFilter.cpp |
@@ -135,6 +135,7 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsign |
unsigned* hash = identifierHashes; |
unsigned* end = identifierHashes + maximumIdentifierCount; |
CSSSelector::Relation relation = selector->relation(); |
+ bool relationIsForShadowDistributed = selector->relationIsForShadowDistributed(); |
// Skip the topmost selector. It is handled quickly by the rule hashes. |
bool skipOverSubselectors = true; |
@@ -148,11 +149,14 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsign |
case CSSSelector::DirectAdjacent: |
case CSSSelector::IndirectAdjacent: |
case CSSSelector::ShadowPseudo: |
- case CSSSelector::ShadowDistributed: |
skipOverSubselectors = true; |
break; |
case CSSSelector::Descendant: |
case CSSSelector::Child: |
+ if (relationIsForShadowDistributed) { |
+ skipOverSubselectors = true; |
+ break; |
+ } |
skipOverSubselectors = false; |
collectDescendantSelectorIdentifierHashes(selector, hash); |
break; |
@@ -160,6 +164,7 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector* selector, unsign |
if (hash == end) |
return; |
relation = selector->relation(); |
+ relationIsForShadowDistributed = selector->relationIsForShadowDistributed(); |
} |
*hash = 0; |
} |