diff options
Diffstat (limited to 'Source/WebCore/dom/NodeList.h')
-rw-r--r-- | Source/WebCore/dom/NodeList.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/WebCore/dom/NodeList.h b/Source/WebCore/dom/NodeList.h index cd82115fd..1b99ce600 100644 --- a/Source/WebCore/dom/NodeList.h +++ b/Source/WebCore/dom/NodeList.h @@ -21,8 +21,7 @@ * */ -#ifndef NodeList_h -#define NodeList_h +#pragma once #include "ScriptWrappable.h" #include <wtf/Forward.h> @@ -39,14 +38,23 @@ public: // DOM methods & attributes for NodeList virtual unsigned length() const = 0; virtual Node* item(unsigned index) const = 0; - virtual Node* namedItem(const AtomicString&) const = 0; + + class Iterator { + public: + explicit Iterator(NodeList& list) : m_list(list) { } + Node* next() { return m_list->item(m_index++); } + + private: + size_t m_index { 0 }; + Ref<NodeList> m_list; + }; + Iterator createIterator() { return Iterator(*this); } // Other methods (not part of DOM) virtual bool isLiveNodeList() const { return false; } virtual bool isChildNodeList() const { return false; } virtual bool isEmptyNodeList() const { return false; } + virtual size_t memoryCost() const { return 0; } }; } // namespace WebCore - -#endif // NodeList_h |