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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 case TagNodeListType: | 153 case TagNodeListType: |
154 case HTMLTagNodeListType: | 154 case HTMLTagNodeListType: |
155 case RadioNodeListType: | 155 case RadioNodeListType: |
156 case LabelsNodeListType: | 156 case LabelsNodeListType: |
157 break; | 157 break; |
158 } | 158 } |
159 ASSERT_NOT_REACHED(); | 159 ASSERT_NOT_REACHED(); |
160 return DoNotInvalidateOnAttributeChanges; | 160 return DoNotInvalidateOnAttributeChanges; |
161 } | 161 } |
162 | 162 |
163 HTMLCollection::HTMLCollection(Node* ownerNode, CollectionType type, ItemAfterOv
errideType itemAfterOverrideType) | 163 HTMLCollection::HTMLCollection(const Handle<Node>& ownerNode, CollectionType typ
e, ItemAfterOverrideType itemAfterOverrideType) |
164 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation
TypeExcludingIdAndNameAttributes(type), | 164 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation
TypeExcludingIdAndNameAttributes(type), |
165 WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideT
ype) | 165 WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideT
ype) |
166 { | 166 { |
167 ScriptWrappable::init(this); | 167 ScriptWrappable::init(this); |
168 } | 168 } |
169 | 169 |
170 PassRefPtr<HTMLCollection> HTMLCollection::create(Node* base, CollectionType typ
e) | 170 PassRefPtr<HTMLCollection> HTMLCollection::create(const Handle<Node>& base, Coll
ectionType 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 // HTMLNameCollection removes cache by itself. | 177 // HTMLNameCollection removes cache by itself. |
178 if (type() != WindowNamedItems && type() != DocumentNamedItems) | 178 if (type() != WindowNamedItems && type() != DocumentNamedItems) |
179 ownerNode()->nodeLists()->removeCacheWithAtomicName(this, type()); | 179 ownerNode()->nodeLists()->removeCacheWithAtomicName(this, type()); |
180 } | 180 } |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 | 740 |
741 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, const Ha
ndle<Element>& element) | 741 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, const Ha
ndle<Element>& element) |
742 { | 742 { |
743 OwnPtr<CollectionRoot<Vector<Member<Element> > > >& elementVector = map.add(
key.impl(), nullptr).iterator->value; | 743 OwnPtr<CollectionRoot<Vector<Member<Element> > > >& elementVector = map.add(
key.impl(), nullptr).iterator->value; |
744 if (!elementVector) | 744 if (!elementVector) |
745 elementVector = adoptPtr(new CollectionRoot<Vector<Member<Element> > >)
; | 745 elementVector = adoptPtr(new CollectionRoot<Vector<Member<Element> > >)
; |
746 (*elementVector)->append(element); | 746 (*elementVector)->append(element); |
747 } | 747 } |
748 | 748 |
749 } // namespace WebCore | 749 } // namespace WebCore |
OLD | NEW |