OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #include "bindings/v8/ExceptionMessages.h" | 24 #include "bindings/v8/ExceptionMessages.h" |
25 #include "bindings/v8/ExceptionState.h" | 25 #include "bindings/v8/ExceptionState.h" |
26 #include "core/dom/ExceptionCode.h" | 26 #include "core/dom/ExceptionCode.h" |
27 #include "core/dom/NamedNodesCollection.h" | 27 #include "core/dom/NamedNodesCollection.h" |
28 #include "core/html/HTMLOptionElement.h" | 28 #include "core/html/HTMLOptionElement.h" |
29 #include "core/html/HTMLSelectElement.h" | 29 #include "core/html/HTMLSelectElement.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 HTMLOptionsCollection::HTMLOptionsCollection(Node* select) | 33 HTMLOptionsCollection::HTMLOptionsCollection(ContainerNode* select) |
34 : HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter) | 34 : HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter) |
35 { | 35 { |
36 ASSERT(select->hasTagName(HTMLNames::selectTag)); | 36 ASSERT(select->hasTagName(HTMLNames::selectTag)); |
37 ScriptWrappable::init(this); | 37 ScriptWrappable::init(this); |
38 } | 38 } |
39 | 39 |
40 PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(Node* select, Co
llectionType) | 40 PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(ContainerNode* s
elect, CollectionType) |
41 { | 41 { |
42 return adoptRef(new HTMLOptionsCollection(select)); | 42 return adoptRef(new HTMLOptionsCollection(select)); |
43 } | 43 } |
44 | 44 |
45 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception
State& exceptionState) | 45 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, Exception
State& exceptionState) |
46 { | 46 { |
47 add(element, length(), exceptionState); | 47 add(element, length(), exceptionState); |
48 } | 48 } |
49 | 49 |
50 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
, ExceptionState& exceptionState) | 50 void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
, ExceptionState& exceptionState) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (!value) { | 127 if (!value) { |
128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num
ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption
Element.")); | 128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num
ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption
Element.")); |
129 return true; | 129 return true; |
130 } | 130 } |
131 base->setOption(index, value.get(), exceptionState); | 131 base->setOption(index, value.get(), exceptionState); |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 } //namespace | 135 } //namespace |
136 | 136 |
OLD | NEW |