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

Unified Diff: Source/core/css/TreeBoundaryCrossingRules.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/TreeBoundaryCrossingRules.cpp
diff --git a/Source/core/css/TreeBoundaryCrossingRules.cpp b/Source/core/css/TreeBoundaryCrossingRules.cpp
index 8ea2fcbafc3db5a0709bc6de6deaaa5ee3b380dd..12fb790770fb364c052ca7fe34584863b89fbebb 100644
--- a/Source/core/css/TreeBoundaryCrossingRules.cpp
+++ b/Source/core/css/TreeBoundaryCrossingRules.cpp
@@ -75,14 +75,14 @@ void TreeBoundaryCrossingRules::collectTreeBoundaryCrossingRules(Element* elemen
ASSERT(!collector.scopeContainsLastMatchedElement());
collector.setScopeContainsLastMatchedElement(true);
- for (DocumentOrderedList::iterator it = m_scopingNodes.begin(); it != m_scopingNodes.end(); ++it) {
- const ContainerNode* scopingNode = toContainerNode(*it);
+ for (const auto& scope : m_scopingNodes) {
+ const ContainerNode* scopingNode = toContainerNode(scope);
CSSStyleSheetRuleSubSet* ruleSubSet = m_treeBoundaryCrossingRuleSetMap.get(scopingNode);
bool isInnerTreeScope = element->treeScope().isInclusiveAncestorOf(scopingNode->treeScope());
CascadeOrder cascadeOrder = isInnerTreeScope ? innerCascadeOrder : outerCascadeOrder;
- for (CSSStyleSheetRuleSubSet::iterator it = ruleSubSet->begin(); it != ruleSubSet->end(); ++it) {
- MatchRequest request((*it)->ruleSet.get(), includeEmptyRules, scopingNode, (*it)->parentStyleSheet, (*it)->parentIndex);
+ for (const auto& rules : *ruleSubSet) {
+ MatchRequest request(rules->ruleSet.get(), includeEmptyRules, scopingNode, rules->parentStyleSheet, rules->parentIndex);
collector.collectMatchingRules(request, ruleRange, ignoreCascadeScope, cascadeOrder, true);
}
++innerCascadeOrder;
@@ -99,14 +99,14 @@ void TreeBoundaryCrossingRules::reset(const ContainerNode* scopingNode)
void TreeBoundaryCrossingRules::collectFeaturesFromRuleSubSet(CSSStyleSheetRuleSubSet* ruleSubSet, RuleFeatureSet& features)
{
- for (CSSStyleSheetRuleSubSet::iterator it = ruleSubSet->begin(); it != ruleSubSet->end(); ++it)
- features.add((*it)->ruleSet->features());
+ for (const auto& rules : *ruleSubSet)
+ features.add(rules->ruleSet->features());
}
void TreeBoundaryCrossingRules::collectFeaturesTo(RuleFeatureSet& features)
{
- for (TreeBoundaryCrossingRuleSetMap::iterator::Values it = m_treeBoundaryCrossingRuleSetMap.values().begin(); it != m_treeBoundaryCrossingRuleSetMap.values().end(); ++it)
- collectFeaturesFromRuleSubSet(it->get(), features);
+ for (const auto& value : m_treeBoundaryCrossingRuleSetMap.values())
+ collectFeaturesFromRuleSubSet(value.get(), features);
}
void TreeBoundaryCrossingRules::trace(Visitor* visitor)
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698