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

Unified Diff: Source/core/dom/LiveNodeList.h

Issue 120383002: HTMLCollection should not inherit NodeList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/HTMLCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeList.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeList.h
index 2145b245f9ee85166540f90302f42a95b2ed0c70..02be1d66d7a916a47c6e5923dec051ba628328c8 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeList.h
@@ -41,7 +41,7 @@ enum NodeListRootType {
NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr,
};
-class LiveNodeListBase : public NodeList {
+class LiveNodeListBase {
public:
enum ItemAfterOverrideType {
OverridesItemAfter,
@@ -77,9 +77,8 @@ public:
document().unregisterNodeList(this);
}
- // DOM API
- virtual unsigned length() const OVERRIDE;
- virtual Node* item(unsigned offset) const OVERRIDE;
+ unsigned length() const;
+ Node* item(unsigned offset) const;
ALWAYS_INLINE bool hasIdNameCache() const { return !isNodeList(type()); }
ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeListIsRootedAtDocument || m_rootType == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr; }
@@ -186,18 +185,20 @@ ALWAYS_INLINE bool LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(NodeL
return false;
}
-class LiveNodeList : public LiveNodeListBase {
+class LiveNodeList : public NodeList, public LiveNodeListBase {
public:
LiveNodeList(PassRefPtr<Node> ownerNode, CollectionType collectionType, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode)
: LiveNodeListBase(ownerNode.get(), rootType, invalidationType, collectionType == ChildNodeListType,
collectionType, DoesNotOverrideItemAfter)
{ }
- virtual Node* namedItem(const AtomicString&) const OVERRIDE;
+ virtual unsigned length() const OVERRIDE FINAL { return LiveNodeListBase::length(); }
+ virtual Node* item(unsigned offset) const OVERRIDE FINAL { return LiveNodeListBase::item(offset); }
+ virtual Node* namedItem(const AtomicString&) const OVERRIDE FINAL;
virtual bool nodeMatches(Element*) const = 0;
private:
- virtual bool isLiveNodeList() const OVERRIDE { return true; }
+ virtual bool isLiveNodeList() const OVERRIDE FINAL { return true; }
};
} // namespace WebCore
« no previous file with comments | « no previous file | Source/core/html/HTMLCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698