Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: Source/core/html/HTMLCollection.cpp

Issue 136783008: Move m_shouldOnlyIncludeDirectChildren member from LiveNodeListBase to HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLCollection.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698