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 19 matching lines...) Expand all Loading... |
30 #include "core/dom/NodeRareData.h" | 30 #include "core/dom/NodeRareData.h" |
31 #include "core/dom/NodeTraversal.h" | 31 #include "core/dom/NodeTraversal.h" |
32 #include "core/html/HTMLElement.h" | 32 #include "core/html/HTMLElement.h" |
33 #include "core/html/HTMLObjectElement.h" | 33 #include "core/html/HTMLObjectElement.h" |
34 #include "core/html/HTMLOptionElement.h" | 34 #include "core/html/HTMLOptionElement.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 using namespace HTMLNames; | 38 using namespace HTMLNames; |
39 | 39 |
40 static bool shouldOnlyIncludeDirectChildren(CollectionType type) | 40 static bool shouldTypeOnlyIncludeDirectChildren(CollectionType type) |
41 { | 41 { |
42 switch (type) { | 42 switch (type) { |
43 case ClassCollectionType: | 43 case ClassCollectionType: |
44 case TagCollectionType: | 44 case TagCollectionType: |
45 case HTMLTagCollectionType: | 45 case HTMLTagCollectionType: |
46 case DocAll: | 46 case DocAll: |
47 case DocAnchors: | 47 case DocAnchors: |
48 case DocApplets: | 48 case DocApplets: |
49 case DocEmbeds: | 49 case DocEmbeds: |
50 case DocForms: | 50 case DocForms: |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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), | 162 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation
TypeExcludingIdAndNameAttributes(type), type) |
163 WebCore::shouldOnlyIncludeDirectChildren(type), type) | |
164 , m_overridesItemAfter(itemAfterOverrideType == OverridesItemAfter) | 163 , m_overridesItemAfter(itemAfterOverrideType == OverridesItemAfter) |
| 164 , m_shouldOnlyIncludeDirectChildren(shouldTypeOnlyIncludeDirectChildren(type
)) |
165 , m_isNameCacheValid(false) | 165 , m_isNameCacheValid(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 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 527 |
528 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) | 528 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) |
529 { | 529 { |
530 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->v
alue; | 530 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->v
alue; |
531 if (!vector) | 531 if (!vector) |
532 vector = adoptPtr(new Vector<Element*>); | 532 vector = adoptPtr(new Vector<Element*>); |
533 vector->append(element); | 533 vector->append(element); |
534 } | 534 } |
535 | 535 |
536 } // namespace WebCore | 536 } // namespace WebCore |
OLD | NEW |