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

Unified Diff: Source/core/css/SelectorChecker.h

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/css/RuleSet.cpp ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.h
diff --git a/Source/core/css/SelectorChecker.h b/Source/core/css/SelectorChecker.h
index b158ed556597872c1138384f8fbefaeb0f39a863..fd98ccc4a96b2400f3f633a523305affe447fe33 100644
--- a/Source/core/css/SelectorChecker.h
+++ b/Source/core/css/SelectorChecker.h
@@ -66,8 +66,8 @@ public:
struct SelectorCheckingContext {
// Initial selector constructor
- SelectorCheckingContext(const CSSSelector* selector, Element* element, VisitedMatchType visitedMatchType)
- : selector(selector)
+ SelectorCheckingContext(const CSSSelector& selector, Element* element, VisitedMatchType visitedMatchType)
+ : selector(&selector)
, element(element)
, scope(0)
, visitedMatchType(visitedMatchType)
@@ -115,12 +115,12 @@ public:
Mode mode() const { return m_mode; }
static bool tagMatches(const Element&, const QualifiedName&, MatchingTagType = MatchingElement);
- static bool isCommonPseudoClassSelector(const CSSSelector*);
+ static bool isCommonPseudoClassSelector(const CSSSelector&);
static bool matchesFocusPseudoClass(const Element&);
static bool checkExactAttribute(const Element&, const QualifiedName& selectorAttributeName, const StringImpl* value);
enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited };
- static unsigned determineLinkMatchType(const CSSSelector*);
+ static unsigned determineLinkMatchType(const CSSSelector&);
static bool isHostInItsShadowTree(const Element&, BehaviorAtBoundary, const ContainerNode* scope);
@@ -132,7 +132,7 @@ private:
template<typename SiblingTraversalStrategy>
Match matchForShadowDistributed(const Element*, const SiblingTraversalStrategy&, SelectorCheckingContext& nextContext, MatchResult* = 0) const;
- bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, const CSSSelector*) const;
+ bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, const CSSSelector&) const;
Element* parentElement(const SelectorCheckingContext&, bool allowToCrossBoundary = false) const;
bool scopeContainsLastMatchedElement(const SelectorCheckingContext&) const;
@@ -143,11 +143,11 @@ private:
Mode m_mode;
};
-inline bool SelectorChecker::isCommonPseudoClassSelector(const CSSSelector* selector)
+inline bool SelectorChecker::isCommonPseudoClassSelector(const CSSSelector& selector)
{
- if (selector->m_match != CSSSelector::PseudoClass)
+ if (selector.m_match != CSSSelector::PseudoClass)
return false;
- CSSSelector::PseudoType pseudoType = selector->pseudoType();
+ CSSSelector::PseudoType pseudoType = selector.pseudoType();
return pseudoType == CSSSelector::PseudoLink
|| pseudoType == CSSSelector::PseudoAnyLink
|| pseudoType == CSSSelector::PseudoVisited
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698