Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: Source/core/dom/LiveNodeList.h

Issue 161083002: Make NodeList::ownerNode() virtual and rename to virtualOwnerNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reupload Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 class LiveNodeList : public NodeList, public LiveNodeListBase { 128 class LiveNodeList : public NodeList, public LiveNodeListBase {
129 public: 129 public:
130 LiveNodeList(PassRefPtr<ContainerNode> ownerNode, CollectionType collectionT ype, NodeListInvalidationType invalidationType, NodeListRootType rootType = Node ListIsRootedAtNode) 130 LiveNodeList(PassRefPtr<ContainerNode> ownerNode, CollectionType collectionT ype, NodeListInvalidationType invalidationType, NodeListRootType rootType = Node ListIsRootedAtNode)
131 : LiveNodeListBase(ownerNode.get(), rootType, invalidationType, 131 : LiveNodeListBase(ownerNode.get(), rootType, invalidationType,
132 collectionType) 132 collectionType)
133 { } 133 { }
134 134
135 virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCac he.nodeCount(*this); } 135 virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCac he.nodeCount(*this); }
136 virtual Node* item(unsigned offset) const OVERRIDE FINAL { return m_collecti onIndexCache.nodeAt(*this, offset); } 136 virtual Node* item(unsigned offset) const OVERRIDE FINAL { return m_collecti onIndexCache.nodeAt(*this, offset); }
137 virtual bool nodeMatches(const Element&) const = 0; 137 virtual bool nodeMatches(const Element&) const = 0;
138 // Avoid ambiguity since both NodeList and LiveNodeListBase have an ownerNod e() method.
139 using LiveNodeListBase::ownerNode;
140 138
141 virtual void invalidateCache() const OVERRIDE FINAL; 139 virtual void invalidateCache() const OVERRIDE FINAL;
142 bool shouldOnlyIncludeDirectChildren() const { return false; } 140 bool shouldOnlyIncludeDirectChildren() const { return false; }
143 141
144 // Collection IndexCache API. 142 // Collection IndexCache API.
145 bool canTraverseBackward() const { return true; } 143 bool canTraverseBackward() const { return true; }
146 Element* itemBefore(const Element* previousItem) const; 144 Element* itemBefore(const Element* previousItem) const;
147 Element* traverseToFirstElement(const ContainerNode& root) const; 145 Element* traverseToFirstElement(const ContainerNode& root) const;
148 Element* traverseForwardToOffset(unsigned offset, Element& currentNode, unsi gned& currentOffset, const ContainerNode& root) const; 146 Element* traverseForwardToOffset(unsigned offset, Element& currentNode, unsi gned& currentOffset, const ContainerNode& root) const;
149 147
150 private: 148 private:
151 virtual bool isLiveNodeList() const OVERRIDE FINAL { return true; } 149 virtual Node* virtualOwnerNode() const OVERRIDE FINAL;
152 150
153 mutable CollectionIndexCache<LiveNodeList, Element> m_collectionIndexCache; 151 mutable CollectionIndexCache<LiveNodeList, Element> m_collectionIndexCache;
154 }; 152 };
155 153
156 } // namespace WebCore 154 } // namespace WebCore
157 155
158 #endif // LiveNodeList_h 156 #endif // LiveNodeList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698