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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 cache->addElementWithId(idAttrVal, element); | 185 cache->addElementWithId(idAttrVal, element); |
186 if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && !foundInpu
tElements.contains(nameAttrVal.impl())) | 186 if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && !foundInpu
tElements.contains(nameAttrVal.impl())) |
187 cache->addElementWithName(nameAttrVal, element); | 187 cache->addElementWithName(nameAttrVal, element); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 // Set the named item cache last as traversing the tree may cause cache inva
lidation. | 191 // Set the named item cache last as traversing the tree may cause cache inva
lidation. |
192 setNamedItemCache(cache.release()); | 192 setNamedItemCache(cache.release()); |
193 } | 193 } |
194 | 194 |
195 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad
ioNodeListEnabled, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, bool& eleme
ntEnabled, RefPtr<Element>& element) | 195 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad
ioNodeListEnabled, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, bool& eleme
ntEnabled, RefPtrWillBeRawPtr<Element>& element) |
196 { | 196 { |
197 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; | 197 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; |
198 this->namedItems(name, namedItems); | 198 this->namedItems(name, namedItems); |
199 | 199 |
200 if (namedItems.isEmpty()) | 200 if (namedItems.isEmpty()) |
201 return; | 201 return; |
202 | 202 |
203 if (namedItems.size() == 1) { | 203 if (namedItems.size() == 1) { |
204 elementEnabled = true; | 204 elementEnabled = true; |
205 // FIXME: Oilpan: remove the call to |get| when Element becomes [Garbage
Collected]. | 205 element = namedItems.at(0); |
206 element = namedItems.at(0).get(); | |
207 return; | 206 return; |
208 } | 207 } |
209 | 208 |
210 radioNodeListEnabled = true; | 209 radioNodeListEnabled = true; |
211 radioNodeList = ownerNode().radioNodeList(name); | 210 radioNodeList = ownerNode().radioNodeList(name); |
212 } | 211 } |
213 | 212 |
214 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) | 213 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) |
215 { | 214 { |
216 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlformcontrolscollection-0: | 215 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlformcontrolscollection-0: |
(...skipping 15 matching lines...) Expand all Loading... |
232 const AtomicString& nameAttribute = element->getNameAttribute(); | 231 const AtomicString& nameAttribute = element->getNameAttribute(); |
233 if (!nameAttribute.isEmpty()) { | 232 if (!nameAttribute.isEmpty()) { |
234 HashSet<AtomicString>::AddResult addResult = existingNames.add(nameA
ttribute); | 233 HashSet<AtomicString>::AddResult addResult = existingNames.add(nameA
ttribute); |
235 if (addResult.isNewEntry) | 234 if (addResult.isNewEntry) |
236 names.append(nameAttribute); | 235 names.append(nameAttribute); |
237 } | 236 } |
238 } | 237 } |
239 } | 238 } |
240 | 239 |
241 } | 240 } |
OLD | NEW |