| 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, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RadioNode
ListOrElement& returnValue) | 196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RadioNode
ListOrElement& returnValue) |
| 197 { | 197 { |
| 198 WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems; | 198 WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems; |
| 199 this->namedItems(name, namedItems); | 199 this->namedItems(name, namedItems); |
| 200 | 200 |
| 201 if (namedItems.isEmpty()) | 201 if (namedItems.isEmpty()) |
| 202 return; | 202 return; |
| 203 | 203 |
| 204 if (namedItems.size() == 1) { | 204 if (namedItems.size() == 1) { |
| 205 if (isHTMLImageElement(*namedItems[0])) |
| 206 UseCounter::count(document(), UseCounter::FormControlsCollectionName
AccessForImageElement); |
| 205 returnValue.setElement(namedItems.at(0)); | 207 returnValue.setElement(namedItems.at(0)); |
| 206 return; | 208 return; |
| 207 } | 209 } |
| 208 | 210 |
| 211 // This path never returns a RadioNodeList for <img> because |
| 212 // onlyMatchingImgElements flag is false by default. |
| 209 returnValue.setRadioNodeList(ownerNode().radioNodeList(name)); | 213 returnValue.setRadioNodeList(ownerNode().radioNodeList(name)); |
| 210 } | 214 } |
| 211 | 215 |
| 212 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) | 216 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) |
| 213 { | 217 { |
| 214 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlformcontrolscollection-0: | 218 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlformcontrolscollection-0: |
| 215 // The supported property names consist of the non-empty values of all the i
d and name attributes | 219 // The supported property names consist of the non-empty values of all the i
d and name attributes |
| 216 // of all the elements represented by the collection, in tree order, ignorin
g later duplicates, | 220 // of all the elements represented by the collection, in tree order, ignorin
g later duplicates, |
| 217 // with the id of an element preceding its name if it contributes both, they
differ from each | 221 // with the id of an element preceding its name if it contributes both, they
differ from each |
| 218 // other, and neither is the duplicate of an earlier entry. | 222 // other, and neither is the duplicate of an earlier entry. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 236 } | 240 } |
| 237 } | 241 } |
| 238 | 242 |
| 239 DEFINE_TRACE(HTMLFormControlsCollection) | 243 DEFINE_TRACE(HTMLFormControlsCollection) |
| 240 { | 244 { |
| 241 visitor->trace(m_cachedElement); | 245 visitor->trace(m_cachedElement); |
| 242 HTMLCollection::trace(visitor); | 246 HTMLCollection::trace(visitor); |
| 243 } | 247 } |
| 244 | 248 |
| 245 } | 249 } |
| OLD | NEW |