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

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

Issue 331863003: Have NodeList::item() overrides return an Element* when appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/NamedNodesCollection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 35
36 class Element; 36 class Element;
37 37
38 class LiveNodeList : public NodeList, public LiveNodeListBase { 38 class LiveNodeList : public NodeList, public LiveNodeListBase {
39 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LiveNodeList); 39 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LiveNodeList);
40 public: 40 public:
41 LiveNodeList(ContainerNode& ownerNode, CollectionType collectionType, NodeLi stInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRoote dAtNode) 41 LiveNodeList(ContainerNode& ownerNode, CollectionType collectionType, NodeLi stInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRoote dAtNode)
42 : LiveNodeListBase(ownerNode, rootType, invalidationType, collectionType ) { } 42 : LiveNodeListBase(ownerNode, rootType, invalidationType, collectionType ) { }
43 43
44 virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCac he.nodeCount(*this); } 44 virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCac he.nodeCount(*this); }
45 virtual Node* item(unsigned offset) const OVERRIDE FINAL { return m_collecti onIndexCache.nodeAt(*this, offset); } 45 virtual Element* item(unsigned offset) const OVERRIDE FINAL { return m_colle ctionIndexCache.nodeAt(*this, offset); }
46 virtual bool elementMatches(const Element&) const = 0; 46 virtual bool elementMatches(const Element&) const = 0;
47 47
48 virtual void invalidateCache(Document* oldDocument = 0) const OVERRIDE FINAL ; 48 virtual void invalidateCache(Document* oldDocument = 0) const OVERRIDE FINAL ;
49 void invalidateCacheForAttribute(const QualifiedName*) const; 49 void invalidateCacheForAttribute(const QualifiedName*) const;
50 50
51 bool shouldOnlyIncludeDirectChildren() const { return false; } 51 bool shouldOnlyIncludeDirectChildren() const { return false; }
52 52
53 // Collection IndexCache API. 53 // Collection IndexCache API.
54 bool canTraverseBackward() const { return true; } 54 bool canTraverseBackward() const { return true; }
55 Element* traverseToFirstElement() const; 55 Element* traverseToFirstElement() const;
(...skipping 13 matching lines...) Expand all
69 69
70 inline void LiveNodeList::invalidateCacheForAttribute(const QualifiedName* attrN ame) const 70 inline void LiveNodeList::invalidateCacheForAttribute(const QualifiedName* attrN ame) const
71 { 71 {
72 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), * attrName)) 72 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), * attrName))
73 invalidateCache(); 73 invalidateCache();
74 } 74 }
75 75
76 } // namespace WebCore 76 } // namespace WebCore
77 77
78 #endif // LiveNodeList_h 78 #endif // LiveNodeList_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/NamedNodesCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698