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 10 matching lines...) Expand all Loading... |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #include "config.h" | 24 #include "config.h" |
25 #include "core/html/HTMLCollection.h" | 25 #include "core/html/HTMLCollection.h" |
26 | 26 |
27 #include "HTMLNames.h" | 27 #include "HTMLNames.h" |
28 #include "core/dom/ClassCollection.h" | 28 #include "core/dom/ClassCollection.h" |
29 #include "core/dom/ElementTraversal.h" | 29 #include "core/dom/ElementTraversal.h" |
30 #include "core/dom/NodeRareData.h" | 30 #include "core/dom/NodeRareData.h" |
| 31 #include "core/html/DocumentNameCollection.h" |
31 #include "core/html/HTMLElement.h" | 32 #include "core/html/HTMLElement.h" |
32 #include "core/html/HTMLObjectElement.h" | 33 #include "core/html/HTMLObjectElement.h" |
33 #include "core/html/HTMLOptionElement.h" | 34 #include "core/html/HTMLOptionElement.h" |
| 35 #include "core/html/WindowNameCollection.h" |
34 #include "wtf/HashSet.h" | 36 #include "wtf/HashSet.h" |
35 | 37 |
36 namespace WebCore { | 38 namespace WebCore { |
37 | 39 |
38 using namespace HTMLNames; | 40 using namespace HTMLNames; |
39 | 41 |
40 static bool shouldTypeOnlyIncludeDirectChildren(CollectionType type) | 42 static bool shouldTypeOnlyIncludeDirectChildren(CollectionType type) |
41 { | 43 { |
42 switch (type) { | 44 switch (type) { |
43 case ClassCollectionType: | 45 case ClassCollectionType: |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 switch (type) { | 201 switch (type) { |
200 case DocAll: | 202 case DocAll: |
201 case NodeChildren: | 203 case NodeChildren: |
202 return true; | 204 return true; |
203 case ClassCollectionType: | 205 case ClassCollectionType: |
204 return toClassCollection(htmlCollection).elementMatches(element); | 206 return toClassCollection(htmlCollection).elementMatches(element); |
205 case TagCollectionType: | 207 case TagCollectionType: |
206 return toTagCollection(htmlCollection).elementMatches(element); | 208 return toTagCollection(htmlCollection).elementMatches(element); |
207 case HTMLTagCollectionType: | 209 case HTMLTagCollectionType: |
208 return toHTMLTagCollection(htmlCollection).elementMatches(element); | 210 return toHTMLTagCollection(htmlCollection).elementMatches(element); |
| 211 case DocumentNamedItems: |
| 212 return toDocumentNameCollection(htmlCollection).elementMatches(element); |
| 213 case WindowNamedItems: |
| 214 return toWindowNameCollection(htmlCollection).elementMatches(element); |
209 default: | 215 default: |
210 break; | 216 break; |
211 } | 217 } |
212 | 218 |
213 // The following only applies to HTMLElements. | 219 // The following only applies to HTMLElements. |
214 if (!element.isHTMLElement()) | 220 if (!element.isHTMLElement()) |
215 return false; | 221 return false; |
216 | 222 |
217 switch (type) { | 223 switch (type) { |
218 case DocImages: | 224 case DocImages: |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 522 } |
517 | 523 |
518 void HTMLCollection::trace(Visitor* visitor) | 524 void HTMLCollection::trace(Visitor* visitor) |
519 { | 525 { |
520 visitor->trace(m_namedItemCache); | 526 visitor->trace(m_namedItemCache); |
521 visitor->trace(m_collectionIndexCache); | 527 visitor->trace(m_collectionIndexCache); |
522 LiveNodeListBase::trace(visitor); | 528 LiveNodeListBase::trace(visitor); |
523 } | 529 } |
524 | 530 |
525 } // namespace WebCore | 531 } // namespace WebCore |
OLD | NEW |