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

Unified Diff: Source/core/html/shadow/HTMLContentElement.cpp

Issue 149513011: Pass around CSSSelector by reference instead of pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/dom/shadow/SelectRuleFeatureSet.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/HTMLContentElement.cpp
diff --git a/Source/core/html/shadow/HTMLContentElement.cpp b/Source/core/html/shadow/HTMLContentElement.cpp
index df21ad5df56908058a3204fba97f41b45261fbfc..78bef2994b26d758023a8bf04206815e96820128 100644
--- a/Source/core/html/shadow/HTMLContentElement.cpp
+++ b/Source/core/html/shadow/HTMLContentElement.cpp
@@ -91,7 +91,7 @@ bool HTMLContentElement::validateSelect() const
if (!m_selectorList.isValid())
return false;
- for (const CSSSelector* selector = m_selectorList.first(); selector; selector = m_selectorList.next(selector)) {
+ for (const CSSSelector* selector = m_selectorList.first(); selector; selector = m_selectorList.next(*selector)) {
if (!selector->isCompound())
return false;
}
@@ -99,7 +99,7 @@ bool HTMLContentElement::validateSelect() const
return true;
}
-static inline bool checkOneSelector(const CSSSelector* selector, const Vector<Node*, 32>& siblings, int nth)
+static inline bool checkOneSelector(const CSSSelector& selector, const Vector<Node*, 32>& siblings, int nth)
{
Element* element = toElement(siblings[nth]);
SelectorChecker selectorChecker(element->document(), SelectorChecker::CollectingCSSRules);
@@ -110,8 +110,8 @@ static inline bool checkOneSelector(const CSSSelector* selector, const Vector<No
bool HTMLContentElement::matchSelector(const Vector<Node*, 32>& siblings, int nth) const
{
- for (const CSSSelector* selector = selectorList().first(); selector; selector = CSSSelectorList::next(selector)) {
- if (checkOneSelector(selector, siblings, nth))
+ for (const CSSSelector* selector = selectorList().first(); selector; selector = CSSSelectorList::next(*selector)) {
+ if (checkOneSelector(*selector, siblings, nth))
return true;
}
return false;
« no previous file with comments | « Source/core/dom/shadow/SelectRuleFeatureSet.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698