#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 {
// 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;
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()));
invalidateIdNameCacheMaps();
}
-} // namespace
+} // namespace blink
-#endif
+#endif // HTMLCollection_h