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

Unified Diff: Source/core/dom/SelectorQuery.h

Issue 18732004: Add fast path for querySelector(All) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: Source/core/dom/SelectorQuery.h
diff --git a/Source/core/dom/SelectorQuery.h b/Source/core/dom/SelectorQuery.h
index 79e6381faeea9d295ebf021105778e29235551c4..24ae4908a77fa4a2a225af6c1a7a5d06bf611d91 100644
--- a/Source/core/dom/SelectorQuery.h
+++ b/Source/core/dom/SelectorQuery.h
@@ -27,6 +27,7 @@
#define SelectorQuery_h
#include "core/css/CSSSelectorList.h"
+#include "core/dom/DocumentOrderedList.h"
#include <wtf/HashMap.h>
#include <wtf/text/AtomicStringHash.h>
#include <wtf/Vector.h>
@@ -40,6 +41,7 @@ class Document;
class Element;
class Node;
class NodeList;
+class SpaceSplitString;
class SelectorDataList {
public:
@@ -55,10 +57,14 @@ private:
bool isFastCheckable;
};
+ bool canUseFastQuery(Node* rootNode) const;
bool selectorMatches(const SelectorData&, Element*, const Node*) const;
- std::pair<bool, Node*> findTraverseRoot(Node* traverseRoot) const;
template <bool firstMatchOnly>
- void execute(Node* rootNode, Vector<RefPtr<Node> >&) const;
+ void collectElementsByClassName(Node* rootNode, const SpaceSplitString& classNames, Vector<Node*>&) const;
+ bool findTraverseRoots(Node* rootNode, Vector<Node*>& traversalRoots) const;
+ void executeQueryAll(Node* rootNode, Vector<RefPtr<Node> >& matchedElements) const;
+ std::pair<bool, Node*> findTraverseRoot(Node* rootNode) const;
+ Element* executeQueryFirst(Node* rootNode) const;
Vector<SelectorData> m_selectors;
};

Powered by Google App Engine
This is Rietveld 408576698