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

Unified Diff: third_party/WebKit/Source/core/css/RuleSet.cpp

Issue 2308313002: Clean up RuleSet::addChildRules() (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RuleSet.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleSet.cpp b/third_party/WebKit/Source/core/css/RuleSet.cpp
index 0e6eef99d8899f32d30875e03c38a8ead324a4bf..6f276191da4afa35135f138f9dbd983ac45b62bf 100644
--- a/third_party/WebKit/Source/core/css/RuleSet.cpp
+++ b/third_party/WebKit/Source/core/css/RuleSet.cpp
@@ -257,12 +257,13 @@ void RuleSet::addChildRules(const HeapVector<Member<StyleRuleBase>>& rules, cons
StyleRule* styleRule = toStyleRule(rule);
const CSSSelectorList& selectorList = styleRule->selectorList();
- for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
- if (selectorList.selectorAt(selectorIndex).hasDeepCombinatorOrShadowPseudo()) {
+ for (const CSSSelector* selector = selectorList.first(); selector; selector = selectorList.next(*selector)) {
+ size_t selectorIndex = selectorList.selectorIndex(*selector);
+ if (selector->hasDeepCombinatorOrShadowPseudo()) {
m_deepCombinatorOrShadowPseudoRules.append(MinimalRuleData(styleRule, selectorIndex, addRuleFlags));
- } else if (selectorList.selectorAt(selectorIndex).hasContentPseudo()) {
+ } else if (selector->hasContentPseudo()) {
m_contentPseudoElementRules.append(MinimalRuleData(styleRule, selectorIndex, addRuleFlags));
- } else if (selectorList.selectorAt(selectorIndex).hasSlottedPseudo()) {
+ } else if (selector->hasSlottedPseudo()) {
m_slottedPseudoElementRules.append(MinimalRuleData(styleRule, selectorIndex, addRuleFlags));
} else {
addRule(styleRule, selectorIndex, addRuleFlags);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698