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

Side by Side Diff: Source/core/html/HTMLCollection.h

Issue 154693002: Have ChildNodeList subclass NodeList instead of LiveNodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update copyright 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 unified diff | Download patch
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 Element* item(unsigned offset) const { return m_collectionIndexCache.nodeAt( *this, offset); } 47 Element* item(unsigned offset) const { return m_collectionIndexCache.nodeAt( *this, offset); }
48 virtual Element* namedItem(const AtomicString& name) const; 48 virtual Element* namedItem(const AtomicString& name) const;
49 49
50 // Non-DOM API 50 // Non-DOM API
51 void namedItems(const AtomicString& name, Vector<RefPtr<Element> >&) const; 51 void namedItems(const AtomicString& name, Vector<RefPtr<Element> >&) const;
52 bool isEmpty() const { return m_collectionIndexCache.isEmpty(*this); } 52 bool isEmpty() const { return m_collectionIndexCache.isEmpty(*this); }
53 bool hasExactlyOneItem() const { return m_collectionIndexCache.hasExactlyOne Node(*this); } 53 bool hasExactlyOneItem() const { return m_collectionIndexCache.hasExactlyOne Node(*this); }
54 54
55 // CollectionIndexCache API. 55 // CollectionIndexCache API.
56 bool canTraverseBackward() const { return !overridesItemAfter(); } 56 bool canTraverseBackward() const { return !overridesItemAfter(); }
57 Element* itemBefore(const Node* previousItem) const; 57 Element* itemBefore(const Element* previousItem) const;
58 Element* traverseToFirstElement(const ContainerNode& root) const; 58 Element* traverseToFirstElement(const ContainerNode& root) const;
59 Element* traverseForwardToOffset(unsigned offset, Element& currentElement, u nsigned& currentOffset, const ContainerNode& root) const; 59 Element* traverseForwardToOffset(unsigned offset, Element& currentElement, u nsigned& currentOffset, const ContainerNode& root) const;
60 60
61 protected: 61 protected:
62 HTMLCollection(ContainerNode* base, CollectionType, ItemAfterOverrideType); 62 HTMLCollection(ContainerNode* base, CollectionType, ItemAfterOverrideType);
63 63
64 bool overridesItemAfter() const { return m_overridesItemAfter; } 64 bool overridesItemAfter() const { return m_overridesItemAfter; }
65 virtual Element* virtualItemAfter(Element*) const; 65 virtual Element* virtualItemAfter(Element*) const;
66 66
67 virtual void updateNameCache() const; 67 virtual void updateNameCache() const;
(...skipping 23 matching lines...) Expand all
91 mutable NodeCacheMap m_idCache; 91 mutable NodeCacheMap m_idCache;
92 mutable NodeCacheMap m_nameCache; 92 mutable NodeCacheMap m_nameCache;
93 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache ; 93 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache ;
94 94
95 friend class LiveNodeListBase; 95 friend class LiveNodeListBase;
96 }; 96 };
97 97
98 } // namespace 98 } // namespace
99 99
100 #endif 100 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698