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

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: Fix clusterfuzz crash and remove FIXME comment 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
« Source/core/dom/SelectorQuery.cpp ('K') | « 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 3e0494c950cca921f54a5a229db8d9b093f2b840..8f67df1807e058057398af7aa0edf32736520502 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -150,6 +150,15 @@ Element* TreeScope::getElementById(const AtomicString& elementId) const
return m_elementsById->getElementById(elementId.impl(), this);
}
+const Vector<Element*>* TreeScope::getAllElementsById(const AtomicString& elementId) const
+{
+ if (elementId.isEmpty())
+ return 0;
+ if (!m_elementsById)
+ return 0;
esprehn 2013/12/17 18:57:48 Why not return emptyVector? We should just add a s
Inactive 2013/12/17 21:20:24 Done.
+ return m_elementsById->getAllElementsById(elementId.impl(), this);
+}
+
void TreeScope::addElementById(const AtomicString& elementId, Element* element)
{
if (!m_elementsById)
« Source/core/dom/SelectorQuery.cpp ('K') | « Source/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698