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

Unified Diff: Source/core/html/HTMLCollection.cpp

Issue 450273003: Uninline HTMLCollection / LiveNodeList's item() and length() member functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/core/html/HTMLCollection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCollection.cpp
diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
index 85be33adee94189b9952e65dfb4460c1a65eada2..6402d501849435ac64123ad87c3b3f89c9e09bd0 100644
--- a/Source/core/html/HTMLCollection.cpp
+++ b/Source/core/html/HTMLCollection.cpp
@@ -191,6 +191,16 @@ void HTMLCollection::invalidateCache(Document* oldDocument) const
invalidateIdNameCacheMaps(oldDocument);
}
+unsigned HTMLCollection::length() const
+{
+ return m_collectionIndexCache.nodeCount(*this);
+}
+
+Element* HTMLCollection::item(unsigned offset) const
+{
+ return m_collectionIndexCache.nodeAt(*this, offset);
+}
+
static inline bool isMatchingHTMLElement(const HTMLCollection& htmlCollection, const HTMLElement& element)
{
switch (htmlCollection.type()) {
« no previous file with comments | « Source/core/html/HTMLCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698