1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_HTMLFormSubmissionConstants_h
8 #define mozilla_dom_HTMLFormSubmissionConstants_h
10 #define NS_FORM_METHOD_GET 0
11 #define NS_FORM_METHOD_POST 1
12 #define NS_FORM_METHOD_DIALOG 2
13 #define NS_FORM_ENCTYPE_URLENCODED 0
14 #define NS_FORM_ENCTYPE_MULTIPART 1
15 #define NS_FORM_ENCTYPE_TEXTPLAIN 2
17 static const nsAttrValue::EnumTable kFormMethodTable
[] = {
18 {"get", NS_FORM_METHOD_GET
}, {"post", NS_FORM_METHOD_POST
}, {nullptr, 0}};
20 static const nsAttrValue::EnumTable kFormMethodTableDialogEnabled
[] = {
21 {"get", NS_FORM_METHOD_GET
},
22 {"post", NS_FORM_METHOD_POST
},
23 {"dialog", NS_FORM_METHOD_DIALOG
},
26 // Default method is 'get'.
27 static const nsAttrValue::EnumTable
* kFormDefaultMethod
= &kFormMethodTable
[0];
29 static const nsAttrValue::EnumTable kFormEnctypeTable
[] = {
30 {"multipart/form-data", NS_FORM_ENCTYPE_MULTIPART
},
31 {"application/x-www-form-urlencoded", NS_FORM_ENCTYPE_URLENCODED
},
32 {"text/plain", NS_FORM_ENCTYPE_TEXTPLAIN
},
35 // Default method is 'application/x-www-form-urlencoded'.
36 static const nsAttrValue::EnumTable
* kFormDefaultEnctype
=
37 &kFormEnctypeTable
[1];
39 #endif // mozilla_dom_HTMLFormSubmissionConstants_h