Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 1988543002: Better counting of /deep/ usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698