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

Unified Diff: third_party/WebKit/Source/core/dom/Element.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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index a403176069c3b352a8a11cbf448a268666686e72..54669b40f5a9bb14fca0be788e54c62ba68c47dd 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3344,18 +3344,19 @@ LayoutObject* Element::pseudoElementLayoutObject(PseudoId pseudoId) const {
return nullptr;
}
-bool Element::matches(const String& selectors, ExceptionState& exceptionState) {
+bool Element::matches(const AtomicString& selectors,
+ ExceptionState& exceptionState) {
SelectorQuery* selectorQuery = document().selectorQueryCache().add(
- AtomicString(selectors), document(), exceptionState);
+ selectors, document(), exceptionState);
if (!selectorQuery)
return false;
return selectorQuery->matches(*this);
}
-Element* Element::closest(const String& selectors,
+Element* Element::closest(const AtomicString& selectors,
ExceptionState& exceptionState) {
SelectorQuery* selectorQuery = document().selectorQueryCache().add(
- AtomicString(selectors), document(), exceptionState);
+ selectors, document(), exceptionState);
if (!selectorQuery)
return nullptr;
return selectorQuery->closest(*this);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698