Index: third_party/WebKit/Source/core/css/SelectorChecker.cpp |
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
index 46fa908c4597d34e9e5587b71ed63385cc1325a4..4a45c2d770fb2ec8db58588357bcbe47aa2823ce 100644 |
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
@@ -375,17 +375,23 @@ SelectorChecker::Match SelectorChecker::matchForRelation(const SelectorCheckingC |
return SelectorFailsCompletely; |
} |
+ |
if (context.selector->relationIsAffectedByPseudoContent()) { |
// TODO(kochi): closed mode tree should be handled as well for ::content. |
for (Element* element = context.element; element; element = element->parentOrShadowHostElement()) { |
- if (matchForPseudoContent(nextContext, *element, result) == SelectorMatches) |
+ if (matchForPseudoContent(nextContext, *element, result) == SelectorMatches) { |
+ if (context.element->isInShadowTree()) |
+ UseCounter::count(context.element->document(), UseCounter::CSSDeepCombinatorAndShadow); |
return SelectorMatches; |
+ } |
} |
return SelectorFailsCompletely; |
} |
for (nextContext.element = parentOrV0ShadowHostElement(*context.element); nextContext.element; nextContext.element = parentOrV0ShadowHostElement(*nextContext.element)) { |
Match match = matchSelector(nextContext, result); |
+ if (match == SelectorMatches && context.element->isInShadowTree()) |
+ UseCounter::count(context.element->document(), UseCounter::CSSDeepCombinatorAndShadow); |
if (match == SelectorMatches || match == SelectorFailsCompletely) |
return match; |
if (nextSelectorExceedsScope(nextContext)) |