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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 NamedItemCache(); | 145 NamedItemCache(); |
146 typedef HeapHashMap<StringImpl*, Member<HeapVector<Member<Element>>>> | 146 typedef HeapHashMap<StringImpl*, Member<HeapVector<Member<Element>>>> |
147 StringToElementsMap; | 147 StringToElementsMap; |
148 static void addElementToMap(StringToElementsMap& map, | 148 static void addElementToMap(StringToElementsMap& map, |
149 const AtomicString& key, | 149 const AtomicString& key, |
150 Element* element) { | 150 Element* element) { |
151 Member<HeapVector<Member<Element>>>& vector = | 151 Member<HeapVector<Member<Element>>>& vector = |
152 map.add(key.impl(), nullptr).storedValue->value; | 152 map.add(key.impl(), nullptr).storedValue->value; |
153 if (!vector) | 153 if (!vector) |
154 vector = new HeapVector<Member<Element>>; | 154 vector = new HeapVector<Member<Element>>; |
155 vector->append(element); | 155 vector->push_back(element); |
156 } | 156 } |
157 | 157 |
158 StringToElementsMap m_idCache; | 158 StringToElementsMap m_idCache; |
159 StringToElementsMap m_nameCache; | 159 StringToElementsMap m_nameCache; |
160 }; | 160 }; |
161 | 161 |
162 bool overridesItemAfter() const { return m_overridesItemAfter; } | 162 bool overridesItemAfter() const { return m_overridesItemAfter; } |
163 virtual Element* virtualItemAfter(Element*) const; | 163 virtual Element* virtualItemAfter(Element*) const; |
164 bool shouldOnlyIncludeDirectChildren() const { | 164 bool shouldOnlyIncludeDirectChildren() const { |
165 return m_shouldOnlyIncludeDirectChildren; | 165 return m_shouldOnlyIncludeDirectChildren; |
(...skipping 54 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 |