Chromium Code Reviews| Index: Source/core/dom/ContainerNode.h |
| diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h |
| index 55c3bf4f55456da9294cc103f6e702a8001ec93c..c9b2030c2fba97489a122df59a3a324942689816 100644 |
| --- a/Source/core/dom/ContainerNode.h |
| +++ b/Source/core/dom/ContainerNode.h |
| @@ -284,7 +284,7 @@ class ChildNodesLazySnapshot { |
| WTF_MAKE_FAST_ALLOCATED; |
| public: |
| explicit ChildNodesLazySnapshot(Node* parentNode) |
| - : m_currentNode(parentNode->firstChild()) |
| + : m_currentNode(parentNode->lastChild()) |
| , m_currentIndex(0) |
| { |
| m_nextSnapshot = latestSnapshot; |
| @@ -297,12 +297,12 @@ public: |
| } |
| // Returns 0 if there is no next Node. |
|
esprehn
2013/06/05 00:12:26
is no previous node?
|
| - PassRefPtr<Node> nextNode() |
| + PassRefPtr<Node> previousNode() |
| { |
| if (LIKELY(!hasSnapshot())) { |
| RefPtr<Node> node = m_currentNode; |
| if (node) |
| - m_currentNode = node->nextSibling(); |
| + m_currentNode = node->previousSibling(); |
| return node.release(); |
| } |
| Vector<RefPtr<Node> >& nodeVector = *m_childNodes; |
| @@ -319,7 +319,7 @@ public: |
| Node* node = m_currentNode.get(); |
| while (node) { |
| m_childNodes->append(node); |
| - node = node->nextSibling(); |
| + node = node->previousSibling(); |
| } |
| } |