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-2008, 2011, 2012, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003-2008, 2011, 2012, 2014 Apple Inc. All rights 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 11 matching lines...) Expand all Loading... |
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 "core/HTMLNames.h" | 27 #include "core/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/DocumentNameCollection.h" |
| 32 #include "core/html/HTMLDataListOptionsCollection.h" |
32 #include "core/html/HTMLElement.h" | 33 #include "core/html/HTMLElement.h" |
33 #include "core/html/HTMLObjectElement.h" | 34 #include "core/html/HTMLObjectElement.h" |
34 #include "core/html/HTMLOptionElement.h" | 35 #include "core/html/HTMLOptionElement.h" |
35 #include "core/html/HTMLTagCollection.h" | 36 #include "core/html/HTMLTagCollection.h" |
36 #include "core/html/WindowNameCollection.h" | 37 #include "core/html/WindowNameCollection.h" |
37 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 using namespace HTMLNames; | 42 using namespace HTMLNames; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return element.hasTagName(tbodyTag); | 215 return element.hasTagName(tbodyTag); |
215 case TRCells: | 216 case TRCells: |
216 return element.hasTagName(tdTag) || element.hasTagName(thTag); | 217 return element.hasTagName(tdTag) || element.hasTagName(thTag); |
217 case TSectionRows: | 218 case TSectionRows: |
218 return element.hasTagName(trTag); | 219 return element.hasTagName(trTag); |
219 case SelectOptions: | 220 case SelectOptions: |
220 return element.hasTagName(optionTag); | 221 return element.hasTagName(optionTag); |
221 case SelectedOptions: | 222 case SelectedOptions: |
222 return isHTMLOptionElement(element) && toHTMLOptionElement(element).sele
cted(); | 223 return isHTMLOptionElement(element) && toHTMLOptionElement(element).sele
cted(); |
223 case DataListOptions: | 224 case DataListOptions: |
224 if (isHTMLOptionElement(element)) { | 225 return toHTMLDataListOptionsCollection(htmlCollection).elementMatches(el
ement); |
225 const HTMLOptionElement& option = toHTMLOptionElement(element); | |
226 if (!option.isDisabledFormControl() && !option.value().isEmpty()) | |
227 return true; | |
228 } | |
229 return false; | |
230 case MapAreas: | 226 case MapAreas: |
231 return element.hasTagName(areaTag); | 227 return element.hasTagName(areaTag); |
232 case DocApplets: | 228 case DocApplets: |
233 return element.hasTagName(appletTag) || (isHTMLObjectElement(element) &&
toHTMLObjectElement(element).containsJavaApplet()); | 229 return element.hasTagName(appletTag) || (isHTMLObjectElement(element) &&
toHTMLObjectElement(element).containsJavaApplet()); |
234 case DocEmbeds: | 230 case DocEmbeds: |
235 return element.hasTagName(embedTag); | 231 return element.hasTagName(embedTag); |
236 case DocLinks: | 232 case DocLinks: |
237 return (element.hasTagName(aTag) || element.hasTagName(areaTag)) && elem
ent.fastHasAttribute(hrefAttr); | 233 return (element.hasTagName(aTag) || element.hasTagName(areaTag)) && elem
ent.fastHasAttribute(hrefAttr); |
238 case DocAnchors: | 234 case DocAnchors: |
239 return element.hasTagName(aTag) && element.fastHasAttribute(nameAttr); | 235 return element.hasTagName(aTag) && element.fastHasAttribute(nameAttr); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 } | 499 } |
504 | 500 |
505 void HTMLCollection::trace(Visitor* visitor) | 501 void HTMLCollection::trace(Visitor* visitor) |
506 { | 502 { |
507 visitor->trace(m_namedItemCache); | 503 visitor->trace(m_namedItemCache); |
508 visitor->trace(m_collectionIndexCache); | 504 visitor->trace(m_collectionIndexCache); |
509 LiveNodeListBase::trace(visitor); | 505 LiveNodeListBase::trace(visitor); |
510 } | 506 } |
511 | 507 |
512 } // namespace blink | 508 } // namespace blink |
OLD | NEW |