| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual Element* virtualItemAfter(unsigned& offsetInArray, Element*) const; | 63 virtual Element* virtualItemAfter(unsigned& offsetInArray, Element*) const; |
| 64 | 64 |
| 65 Element* traverseFirstElement(unsigned& offsetInArray, ContainerNode* root)
const; | 65 Element* traverseFirstElement(unsigned& offsetInArray, ContainerNode* root)
const; |
| 66 Element* traverseForwardToOffset(unsigned offset, Element* currentElement, u
nsigned& currentOffset, unsigned& offsetInArray, ContainerNode* root) const; | 66 Element* traverseForwardToOffset(unsigned offset, Element* currentElement, u
nsigned& currentOffset, unsigned& offsetInArray, ContainerNode* root) const; |
| 67 | 67 |
| 68 protected: | 68 protected: |
| 69 HTMLCollection(Node* base, CollectionType, ItemAfterOverrideType); | 69 HTMLCollection(Node* base, CollectionType, ItemAfterOverrideType); |
| 70 | 70 |
| 71 virtual void updateNameCache() const; | 71 virtual void updateNameCache() const; |
| 72 | 72 |
| 73 typedef HashMap<AtomicStringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap; | 73 typedef HashMap<StringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap; |
| 74 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache
.get(name.impl()); } | 74 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache
.get(name.impl()); } |
| 75 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC
ache.get(name.impl()); } | 75 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC
ache.get(name.impl()); } |
| 76 void appendIdCache(const AtomicString& name, Element* element) const { appen
d(m_idCache, name, element); } | 76 void appendIdCache(const AtomicString& name, Element* element) const { appen
d(m_idCache, name, element); } |
| 77 void appendNameCache(const AtomicString& name, Element* element) const { app
end(m_nameCache, name, element); } | 77 void appendNameCache(const AtomicString& name, Element* element) const { app
end(m_nameCache, name, element); } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 bool checkForNameMatch(Element*, bool checkName, const AtomicString& name) c
onst; | 80 bool checkForNameMatch(Element*, bool checkName, const AtomicString& name) c
onst; |
| 81 Element* traverseNextElement(unsigned& offsetInArray, Element* previous, Con
tainerNode* root) const; | 81 Element* traverseNextElement(unsigned& offsetInArray, Element* previous, Con
tainerNode* root) const; |
| 82 | 82 |
| 83 virtual bool isLiveNodeList() const OVERRIDE { ASSERT_NOT_REACHED(); return
true; } | 83 virtual bool isLiveNodeList() const OVERRIDE { ASSERT_NOT_REACHED(); return
true; } |
| 84 | 84 |
| 85 static void append(NodeCacheMap&, const AtomicString&, Element*); | 85 static void append(NodeCacheMap&, const AtomicString&, Element*); |
| 86 | 86 |
| 87 mutable NodeCacheMap m_idCache; | 87 mutable NodeCacheMap m_idCache; |
| 88 mutable NodeCacheMap m_nameCache; | 88 mutable NodeCacheMap m_nameCache; |
| 89 mutable unsigned m_cachedElementsArrayOffset; | 89 mutable unsigned m_cachedElementsArrayOffset; |
| 90 | 90 |
| 91 friend class LiveNodeListBase; | 91 friend class LiveNodeListBase; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 #endif | 96 #endif |
| OLD | NEW |