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

Side by Side Diff: Source/core/css/ElementRuleCollector.h

Issue 645743003: Use C++11 range-based loop for core/css (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: better variable names Created 6 years, 2 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 | « Source/core/css/CSSSegmentedFontFace.cpp ('k') | Source/core/css/FontFaceCache.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 private: 135 private:
136 void collectRuleIfMatches(const RuleData&, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&); 136 void collectRuleIfMatches(const RuleData&, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&);
137 137
138 template<typename RuleDataListType> 138 template<typename RuleDataListType>
139 void collectMatchingRulesForList(const RuleDataListType* rules, CascadeScope cascadeScope, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, Rule Range& ruleRange) 139 void collectMatchingRulesForList(const RuleDataListType* rules, CascadeScope cascadeScope, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, Rule Range& ruleRange)
140 { 140 {
141 if (!rules) 141 if (!rules)
142 return; 142 return;
143 143
144 for (typename RuleDataListType::const_iterator it = rules->begin(), end = rules->end(); it != end; ++it) 144 for (const auto& rule : *rules)
145 collectRuleIfMatches(*it, cascadeScope, cascadeOrder, matchRequest, ruleRange); 145 collectRuleIfMatches(rule, cascadeScope, cascadeOrder, matchRequest, ruleRange);
146 } 146 }
147 147
148 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke r::MatchResult*); 148 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke r::MatchResult*);
149 149
150 CSSRuleList* nestedRuleList(CSSRule*); 150 CSSRuleList* nestedRuleList(CSSRule*);
151 template<class CSSRuleCollection> 151 template<class CSSRuleCollection>
152 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); 152 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*);
153 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); 153 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*);
154 154
155 void sortMatchedRules(); 155 void sortMatchedRules();
(...skipping 18 matching lines...) Expand all
174 174
175 // Output. 175 // Output.
176 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; 176 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList;
177 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; 177 RefPtrWillBeMember<StyleRuleList> m_styleRuleList;
178 MatchResult m_result; 178 MatchResult m_result;
179 }; 179 };
180 180
181 } // namespace blink 181 } // namespace blink
182 182
183 #endif // ElementRuleCollector_h 183 #endif // ElementRuleCollector_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.cpp ('k') | Source/core/css/FontFaceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698