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

Unified Diff: Source/core/html/HTMLCollection.h

Issue 137433008: Have HTMLCollection::item() return an Element as per specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLAllCollection.idl ('k') | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCollection.h
diff --git a/Source/core/html/HTMLCollection.h b/Source/core/html/HTMLCollection.h
index d37e3cae21771d95d5241bbdb2fab164d0f0d02c..dc62bd0b4f1cad66e8584a68f115c8fcfc851a40 100644
--- a/Source/core/html/HTMLCollection.h
+++ b/Source/core/html/HTMLCollection.h
@@ -44,7 +44,7 @@ public:
// DOM API
unsigned length() const { return m_collectionIndexCache.nodeCount(*this); }
- Node* item(unsigned offset) const { return m_collectionIndexCache.nodeAt(*this, offset); }
+ Element* item(unsigned offset) const { return m_collectionIndexCache.nodeAt(*this, offset); }
virtual Element* namedItem(const AtomicString& name) const;
// Non-DOM API
@@ -54,8 +54,9 @@ public:
// CollectionIndexCache API.
bool canTraverseBackward() const { return !overridesItemAfter(); }
+ Element* itemBefore(const Node* previousItem) const;
Element* traverseToFirstElement(const ContainerNode& root) const;
- Element* traverseForwardToOffset(unsigned offset, Node& currentElement, unsigned& currentOffset, const ContainerNode& root) const;
+ Element* traverseForwardToOffset(unsigned offset, Element& currentElement, unsigned& currentOffset, const ContainerNode& root) const;
protected:
HTMLCollection(ContainerNode* base, CollectionType, ItemAfterOverrideType);
@@ -89,7 +90,7 @@ private:
mutable unsigned m_isNameCacheValid : 1;
mutable NodeCacheMap m_idCache;
mutable NodeCacheMap m_nameCache;
- mutable CollectionIndexCache<HTMLCollection> m_collectionIndexCache;
+ mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache;
friend class LiveNodeListBase;
};
« no previous file with comments | « Source/core/html/HTMLAllCollection.idl ('k') | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698