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

Unified Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 2769783002: Centralize more querySelector logic behind QuerySelectorCache. (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/Source/core/dom/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index 46aacf5a09266351f9e34286c481c4bf70ec6f1c..044ab80ed5035a41befd9e595f07cdbde0baf663 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -34,7 +34,6 @@
#include "core/dom/NodeComputedStyle.h"
#include "core/dom/NodeRareData.h"
#include "core/dom/NodeTraversal.h"
-#include "core/dom/NthIndexCache.h"
#include "core/dom/SelectorQuery.h"
#include "core/dom/StaticNodeList.h"
#include "core/dom/StyleChangeReason.h"
@@ -1173,36 +1172,20 @@ unsigned ContainerNode::countChildren() const {
Element* ContainerNode::querySelector(const AtomicString& selectors,
ExceptionState& exceptionState) {
- if (selectors.isEmpty()) {
- exceptionState.throwDOMException(SyntaxError,
- "The provided selector is empty.");
- return nullptr;
- }
-
SelectorQuery* selectorQuery = document().selectorQueryCache().add(
selectors, document(), exceptionState);
if (!selectorQuery)
return nullptr;
-
- NthIndexCache nthIndexCache(document());
return selectorQuery->queryFirst(*this);
}
StaticElementList* ContainerNode::querySelectorAll(
const AtomicString& selectors,
ExceptionState& exceptionState) {
- if (selectors.isEmpty()) {
- exceptionState.throwDOMException(SyntaxError,
- "The provided selector is empty.");
- return nullptr;
- }
-
SelectorQuery* selectorQuery = document().selectorQueryCache().add(
selectors, document(), exceptionState);
if (!selectorQuery)
return nullptr;
-
- NthIndexCache nthIndexCache(document());
return selectorQuery->queryAll(*this);
}

Powered by Google App Engine
This is Rietveld 408576698