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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void HTMLOptionsCollection::setSelectedIndex(int index) | 116 void HTMLOptionsCollection::setSelectedIndex(int index) |
117 { | 117 { |
118 toHTMLSelectElement(ownerNode()).setSelectedIndex(index); | 118 toHTMLSelectElement(ownerNode()).setSelectedIndex(index); |
119 } | 119 } |
120 | 120 |
121 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception
State) | 121 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception
State) |
122 { | 122 { |
123 toHTMLSelectElement(ownerNode()).setLength(length, exceptionState); | 123 toHTMLSelectElement(ownerNode()).setLength(length, exceptionState); |
124 } | 124 } |
125 | 125 |
126 void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa
lue0Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabl
ed, RefPtr<Element>& returnValue1) | 126 void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa
lue0Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabl
ed, RefPtrWillBeRawPtr<Element>& returnValue1) |
127 { | 127 { |
128 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; | 128 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; |
129 this->namedItems(name, namedItems); | 129 this->namedItems(name, namedItems); |
130 | 130 |
131 if (!namedItems.size()) | 131 if (!namedItems.size()) |
132 return; | 132 return; |
133 | 133 |
134 if (namedItems.size() == 1) { | 134 if (namedItems.size() == 1) { |
135 returnValue1Enabled = true; | 135 returnValue1Enabled = true; |
136 // FIXME: Oilpan: remove the call to |get| when Element becomes [Garbage
Collected]. | 136 returnValue1 = namedItems.at(0); |
137 returnValue1 = namedItems.at(0).get(); | |
138 return; | 137 return; |
139 } | 138 } |
140 | 139 |
141 // FIXME: The spec and Firefox do not return a NodeList. They always return
the first matching Element. | 140 // FIXME: The spec and Firefox do not return a NodeList. They always return
the first matching Element. |
142 returnValue0Enabled = true; | 141 returnValue0Enabled = true; |
143 returnValue0 = NamedNodesCollection::create(namedItems); | 142 returnValue0 = NamedNodesCollection::create(namedItems); |
144 } | 143 } |
145 | 144 |
146 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWil
lBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState) | 145 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWil
lBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState) |
147 { | 146 { |
148 HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); | 147 HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); |
149 if (!value) { // undefined or null | 148 if (!value) { // undefined or null |
150 base.remove(index); | 149 base.remove(index); |
151 return true; | 150 return true; |
152 } | 151 } |
153 base.setOption(index, value.get(), exceptionState); | 152 base.setOption(index, value.get(), exceptionState); |
154 return true; | 153 return true; |
155 } | 154 } |
156 | 155 |
157 } //namespace | 156 } //namespace |
158 | 157 |
OLD | NEW |