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

Unified Diff: Source/core/dom/SelectorQuery.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/dom/Node.cpp ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SelectorQuery.h
diff --git a/Source/core/dom/SelectorQuery.h b/Source/core/dom/SelectorQuery.h
index 2f654c41d944e9904d29319b73594c8c0bb52311..bbe607c0eedb93d1a5b24812c53072d3230d4f3d 100644
--- a/Source/core/dom/SelectorQuery.h
+++ b/Source/core/dom/SelectorQuery.h
@@ -45,9 +45,9 @@ class SpaceSplitString;
class SelectorDataList {
public:
void initialize(const CSSSelectorList&);
- bool matches(Element*) const;
- PassRefPtr<NodeList> queryAll(Node* rootNode) const;
- PassRefPtr<Element> queryFirst(Node* rootNode) const;
+ bool matches(Element&) const;
+ PassRefPtr<NodeList> queryAll(Node& rootNode) const;
+ PassRefPtr<Element> queryFirst(Node& rootNode) const;
private:
struct SelectorData {
@@ -56,18 +56,18 @@ private:
bool isFastCheckable;
};
- bool canUseFastQuery(Node* rootNode) const;
- bool selectorMatches(const SelectorData&, Element*, const Node*) const;
- void collectElementsByClassName(Node* rootNode, const AtomicString& className, Vector<RefPtr<Node> >&) const;
- Element* findElementByClassName(Node* rootNode, const AtomicString& className) const;
- void collectElementsByTagName(Node* rootNode, const QualifiedName& tagName, Vector<RefPtr<Node> >&) const;
- Element* findElementByTagName(Node* rootNode, const QualifiedName& tagName) const;
+ bool canUseFastQuery(const Node& rootNode) const;
+ bool selectorMatches(const SelectorData&, Element&, const Node&) const;
+ void collectElementsByClassName(Node& rootNode, const AtomicString& className, Vector<RefPtr<Node> >&) const;
+ Element* findElementByClassName(Node& rootNode, const AtomicString& className) const;
+ void collectElementsByTagName(Node& rootNode, const QualifiedName& tagName, Vector<RefPtr<Node> >&) const;
+ Element* findElementByTagName(Node& rootNode, const QualifiedName& tagName) const;
PassOwnPtr<SimpleNodeList> findTraverseRoots(Node* rootNode, bool& matchTraverseRoots) const;
- void executeSlowQueryAll(Node* rootNode, Vector<RefPtr<Node> >& matchedElements) const;
- void executeQueryAll(Node* rootNode, Vector<RefPtr<Node> >& matchedElements) const;
- Node* findTraverseRoot(Node* rootNode, bool& matchTraverseRoot) const;
- Element* executeSlowQueryFirst(Node* rootNode) const;
- Element* executeQueryFirst(Node* rootNode) const;
+ void executeSlowQueryAll(Node& rootNode, Vector<RefPtr<Node> >& matchedElements) const;
+ void executeQueryAll(Node& rootNode, Vector<RefPtr<Node> >& matchedElements) const;
+ Node* findTraverseRoot(Node& rootNode, bool& matchTraverseRoot) const;
+ Element* executeSlowQueryFirst(Node& rootNode) const;
+ Element* executeQueryFirst(Node& rootNode) const;
Vector<SelectorData> m_selectors;
};
@@ -77,9 +77,9 @@ class SelectorQuery {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit SelectorQuery(const CSSSelectorList&);
- bool matches(Element*) const;
- PassRefPtr<NodeList> queryAll(Node* rootNode) const;
- PassRefPtr<Element> queryFirst(Node* rootNode) const;
+ bool matches(Element&) const;
+ PassRefPtr<NodeList> queryAll(Node& rootNode) const;
+ PassRefPtr<Element> queryFirst(Node& rootNode) const;
private:
SelectorDataList m_selectors;
CSSSelectorList m_selectorList;
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698