Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLCollection.h
index e4c8fb4..8c00d08 100644 (file)
 #define HTMLCollection_h
 
 #include "core/dom/LiveNodeListBase.h"
-#include "core/html/CollectionIndexCache.h"
+#include "core/html/CollectionItemsCache.h"
 #include "core/html/CollectionType.h"
 #include "wtf/Forward.h"
 
 namespace blink {
 
 class HTMLCollection : public RefCountedWillBeGarbageCollectedFinalized<HTMLCollection>, public ScriptWrappable, public LiveNodeListBase {
+    DEFINE_WRAPPERTYPEINFO();
     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCollection);
 public:
     enum ItemAfterOverrideType {
@@ -53,14 +54,14 @@ public:
 
     // Non-DOM API
     void namedItems(const AtomicString& name, WillBeHeapVector<RefPtrWillBeMember<Element> >&) const;
-    bool isEmpty() const { return m_collectionIndexCache.isEmpty(*this); }
-    bool hasExactlyOneItem() const { return m_collectionIndexCache.hasExactlyOneNode(*this); }
+    bool isEmpty() const { return m_collectionItemsCache.isEmpty(*this); }
+    bool hasExactlyOneItem() const { return m_collectionItemsCache.hasExactlyOneNode(*this); }
     bool elementMatches(const Element&) const;
 
     // CollectionIndexCache API.
     bool canTraverseBackward() const { return !overridesItemAfter(); }
-    Element* traverseToFirstElement() const;
-    Element* traverseToLastElement() const;
+    Element* traverseToFirst() const;
+    Element* traverseToLast() const;
     Element* traverseForwardToOffset(unsigned offset, Element& currentElement, unsigned& currentOffset) const;
     Element* traverseBackwardToOffset(unsigned offset, Element& currentElement, unsigned& currentOffset) const;
 
@@ -148,7 +149,7 @@ private:
     const unsigned m_overridesItemAfter : 1;
     const unsigned m_shouldOnlyIncludeDirectChildren : 1;
     mutable OwnPtrWillBeMember<NamedItemCache> m_namedItemCache;
-    mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache;
+    mutable CollectionItemsCache<HTMLCollection, Element> m_collectionItemsCache;
 };
 
 DEFINE_TYPE_CASTS(HTMLCollection, LiveNodeListBase, collection, isHTMLCollectionType(collection->type()), isHTMLCollectionType(collection.type()));
@@ -161,6 +162,6 @@ inline void HTMLCollection::invalidateCacheForAttribute(const QualifiedName* att
         invalidateIdNameCacheMaps();
 }
 
-} // namespace
+} // namespace blink
 
-#endif
+#endif // HTMLCollection_h