OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. |
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 HashSet<AtomicString> existingNames; | 48 HashSet<AtomicString> existingNames; |
49 unsigned length = this->length(); | 49 unsigned length = this->length(); |
50 for (unsigned i = 0; i < length; ++i) { | 50 for (unsigned i = 0; i < length; ++i) { |
51 Element* element = item(i); | 51 Element* element = item(i); |
52 DCHECK(element); | 52 DCHECK(element); |
53 const AtomicString& idAttribute = element->getIdAttribute(); | 53 const AtomicString& idAttribute = element->getIdAttribute(); |
54 if (!idAttribute.isEmpty()) { | 54 if (!idAttribute.isEmpty()) { |
55 HashSet<AtomicString>::AddResult addResult = | 55 HashSet<AtomicString>::AddResult addResult = |
56 existingNames.add(idAttribute); | 56 existingNames.add(idAttribute); |
57 if (addResult.isNewEntry) | 57 if (addResult.isNewEntry) |
58 names.append(idAttribute); | 58 names.push_back(idAttribute); |
59 } | 59 } |
60 const AtomicString& nameAttribute = element->getNameAttribute(); | 60 const AtomicString& nameAttribute = element->getNameAttribute(); |
61 if (!nameAttribute.isEmpty()) { | 61 if (!nameAttribute.isEmpty()) { |
62 HashSet<AtomicString>::AddResult addResult = | 62 HashSet<AtomicString>::AddResult addResult = |
63 existingNames.add(nameAttribute); | 63 existingNames.add(nameAttribute); |
64 if (addResult.isNewEntry) | 64 if (addResult.isNewEntry) |
65 names.append(nameAttribute); | 65 names.push_back(nameAttribute); |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 HTMLOptionsCollection* HTMLOptionsCollection::create(ContainerNode& select, | 70 HTMLOptionsCollection* HTMLOptionsCollection::create(ContainerNode& select, |
71 CollectionType) { | 71 CollectionType) { |
72 return new HTMLOptionsCollection(select); | 72 return new HTMLOptionsCollection(select); |
73 } | 73 } |
74 | 74 |
75 void HTMLOptionsCollection::add( | 75 void HTMLOptionsCollection::add( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); | 121 HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); |
122 if (!value) { // undefined or null | 122 if (!value) { // undefined or null |
123 base.remove(index); | 123 base.remove(index); |
124 return true; | 124 return true; |
125 } | 125 } |
126 base.setOption(index, value, exceptionState); | 126 base.setOption(index, value, exceptionState); |
127 return true; | 127 return true; |
128 } | 128 } |
129 | 129 |
130 } // namespace blink | 130 } // namespace blink |
OLD | NEW |