HTMLFormSubmissionConstants.h (1394B)
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/. */ 6 7 #ifndef mozilla_dom_HTMLFormSubmissionConstants_h 8 #define mozilla_dom_HTMLFormSubmissionConstants_h 9 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 16 17 static constexpr nsAttrValue::EnumTableEntry kFormMethodTable[] = { 18 {"get", NS_FORM_METHOD_GET}, 19 {"post", NS_FORM_METHOD_POST}, 20 {"dialog", NS_FORM_METHOD_DIALOG}}; 21 22 // Default method is 'get'. 23 static constexpr const nsAttrValue::EnumTableEntry* kFormDefaultMethod = 24 &kFormMethodTable[0]; 25 26 static constexpr nsAttrValue::EnumTableEntry kFormEnctypeTable[] = { 27 {"multipart/form-data", NS_FORM_ENCTYPE_MULTIPART}, 28 {"application/x-www-form-urlencoded", NS_FORM_ENCTYPE_URLENCODED}, 29 {"text/plain", NS_FORM_ENCTYPE_TEXTPLAIN}, 30 }; 31 32 // Default method is 'application/x-www-form-urlencoded'. 33 static constexpr const nsAttrValue::EnumTableEntry* kFormDefaultEnctype = 34 &kFormEnctypeTable[1]; 35 36 #endif // mozilla_dom_HTMLFormSubmissionConstants_h