aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
authorTom Schuster <evilpies@gmail.com>2013-11-17 17:16:21 +0100
committerTom Schuster <evilpies@gmail.com>2013-11-24 22:37:28 +0100
commit73e67568c1a016928644570a3b364e454ac4da6f (patch)
tree77cadd8d592bd32513949842d54e7939453615e9 /src/components/script/dom/bindings/codegen
parent94df5d1cbad32ed87bddf5697c3bccf2d3bb5d64 (diff)
downloadservo-73e67568c1a016928644570a3b364e454ac4da6f.tar.gz
servo-73e67568c1a016928644570a3b364e454ac4da6f.zip
Add FormData constructor
Diffstat (limited to 'src/components/script/dom/bindings/codegen')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py6
-rw-r--r--src/components/script/dom/bindings/codegen/FormData.webidl2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 8cfd491ebdb..a20dc523357 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -945,8 +945,10 @@ for (uint32_t i = 0; i < length; ++i) {
# Set up some sensible defaults for these things insofar as we can.
holderType = None
- if argIsPointer:
+ initialValue = None
+ if argIsPointer or isOptional:
declType = "Option<" + typePtr + ">"
+ initialValue = "None"
else:
declType = typePtr
@@ -995,7 +997,7 @@ for (uint32_t i = 0; i < length; ++i) {
declType = CGGeneric(declType)
if holderType is not None:
holderType = CGGeneric(holderType)
- return (templateBody, declType, holderType, isOptional, None)
+ return (templateBody, declType, holderType, isOptional, initialValue)
if type.isSpiderMonkeyInterface():
assert not isEnforceRange and not isClamp
diff --git a/src/components/script/dom/bindings/codegen/FormData.webidl b/src/components/script/dom/bindings/codegen/FormData.webidl
index 74cb218b5fc..4e4bef26850 100644
--- a/src/components/script/dom/bindings/codegen/FormData.webidl
+++ b/src/components/script/dom/bindings/codegen/FormData.webidl
@@ -7,7 +7,7 @@
* http://xhr.spec.whatwg.org
*/
-/*[Constructor(optional HTMLFormElement form)]*/
+[Constructor(optional HTMLFormElement form)]
interface FormData {
void append(DOMString name, Blob value, optional DOMString filename);
void append(DOMString name, DOMString value);