| Index: Source/core/html/CollectionIndexCache.h
|
| diff --git a/Source/core/html/CollectionIndexCache.h b/Source/core/html/CollectionIndexCache.h
|
| index ad2a4cfb01c85b5857f23fc6a11c1697a2349af7..efd4aa9475d1f18ca1bfe8d2aea0d0b9df8a2465 100644
|
| --- a/Source/core/html/CollectionIndexCache.h
|
| +++ b/Source/core/html/CollectionIndexCache.h
|
| @@ -130,11 +130,11 @@ inline Node* CollectionIndexCache<Collection>::nodeAt(const Collection& collecti
|
| return 0;
|
|
|
| ContainerNode& root = collection.rootNode();
|
| - if (isCachedNodeCountValid() && !collection.overridesItemAfter() && isLastNodeCloserThanLastOrCachedNode(index)) {
|
| + if (isCachedNodeCountValid() && collection.canTraverseBackward() && isLastNodeCloserThanLastOrCachedNode(index)) {
|
| Node* lastNode = collection.itemBefore(0);
|
| ASSERT(lastNode);
|
| setCachedNode(lastNode, cachedNodeCount() - 1);
|
| - } else if (!cachedNode() || isFirstNodeCloserThanCachedNode(index) || (collection.overridesItemAfter() && index < cachedNodeIndex())) {
|
| + } else if (!cachedNode() || isFirstNodeCloserThanCachedNode(index) || (!collection.canTraverseBackward() && index < cachedNodeIndex())) {
|
| Node* firstNode = collection.traverseToFirstElement(root);
|
| if (!firstNode) {
|
| setCachedNodeCount(0);
|
| @@ -159,7 +159,7 @@ inline Node* CollectionIndexCache<Collection>::nodeBeforeOrAfterCachedNode(const
|
| ASSERT(currentIndex != index);
|
|
|
| if (index < cachedNodeIndex()) {
|
| - ASSERT(!collection.overridesItemAfter());
|
| + ASSERT(collection.canTraverseBackward());
|
| while ((currentNode = collection.itemBefore(currentNode))) {
|
| ASSERT(currentIndex);
|
| currentIndex--;
|
|
|