Index: third_party/WebKit/Source/core/css/SelectorFilter.cpp |
diff --git a/third_party/WebKit/Source/core/css/SelectorFilter.cpp b/third_party/WebKit/Source/core/css/SelectorFilter.cpp |
index 82863003a1d44c11bb03945fe377ea5c63303b56..edba01dc7abb1a69b8605106a05111159b995f27 100644 |
--- a/third_party/WebKit/Source/core/css/SelectorFilter.cpp |
+++ b/third_party/WebKit/Source/core/css/SelectorFilter.cpp |
@@ -134,7 +134,11 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign |
unsigned* hash = identifierHashes; |
unsigned* end = identifierHashes + maximumIdentifierCount; |
CSSSelector::Relation relation = selector.relation(); |
- bool relationIsAffectedByPseudoContent = selector.relationIsAffectedByPseudoContent(); |
+ if (selector.relationIsAffectedByPseudoContent()) { |
+ // Disable fastRejectSelector. |
+ *identifierHashes = 0; |
+ return; |
+ } |
// Skip the topmost selector. It is handled quickly by the rule hashes. |
bool skipOverSubselectors = true; |
@@ -149,27 +153,27 @@ void SelectorFilter::collectIdentifierHashes(const CSSSelector& selector, unsign |
case CSSSelector::IndirectAdjacent: |
skipOverSubselectors = true; |
break; |
+ case CSSSelector::ShadowSlot: |
+ // Disable fastRejectSelector. |
+ *identifierHashes = 0; |
+ return; |
case CSSSelector::Descendant: |
case CSSSelector::Child: |
- if (relationIsAffectedByPseudoContent) { |
- // Disable fastRejectSelector. |
- *identifierHashes = 0; |
- return; |
- } |
// Fall through. |
case CSSSelector::ShadowPseudo: |
case CSSSelector::ShadowDeep: |
skipOverSubselectors = false; |
collectDescendantSelectorIdentifierHashes(*current, hash); |
break; |
- case CSSSelector::ShadowSlot: |
- // TODO(kochi): Add this in later CL. |
- break; |
} |
if (hash == end) |
return; |
relation = current->relation(); |
- relationIsAffectedByPseudoContent = current->relationIsAffectedByPseudoContent(); |
+ if (current->relationIsAffectedByPseudoContent()) { |
+ // Disable fastRejectSelector. |
+ *identifierHashes = 0; |
+ return; |
+ } |
} |
*hash = 0; |
} |