summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom/ChildNodeList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/ChildNodeList.cpp')
-rw-r--r--Source/WebCore/dom/ChildNodeList.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/Source/WebCore/dom/ChildNodeList.cpp b/Source/WebCore/dom/ChildNodeList.cpp
index 253537c..3328c7c 100644
--- a/Source/WebCore/dom/ChildNodeList.cpp
+++ b/Source/WebCore/dom/ChildNodeList.cpp
@@ -27,27 +27,19 @@
namespace WebCore {
-ChildNodeList::ChildNodeList(PassRefPtr<Node> rootNode)
- : DynamicNodeList(rootNode)
+ChildNodeList::ChildNodeList(PassRefPtr<Node> rootNode, DynamicNodeList::Caches* info)
+ : DynamicNodeList(rootNode, info)
{
}
-ChildNodeList::~ChildNodeList()
-{
- m_rootNode->removeCachedChildNodeList(this);
-}
-
unsigned ChildNodeList::length() const
{
if (m_caches->isLengthCacheValid)
return m_caches->cachedLength;
unsigned len = 0;
- Vector<Node* >& cachedNodes = m_caches->cachedNodes;
- for (Node* n = m_rootNode->firstChild(); n; n = n->nextSibling()) {
- cachedNodes.append(n);
+ for (Node* n = m_rootNode->firstChild(); n; n = n->nextSibling())
len++;
- }
m_caches->cachedLength = len;
m_caches->isLengthCacheValid = true;
@@ -57,9 +49,6 @@ unsigned ChildNodeList::length() const
Node* ChildNodeList::item(unsigned index) const
{
- if (m_caches->isLengthCacheValid && index < m_caches->cachedLength)
- return m_caches->cachedNodes[index];
-
unsigned int pos = 0;
Node* n = m_rootNode->firstChild();