Chromium Code Reviews| 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); |