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 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 5 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 case NameNodeListType: | 151 case NameNodeListType: |
152 case RadioNodeListType: | 152 case RadioNodeListType: |
153 case RadioImgNodeListType: | 153 case RadioImgNodeListType: |
154 case LabelsNodeListType: | 154 case LabelsNodeListType: |
155 break; | 155 break; |
156 } | 156 } |
157 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
158 return DoNotInvalidateOnAttributeChanges; | 158 return DoNotInvalidateOnAttributeChanges; |
159 } | 159 } |
160 | 160 |
161 HTMLCollection::HTMLCollection(ContainerNode* ownerNode, CollectionType type, It
emAfterOverrideType itemAfterOverrideType) | 161 HTMLCollection::HTMLCollection(ContainerNode& ownerNode, CollectionType type, It
emAfterOverrideType itemAfterOverrideType) |
162 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation
TypeExcludingIdAndNameAttributes(type), type) | 162 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation
TypeExcludingIdAndNameAttributes(type), type) |
163 , m_overridesItemAfter(itemAfterOverrideType == OverridesItemAfter) | 163 , m_overridesItemAfter(itemAfterOverrideType == OverridesItemAfter) |
164 , m_shouldOnlyIncludeDirectChildren(shouldTypeOnlyIncludeDirectChildren(type
)) | 164 , m_shouldOnlyIncludeDirectChildren(shouldTypeOnlyIncludeDirectChildren(type
)) |
165 , m_hasValidIdNameCache(false) | 165 , m_hasValidIdNameCache(false) |
166 { | 166 { |
167 ScriptWrappable::init(this); | 167 ScriptWrappable::init(this); |
168 } | 168 } |
169 | 169 |
170 PassRefPtr<HTMLCollection> HTMLCollection::create(ContainerNode* base, Collectio
nType type) | 170 PassRefPtr<HTMLCollection> HTMLCollection::create(ContainerNode& base, Collectio
nType type) |
171 { | 171 { |
172 return adoptRef(new HTMLCollection(base, type, DoesNotOverrideItemAfter)); | 172 return adoptRef(new HTMLCollection(base, type, DoesNotOverrideItemAfter)); |
173 } | 173 } |
174 | 174 |
175 HTMLCollection::~HTMLCollection() | 175 HTMLCollection::~HTMLCollection() |
176 { | 176 { |
177 if (hasValidIdNameCache()) | 177 if (hasValidIdNameCache()) |
178 unregisterIdNameCacheFromDocument(document()); | 178 unregisterIdNameCacheFromDocument(document()); |
179 // HTMLNameCollection, ClassCollection and TagCollection remove cache by the
mselves. | 179 // HTMLNameCollection, ClassCollection and TagCollection remove cache by the
mselves. |
180 if (type() != WindowNamedItems && type() != DocumentNamedItems && type() !=
ClassCollectionType | 180 if (type() != WindowNamedItems && type() != DocumentNamedItems && type() !=
ClassCollectionType |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) | 479 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) |
480 { | 480 { |
481 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).storedValue
->value; | 481 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).storedValue
->value; |
482 if (!vector) | 482 if (!vector) |
483 vector = adoptPtr(new Vector<Element*>); | 483 vector = adoptPtr(new Vector<Element*>); |
484 vector->append(element); | 484 vector->append(element); |
485 } | 485 } |
486 | 486 |
487 } // namespace WebCore | 487 } // namespace WebCore |
OLD | NEW |