| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool hasNameCache() const { return m_isNameCacheValid; } | 68 bool hasNameCache() const { return m_isNameCacheValid; } |
| 69 void setHasNameCache() const { m_isNameCacheValid = true; } | 69 void setHasNameCache() const { m_isNameCacheValid = true; } |
| 70 | 70 |
| 71 typedef HashMap<StringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap; | 71 typedef HashMap<StringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap; |
| 72 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache
.get(name.impl()); } | 72 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache
.get(name.impl()); } |
| 73 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC
ache.get(name.impl()); } | 73 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC
ache.get(name.impl()); } |
| 74 void appendIdCache(const AtomicString& name, Element* element) const { appen
d(m_idCache, name, element); } | 74 void appendIdCache(const AtomicString& name, Element* element) const { appen
d(m_idCache, name, element); } |
| 75 void appendNameCache(const AtomicString& name, Element* element) const { app
end(m_nameCache, name, element); } | 75 void appendNameCache(const AtomicString& name, Element* element) const { app
end(m_nameCache, name, element); } |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 bool checkForNameMatch(const Element&, bool checkName, const AtomicString& n
ame) const; | |
| 79 Element* traverseNextElement(Element& previous, const ContainerNode& root) c
onst; | 78 Element* traverseNextElement(Element& previous, const ContainerNode& root) c
onst; |
| 80 | 79 |
| 81 static void append(NodeCacheMap&, const AtomicString&, Element*); | 80 static void append(NodeCacheMap&, const AtomicString&, Element*); |
| 82 void invalidateIdNameCacheMaps() const | 81 void invalidateIdNameCacheMaps() const |
| 83 { | 82 { |
| 84 m_idCache.clear(); | 83 m_idCache.clear(); |
| 85 m_nameCache.clear(); | 84 m_nameCache.clear(); |
| 86 m_isNameCacheValid = false; | 85 m_isNameCacheValid = false; |
| 87 } | 86 } |
| 88 | 87 |
| 89 const unsigned m_overridesItemAfter : 1; | 88 const unsigned m_overridesItemAfter : 1; |
| 90 mutable unsigned m_isNameCacheValid : 1; | 89 mutable unsigned m_isNameCacheValid : 1; |
| 91 mutable NodeCacheMap m_idCache; | 90 mutable NodeCacheMap m_idCache; |
| 92 mutable NodeCacheMap m_nameCache; | 91 mutable NodeCacheMap m_nameCache; |
| 93 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache
; | 92 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache
; |
| 94 | 93 |
| 95 friend class LiveNodeListBase; | 94 friend class LiveNodeListBase; |
| 96 }; | 95 }; |
| 97 | 96 |
| 98 } // namespace | 97 } // namespace |
| 99 | 98 |
| 100 #endif | 99 #endif |
| OLD | NEW |