summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-22 13:02:20 +0100
committerBen Murdoch <benm@google.com>2010-10-26 15:21:41 +0100
commita94275402997c11dd2e778633dacf4b7e630a35d (patch)
treee66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
parent09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff)
downloadexternal_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
index 8a39332..caf2e16 100644
--- a/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
@@ -34,11 +34,28 @@
#include "DOMFormData.h"
#include "V8Binding.h"
#include "V8Blob.h"
+#include "V8HTMLFormElement.h"
#include "V8Proxy.h"
#include "V8Utilities.h"
namespace WebCore {
+v8::Handle<v8::Value> V8DOMFormData::constructorCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.FormData.Constructor");
+
+ if (!args.IsConstructCall())
+ return throwError("DOM object constructor cannot be called as a function.", V8Proxy::SyntaxError);
+
+ HTMLFormElement* form = 0;
+ if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0]))
+ form = V8HTMLFormElement::toNative(args[0]->ToObject());
+ RefPtr<DOMFormData> domFormData = DOMFormData::create(form);
+
+ V8DOMWrapper::setDOMWrapper(args.Holder(), &info, domFormData.get());
+ return toV8(domFormData.release(), args.Holder());
+}
+
v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args)
{
INC_STATS("DOM.FormData.append()");