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

Unified Diff: Source/core/dom/TreeScope.cpp

Issue 92083002: Add fast path for tag#id selector queries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move emptyVector Created 7 years 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/TreeScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 0edb20cf2b66e6765bf442bc9f89da67c8ca227f..c8a198b88806c3da0807bd9ce1e8ff84a1bbafe8 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -150,6 +150,16 @@ Element* TreeScope::getElementById(const AtomicString& elementId) const
return m_elementsById->getElementById(elementId.impl(), this);
}
+const Vector<Element*>& TreeScope::getAllElementsById(const AtomicString& elementId) const
+{
+ DEFINE_STATIC_LOCAL(Vector<Element*>, emptyVector, ());
+ if (elementId.isEmpty())
+ return emptyVector;
+ if (!m_elementsById)
+ return emptyVector;
+ return m_elementsById->getAllElementsById(elementId.impl(), this);
+}
+
void TreeScope::addElementById(const AtomicString& elementId, Element* element)
{
if (!m_elementsById)
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698