Chromium Code Reviews| Index: Source/core/dom/ChildNodeList.h |
| diff --git a/Source/core/dom/ChildNodeList.h b/Source/core/dom/ChildNodeList.h |
| index 46f5beab4b15b00610e0711d120b3b1de6f9e35d..a83afd182ab27a6a37984b594d22053912ef137b 100644 |
| --- a/Source/core/dom/ChildNodeList.h |
| +++ b/Source/core/dom/ChildNodeList.h |
| @@ -31,7 +31,7 @@ namespace WebCore { |
| class ChildNodeList FINAL : public LiveNodeList { |
| public: |
| - static PassRefPtr<ChildNodeList> create(PassRefPtr<Node> rootNode) |
| + static PassRefPtr<ChildNodeList> create(PassRefPtr<ContainerNode> rootNode) |
| { |
| return adoptRef(new ChildNodeList(rootNode)); |
| } |
| @@ -39,11 +39,33 @@ public: |
| virtual ~ChildNodeList(); |
| protected: |
| - explicit ChildNodeList(PassRefPtr<Node> rootNode); |
| + explicit ChildNodeList(PassRefPtr<ContainerNode> rootNode); |
| virtual bool nodeMatches(Element*) const OVERRIDE; |
| }; |
| +class EmptyNodeList FINAL : public NodeList { |
|
esprehn
2014/01/17 07:06:20
Please put this in its own file.
Inactive
2014/01/17 15:00:48
Done.
|
| +public: |
| + static PassRefPtr<EmptyNodeList> create(Node* owner) |
| + { |
| + return adoptRef(new EmptyNodeList(owner)); |
| + } |
| + virtual ~EmptyNodeList(); |
| + |
| + Node* ownerNode() const { return m_owner.get(); } |
| + |
| +private: |
| + explicit EmptyNodeList(Node* owner) : m_owner(owner) { } |
| + |
| + virtual unsigned length() const OVERRIDE { return 0; } |
| + virtual Node* item(unsigned) const OVERRIDE { return 0; } |
| + virtual Node* namedItem(const AtomicString&) const OVERRIDE { return 0; } |
| + |
| + virtual bool isEmptyNodeList() const OVERRIDE { return true; } |
| + |
| + RefPtr<Node> m_owner; |
| +}; |
| + |
| } // namespace WebCore |
| #endif // ChildNodeList_h |