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

Unified Diff: Source/core/html/CollectionIndexCache.h

Issue 469913002: Rename CollectionIndexCache API to not use 'Element' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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/dom/LiveNodeList.cpp ('k') | Source/core/html/HTMLCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/CollectionIndexCache.h
diff --git a/Source/core/html/CollectionIndexCache.h b/Source/core/html/CollectionIndexCache.h
index 2f039efd65b22a3c144aa6089df81dfff127af2e..3d5fc2aad58ac68ff697b2c2be678e53a6a4ba9c 100644
--- a/Source/core/html/CollectionIndexCache.h
+++ b/Source/core/html/CollectionIndexCache.h
@@ -138,7 +138,7 @@ inline NodeType* CollectionIndexCache<Collection, NodeType>::nodeAt(const Collec
// No valid cache yet, let's find the first matching element.
ASSERT(!isCachedNodeCountValid());
- NodeType* firstNode = collection.traverseToFirstElement();
+ NodeType* firstNode = collection.traverseToFirst();
if (!firstNode) {
// The collection is empty.
setCachedNodeCount(0);
@@ -158,7 +158,7 @@ inline NodeType* CollectionIndexCache<Collection, NodeType>::nodeBeforeCachedNod
// Determine if we should traverse from the beginning of the collection instead of the cached node.
bool firstIsCloser = index < currentIndex - index;
if (firstIsCloser || !collection.canTraverseBackward()) {
- NodeType* firstNode = collection.traverseToFirstElement();
+ NodeType* firstNode = collection.traverseToFirst();
ASSERT(firstNode);
setCachedNode(firstNode, 0);
return index ? nodeAfterCachedNode(collection, index) : firstNode;
@@ -182,7 +182,7 @@ inline NodeType* CollectionIndexCache<Collection, NodeType>::nodeAfterCachedNode
// Determine if we should traverse from the end of the collection instead of the cached node.
bool lastIsCloser = isCachedNodeCountValid() && cachedNodeCount() - index < index - currentIndex;
if (lastIsCloser && collection.canTraverseBackward()) {
- NodeType* lastItem = collection.traverseToLastElement();
+ NodeType* lastItem = collection.traverseToLast();
ASSERT(lastItem);
setCachedNode(lastItem, cachedNodeCount() - 1);
if (index < cachedNodeCount() - 1)
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/html/HTMLCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698