[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
jianli at chromium.org
jianli at chromium.org
Wed Mar 17 18:37:01 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 21ae79158365c902cd72365f9d8bf6b575e96aa1
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Mar 12 19:17:21 2010 +0000
[v8] Add V8 bindings for DOMFormData.
https://bugs.webkit.org/show_bug.cgi?id=36026
Reviewed by Nate Chapin.
Test: http/tests/local/send-form-data.html
* WebCore.gypi:
* bindings/v8/V8Index.h:
* bindings/v8/custom/V8DOMFormDataCustom.cpp: Added.
(WebCore::V8DOMFormData::appendCallback):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::sendCallback):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 137448b..b9a8feb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,21 @@
2010-03-12 Jian Li <jianli at chromium.org>
+ Reviewed by Nate Chapin.
+
+ [v8] Add V8 bindings for DOMFormData.
+ https://bugs.webkit.org/show_bug.cgi?id=36026
+
+ Test: http/tests/local/send-form-data.html
+
+ * WebCore.gypi:
+ * bindings/v8/V8Index.h:
+ * bindings/v8/custom/V8DOMFormDataCustom.cpp: Added.
+ (WebCore::V8DOMFormData::appendCallback):
+ * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+ (WebCore::V8XMLHttpRequest::sendCallback):
+
+2010-03-12 Jian Li <jianli at chromium.org>
+
Reviewed by Sam Weinig.
Add DOMFormData.idl to expose FormData interface.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 2c8e3ea..dd67e85 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -106,6 +106,7 @@
'html/canvas/WebGLTexture.idl',
'html/DataGridColumn.idl',
'html/DataGridColumnList.idl',
+ 'html/DOMFormData.idl',
'html/File.idl',
'html/FileList.idl',
'html/HTMLAllCollection.idl',
@@ -719,6 +720,7 @@
'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
+ 'bindings/v8/custom/V8DOMFormDataCustom.cpp',
'bindings/v8/custom/V8DOMSelectionCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index 969a495..ff9f2d8 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -363,6 +363,7 @@ static const int v8DefaultWrapperInternalFieldCount = 2;
V(CSSVARIABLESDECLARATION, CSSVariablesDeclaration) \
V(CSSVARIABLESRULE, CSSVariablesRule) \
V(DOMCOREEXCEPTION, DOMCoreException) \
+ V(DOMFORMDATA, DOMFormData) \
V(DOMIMPLEMENTATION, DOMImplementation) \
V(DOMPARSER, DOMParser) \
V(DOMSELECTION, DOMSelection) \
diff --git a/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
new file mode 100644
index 0000000..8a39332
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8DOMFormData.h"
+
+#include "DOMFormData.h"
+#include "V8Binding.h"
+#include "V8Blob.h"
+#include "V8Proxy.h"
+#include "V8Utilities.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.FormData.append()");
+
+ if (args.Length() < 2)
+ return throwError("Not enough arguments", V8Proxy::SyntaxError);
+
+ DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder());
+
+ String name = toWebCoreStringWithNullCheck(args[0]);
+
+ v8::Handle<v8::Value> arg = args[1];
+ if (V8Blob::HasInstance(arg)) {
+ v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+ Blob* blob = V8Blob::toNative(object);
+ ASSERT(blob);
+ domFormData->append(name, blob);
+ } else
+ domFormData->append(name, toWebCoreStringWithNullCheck(arg));
+
+ return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index dce2d21..dff37f7 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -34,6 +34,7 @@
#include "Frame.h"
#include "V8Binding.h"
#include "V8Blob.h"
+#include "V8DOMFormData.h"
#include "V8Document.h"
#include "V8HTMLDocument.h"
#include "V8Proxy.h"
@@ -123,6 +124,11 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
Blob* blob = V8Blob::toNative(object);
ASSERT(blob);
xmlHttpRequest->send(blob, ec);
+ } else if (V8DOMFormData::HasInstance(arg)) {
+ v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+ DOMFormData* domFormData = V8DOMFormData::toNative(object);
+ ASSERT(domFormData);
+ xmlHttpRequest->send(domFormData, ec);
} else
xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list