| 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 | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All |
| 5 * rights reserved. | 5 * rights reserved. |
| 6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 DECLARE_VIRTUAL_TRACE(); | 116 DECLARE_VIRTUAL_TRACE(); |
| 117 | 117 |
| 118 protected: | 118 protected: |
| 119 HTMLCollection(ContainerNode& base, CollectionType, ItemAfterOverrideType); | 119 HTMLCollection(ContainerNode& base, CollectionType, ItemAfterOverrideType); |
| 120 | 120 |
| 121 class NamedItemCache final : public GarbageCollected<NamedItemCache> { | 121 class NamedItemCache final : public GarbageCollected<NamedItemCache> { |
| 122 public: | 122 public: |
| 123 static NamedItemCache* create() { return new NamedItemCache; } | 123 static NamedItemCache* create() { return new NamedItemCache; } |
| 124 | 124 |
| 125 HeapVector<Member<Element>>* getElementsById(const AtomicString& id) const { | 125 HeapVector<Member<Element>>* getElementsById(const AtomicString& id) const { |
| 126 return m_idCache.get(id.impl()); | 126 return m_idCache.at(id.impl()); |
| 127 } | 127 } |
| 128 HeapVector<Member<Element>>* getElementsByName( | 128 HeapVector<Member<Element>>* getElementsByName( |
| 129 const AtomicString& name) const { | 129 const AtomicString& name) const { |
| 130 return m_nameCache.get(name.impl()); | 130 return m_nameCache.at(name.impl()); |
| 131 } | 131 } |
| 132 void addElementWithId(const AtomicString& id, Element* element) { | 132 void addElementWithId(const AtomicString& id, Element* element) { |
| 133 addElementToMap(m_idCache, id, element); | 133 addElementToMap(m_idCache, id, element); |
| 134 } | 134 } |
| 135 void addElementWithName(const AtomicString& name, Element* element) { | 135 void addElementWithName(const AtomicString& name, Element* element) { |
| 136 addElementToMap(m_nameCache, name, element); | 136 addElementToMap(m_nameCache, name, element); |
| 137 } | 137 } |
| 138 | 138 |
| 139 DEFINE_INLINE_TRACE() { | 139 DEFINE_INLINE_TRACE() { |
| 140 visitor->trace(m_idCache); | 140 visitor->trace(m_idCache); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 if (!attrName || | 220 if (!attrName || |
| 221 shouldInvalidateTypeOnAttributeChange(invalidationType(), *attrName)) | 221 shouldInvalidateTypeOnAttributeChange(invalidationType(), *attrName)) |
| 222 invalidateCache(); | 222 invalidateCache(); |
| 223 else if (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr) | 223 else if (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr) |
| 224 invalidateIdNameCacheMaps(); | 224 invalidateIdNameCacheMaps(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| 228 | 228 |
| 229 #endif // HTMLCollection_h | 229 #endif // HTMLCollection_h |
| OLD | NEW |