Chromium Code Reviews

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: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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 c624f9df8ca353c1cc77b9445921efda570824a5..e32c8d74f48761954b8a252efb25fda9160fc795 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -151,6 +151,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;
+ 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