summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
index 02c3499..c060df7 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
@@ -29,8 +29,9 @@
*/
#include "config.h"
-#include "HTMLOptionsCollection.h"
+#include "V8HTMLOptionsCollection.h"
+#include "HTMLOptionsCollection.h"
#include "HTMLOptionElement.h"
#include "ExceptionCode.h"
@@ -43,23 +44,23 @@
namespace WebCore {
-CALLBACK_FUNC_DECL(HTMLOptionsCollectionRemove)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::removeCallback(const v8::Arguments& args)
{
INC_STATS("DOM.HTMLOptionsCollection.remove()");
- HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, args.Holder());
+ HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
HTMLSelectElement* base = static_cast<HTMLSelectElement*>(imp->base());
return removeElement(base, args);
}
-CALLBACK_FUNC_DECL(HTMLOptionsCollectionAdd)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments& args)
{
INC_STATS("DOM.HTMLOptionsCollection.add()");
if (!V8HTMLOptionElement::HasInstance(args[0])) {
V8Proxy::setDOMException(TYPE_MISMATCH_ERR);
return v8::Undefined();
}
- HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, args.Holder());
- HTMLOptionElement* option = V8DOMWrapper::convertDOMWrapperToNode<HTMLOptionElement>(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));
+ HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
+ HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(args[0])));
ExceptionCode ec = 0;
if (args.Length() < 2)
@@ -84,18 +85,18 @@ CALLBACK_FUNC_DECL(HTMLOptionsCollectionAdd)
return v8::Undefined();
}
-ACCESSOR_GETTER(HTMLOptionsCollectionLength)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::lengthAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.length._get");
- HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
+ HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
int v = imp->length();
return v8::Integer::New(v);
}
-ACCESSOR_SETTER(HTMLOptionsCollectionLength)
+void V8HTMLOptionsCollection::lengthAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.length._set");
- HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
+ HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
double v = value->NumberValue();
unsigned newLength = 0;
ExceptionCode ec = 0;
@@ -113,10 +114,10 @@ ACCESSOR_SETTER(HTMLOptionsCollectionLength)
V8Proxy::setDOMException(ec);
}
-INDEXED_PROPERTY_GETTER(HTMLOptionsCollection)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.IndexedPropertyGetter");
- HTMLOptionsCollection* collection = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
+ HTMLOptionsCollection* collection = V8HTMLOptionsCollection::toNative(info.Holder());
RefPtr<Node> result = collection->item(index);
if (!result)
@@ -125,10 +126,10 @@ INDEXED_PROPERTY_GETTER(HTMLOptionsCollection)
return V8DOMWrapper::convertNodeToV8Object(result.release());
}
-INDEXED_PROPERTY_SETTER(HTMLOptionsCollection)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.IndexedPropertySetter");
- HTMLOptionsCollection* collection = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
+ HTMLOptionsCollection* collection = V8HTMLOptionsCollection::toNative(info.Holder());
HTMLSelectElement* base = static_cast<HTMLSelectElement*>(collection->base());
return toOptionsCollectionSetter(index, value, base);
}