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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 rule->setVendorPrefixed(isPrefixed); 1754 rule->setVendorPrefixed(isPrefixed);
1755 StyleRuleKeyframes* rulePtr = rule.get(); 1755 StyleRuleKeyframes* rulePtr = rule.get();
1756 m_parsedRules.append(rule.release()); 1756 m_parsedRules.append(rule.release());
1757 return rulePtr; 1757 return rulePtr;
1758 } 1758 }
1759 1759
1760 StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* selectors) 1760 StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* selectors)
1761 { 1761 {
1762 StyleRule* result = 0; 1762 StyleRule* result = 0;
1763 if (selectors) { 1763 if (selectors) {
1764 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
1765 for (CSSParserSelector* selector = selectors->at(i).get(); selector; selector = selector->tagHistory()) {
1766 UseCounter::Feature feature = UseCounter::NumberOfFeatures;
1767 switch (selector->pseudoType()) {
1768 case CSSSelector::PseudoUnresolved:
1769 feature = UseCounter::CSSSelectorPseudoUnresolved;
1770 break;
1771 case CSSSelector::PseudoShadow:
1772 feature = UseCounter::CSSSelectorPseudoShadow;
1773 break;
1774 case CSSSelector::PseudoContent:
1775 feature = UseCounter::CSSSelectorPseudoContent;
1776 break;
1777 case CSSSelector::PseudoHost:
1778 feature = UseCounter::CSSSelectorPseudoHost;
1779 break;
1780 case CSSSelector::PseudoHostContext:
1781 feature = UseCounter::CSSSelectorPseudoHostContext;
1782 break;
1783 default:
1784 break;
1785 }
1786 if (selector->relation() == CSSSelector::ShadowDeep)
1787 feature = UseCounter::CSSDeepCombinator;
1788 if (feature != UseCounter::NumberOfFeatures && m_context.useCoun ter())
1789 m_context.useCounter()->count(feature);
1790 }
1791 }
1792
1764 m_allowImportRules = m_allowNamespaceDeclarations = false; 1793 m_allowImportRules = m_allowNamespaceDeclarations = false;
1765 RefPtrWillBeRawPtr<StyleRule> rule = StyleRule::create(); 1794 RefPtrWillBeRawPtr<StyleRule> rule = StyleRule::create();
1766 rule->parserAdoptSelectorVector(*selectors); 1795 rule->parserAdoptSelectorVector(*selectors);
1767 rule->setProperties(createStylePropertySet()); 1796 rule->setProperties(createStylePropertySet());
1768 result = rule.get(); 1797 result = rule.get();
1769 m_parsedRules.append(rule.release()); 1798 m_parsedRules.append(rule.release());
1770 } 1799 }
1771 clearProperties(); 1800 clearProperties();
1772 return result; 1801 return result;
1773 } 1802 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 rule->setProperties(createStylePropertySet()); 2102 rule->setProperties(createStylePropertySet());
2074 clearProperties(); 2103 clearProperties();
2075 2104
2076 StyleRuleViewport* result = rule.get(); 2105 StyleRuleViewport* result = rule.get();
2077 m_parsedRules.append(rule.release()); 2106 m_parsedRules.append(rule.release());
2078 2107
2079 return result; 2108 return result;
2080 } 2109 }
2081 2110
2082 } 2111 }
OLDNEW
« 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