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

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

Issue 53683007: Have SelectorQuery API take rootNode by reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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/ElementRuleCollector.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 127931de2226b9a3dd112f7fb0c8bd79ec9bcf61..2d228a8a1e7bdc1a8c4dc6959497f6f1c1be2412 100644
--- a/Source/core/css/SelectorChecker.h
+++ b/Source/core/css/SelectorChecker.h
@@ -103,22 +103,22 @@ public:
Mode mode() const { return m_mode; }
- static bool tagMatches(const Element*, const QualifiedName&, MatchingTagType = MatchingElement);
+ static bool tagMatches(const Element&, const QualifiedName&, MatchingTagType = MatchingElement);
static bool isCommonPseudoClassSelector(const CSSSelector*);
- static bool matchesFocusPseudoClass(const Element*);
- static bool checkExactAttribute(const Element*, const QualifiedName& selectorAttributeName, const StringImpl* value);
+ 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 bool isHostInItsShadowTree(const Element*, BehaviorAtBoundary, const ContainerNode* scope);
+ static bool isHostInItsShadowTree(const Element&, BehaviorAtBoundary, const ContainerNode* scope);
private:
bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, const CSSSelector*) const;
Element* parentElement(const SelectorCheckingContext&) const;
bool scopeContainsLastMatchedElement(const SelectorCheckingContext&) const;
- static bool isFrameFocused(const Element*);
+ static bool isFrameFocused(const Element&);
bool m_strictParsing;
bool m_documentIsHTML;
@@ -136,31 +136,31 @@ inline bool SelectorChecker::isCommonPseudoClassSelector(const CSSSelector* sele
|| pseudoType == CSSSelector::PseudoFocus;
}
-inline bool SelectorChecker::tagMatches(const Element* element, const QualifiedName& tagQName, MatchingTagType matchingTagType)
+inline bool SelectorChecker::tagMatches(const Element& element, const QualifiedName& tagQName, MatchingTagType matchingTagType)
{
if (tagQName == anyQName())
return true;
const AtomicString& localName = tagQName.localName();
- if (localName != starAtom && (localName != element->localName() || matchingTagType == MatchingHostInItsShadowTree))
+ if (localName != starAtom && (localName != element.localName() || matchingTagType == MatchingHostInItsShadowTree))
return false;
const AtomicString& namespaceURI = tagQName.namespaceURI();
- return namespaceURI == starAtom || namespaceURI == element->namespaceURI();
+ return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
}
-inline bool SelectorChecker::checkExactAttribute(const Element* element, const QualifiedName& selectorAttributeName, const StringImpl* value)
+inline bool SelectorChecker::checkExactAttribute(const Element& element, const QualifiedName& selectorAttributeName, const StringImpl* value)
{
- if (!element->hasAttributesWithoutUpdate())
+ if (!element.hasAttributesWithoutUpdate())
return false;
- unsigned size = element->attributeCount();
+ unsigned size = element.attributeCount();
for (unsigned i = 0; i < size; ++i) {
- const Attribute* attribute = element->attributeItem(i);
+ const Attribute* attribute = element.attributeItem(i);
if (attribute->matches(selectorAttributeName) && (!value || attribute->value().impl() == value))
return true;
}
return false;
}
-inline bool SelectorChecker::isHostInItsShadowTree(const Element* element, BehaviorAtBoundary behaviorAtBoundary, const ContainerNode* scope)
+inline bool SelectorChecker::isHostInItsShadowTree(const Element& element, BehaviorAtBoundary behaviorAtBoundary, const ContainerNode* scope)
{
return (behaviorAtBoundary & ScopeIsShadowHost) && scope == element;
}
« no previous file with comments | « Source/core/css/ElementRuleCollector.cpp ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698