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

Unified Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 339563004: Add UseCounter for web components related CSS selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 6 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 | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/BisonCSSParser-in.cpp
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index d1b1f92b29efc92d2ada5787aeeea6288682e3ef..adc6b1b9a8f47670d47343d67d2cfbfeeb68b835 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -1761,6 +1761,35 @@ StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector>
{
StyleRule* result = 0;
if (selectors) {
+ for (size_t i = 0; i < selectors->size(); ++i) {
esprehn 2014/06/18 06:24:35 Lets put this in another function and early return
kochi 2014/06/18 09:03:31 Done. Split the part into a separate function, an
+ for (CSSParserSelector* selector = selectors->at(i).get(); selector; selector = selector->tagHistory()) {
+ UseCounter::Feature feature = UseCounter::NumberOfFeatures;
+ switch (selector->pseudoType()) {
+ case CSSSelector::PseudoUnresolved:
+ feature = UseCounter::CSSSelectorPseudoUnresolved;
+ break;
+ case CSSSelector::PseudoShadow:
+ feature = UseCounter::CSSSelectorPseudoShadow;
+ break;
+ case CSSSelector::PseudoContent:
+ feature = UseCounter::CSSSelectorPseudoContent;
+ break;
+ case CSSSelector::PseudoHost:
+ feature = UseCounter::CSSSelectorPseudoHost;
+ break;
+ case CSSSelector::PseudoHostContext:
+ feature = UseCounter::CSSSelectorPseudoHostContext;
+ break;
+ default:
+ break;
+ }
+ if (selector->relation() == CSSSelector::ShadowDeep)
+ feature = UseCounter::CSSDeepCombinator;
+ if (feature != UseCounter::NumberOfFeatures && m_context.useCounter())
+ m_context.useCounter()->count(feature);
+ }
+ }
+
m_allowImportRules = m_allowNamespaceDeclarations = false;
RefPtrWillBeRawPtr<StyleRule> rule = StyleRule::create();
rule->parserAdoptSelectorVector(*selectors);
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698