tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

elements-forms.js (4495B)


      1 var formElements = {
      2  form: {
      3    acceptCharset: {type: "string", domAttrName: "accept-charset"},
      4    // "action" has magic hard-coded in reflection.js
      5    action: "url",
      6    autocomplete: {type: "enum", keywords: ["on", "off"], defaultVal: "on"},
      7    enctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], defaultVal: "application/x-www-form-urlencoded"},
      8    encoding: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], defaultVal: "application/x-www-form-urlencoded", domAttrName: "enctype"},
      9    method: {type: "enum", keywords: ["get", "post", "dialog"], defaultVal: "get"},
     10    name: "string",
     11    noValidate: "boolean",
     12    target: "string",
     13  },
     14  fieldset: {
     15    disabled: "boolean",
     16    name: "string",
     17  },
     18  legend: {
     19    // Obsolete
     20    align: "string",
     21  },
     22  label: {
     23    htmlFor: {type: "string", domAttrName: "for"},
     24  },
     25  input: {
     26    // Conforming
     27    accept: "string",
     28    alt: "string",
     29    autocomplete: {type: "string", customGetter: true},
     30    defaultChecked: {type: "boolean", domAttrName: "checked"},
     31    dirName: "string",
     32    disabled: "boolean",
     33    // "formAction" has magic hard-coded in reflection.js
     34    formAction: "url",
     35    formEnctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalidVal: "application/x-www-form-urlencoded"},
     36    formMethod: {type: "enum", keywords: ["get", "post"], invalidVal: "get"},
     37    formNoValidate: "boolean",
     38    formTarget: "string",
     39    height: {type: "unsigned long", customGetter: true},
     40    max: "string",
     41    maxLength: "limited long",
     42    min: "string",
     43    minLength: "limited long",
     44    multiple: "boolean",
     45    name: "string",
     46    pattern: "string",
     47    placeholder: "string",
     48    readOnly: "boolean",
     49    required: "boolean",
     50    // https://html.spec.whatwg.org/#attr-input-size
     51    size: {type: "limited unsigned long", defaultVal: 20},
     52    src: "url",
     53    step: "string",
     54    type: {type: "enum", keywords: ["hidden", "text", "search", "tel",
     55      "url", "email", "password", "date",
     56      "time", "datetime-local", "number", "range", "color", "checkbox",
     57      "radio", "file", "submit", "image", "reset", "button"], defaultVal:
     58      "text"},
     59    width: {type: "unsigned long", customGetter: true},
     60    defaultValue: {type: "string", domAttrName: "value"},
     61 
     62    // Obsolete
     63    align: "string",
     64    useMap: "string",
     65  },
     66  button: {
     67    disabled: "boolean",
     68    // "formAction" has magic hard-coded in reflection.js
     69    formAction: "url",
     70    formEnctype: {type: "enum", keywords: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalidVal: "application/x-www-form-urlencoded"},
     71    formMethod: {type: "enum", keywords: ["get", "post", "dialog"], invalidVal: "get"},
     72    formNoValidate: "boolean",
     73    formTarget: "string",
     74    name: "string",
     75    type: {type: "enum", keywords: ["submit", "reset", "button"], defaultVal: "submit"},
     76    value: "string"
     77  },
     78  select: {
     79    autocomplete: {type: "string", customGetter: true},
     80    disabled: "boolean",
     81    multiple: "boolean",
     82    name: "string",
     83    required: "boolean",
     84    size: {type: "unsigned long", defaultVal: 0},
     85  },
     86  datalist: {},
     87  optgroup: {
     88    disabled: "boolean",
     89    label: "string",
     90  },
     91  option: {
     92    disabled: "boolean",
     93    label: {type: "string", customGetter: true},
     94    defaultSelected: {type: "boolean", domAttrName: "selected"},
     95    value: {type: "string", customGetter: true},
     96  },
     97  textarea: {
     98    autocomplete: {type: "string", customGetter: true},
     99    cols: {type: "limited unsigned long with fallback", defaultVal: 20},
    100    dirName: "string",
    101    disabled: "boolean",
    102    maxLength: "limited long",
    103    minLength: "limited long",
    104    name: "string",
    105    placeholder: "string",
    106    readOnly: "boolean",
    107    required: "boolean",
    108    rows: {type: "limited unsigned long with fallback", defaultVal: 2},
    109    wrap: "string",
    110  },
    111  output: {
    112    htmlFor: {type: "settable tokenlist", domAttrName: "for" },
    113    name: "string",
    114  },
    115  progress: {
    116    max: {type: "limited double", defaultVal: 1.0},
    117  },
    118  meter: {
    119    value: {type: "double", customGetter: true},
    120    min: {type: "double", customGetter: true},
    121    max: {type: "double", customGetter: true},
    122    low: {type: "double", customGetter: true},
    123    high: {type: "double", customGetter: true},
    124    optimum: {type: "double", customGetter: true},
    125  },
    126 };
    127 
    128 mergeElements(formElements);