OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 #include "V8HTMLOptionElement.h" | 38 #include "V8HTMLOptionElement.h" |
39 #include "V8HTMLSelectElement.h" | 39 #include "V8HTMLSelectElement.h" |
40 #include "V8Node.h" | 40 #include "V8Node.h" |
41 #include "V8NodeList.h" | 41 #include "V8NodeList.h" |
42 #include "bindings/v8/V8Binding.h" | 42 #include "bindings/v8/V8Binding.h" |
43 #include "bindings/v8/V8Collection.h" | 43 #include "bindings/v8/V8Collection.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 v8::Handle<v8::Value> V8HTMLSelectElement::indexedPropertySetter(uint32_t index,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
48 { | |
49 HTMLSelectElement* select = V8HTMLSelectElement::toNative(info.Holder()); | |
50 return toOptionsCollectionSetter(index, value, select, info.GetIsolate()); | |
51 } | |
52 | |
53 v8::Handle<v8::Value> V8HTMLSelectElement::removeMethodCustom(const v8::Argument
s& args) | 47 v8::Handle<v8::Value> V8HTMLSelectElement::removeMethodCustom(const v8::Argument
s& args) |
54 { | 48 { |
55 HTMLSelectElement* imp = V8HTMLSelectElement::toNative(args.Holder()); | 49 HTMLSelectElement* imp = V8HTMLSelectElement::toNative(args.Holder()); |
56 return removeElement(imp, args); | 50 return removeElement(imp, args); |
57 } | 51 } |
58 | 52 |
59 v8::Handle<v8::Value> removeElement(HTMLSelectElement* imp, const v8::Arguments&
args) | 53 v8::Handle<v8::Value> removeElement(HTMLSelectElement* imp, const v8::Arguments&
args) |
60 { | 54 { |
61 if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(a
rgs.GetIsolate()))) { | 55 if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(a
rgs.GetIsolate()))) { |
62 HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8
::Object>::Cast(args[0])); | 56 HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8
::Object>::Cast(args[0])); |
63 imp->remove(element->index()); | 57 imp->remove(element->index()); |
64 return v8::Undefined(); | 58 return v8::Undefined(); |
65 } | 59 } |
66 | 60 |
67 imp->remove(toInt32(args[0])); | 61 imp->remove(toInt32(args[0])); |
68 return v8::Undefined(); | 62 return v8::Undefined(); |
69 } | 63 } |
70 | 64 |
71 } // namespace WebCore | 65 } // namespace WebCore |
OLD | NEW |