html.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. 'use strict'
  2. var types = require('./util/types')
  3. var create = require('./util/create')
  4. var caseInsensitiveTransform = require('./util/case-insensitive-transform')
  5. var boolean = types.boolean
  6. var overloadedBoolean = types.overloadedBoolean
  7. var booleanish = types.booleanish
  8. var number = types.number
  9. var spaceSeparated = types.spaceSeparated
  10. var commaSeparated = types.commaSeparated
  11. module.exports = create({
  12. space: 'html',
  13. attributes: {
  14. acceptcharset: 'accept-charset',
  15. classname: 'class',
  16. htmlfor: 'for',
  17. httpequiv: 'http-equiv'
  18. },
  19. transform: caseInsensitiveTransform,
  20. mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],
  21. properties: {
  22. // Standard Properties.
  23. abbr: null,
  24. accept: commaSeparated,
  25. acceptCharset: spaceSeparated,
  26. accessKey: spaceSeparated,
  27. action: null,
  28. allowFullScreen: boolean,
  29. allowPaymentRequest: boolean,
  30. allowUserMedia: boolean,
  31. alt: null,
  32. as: null,
  33. async: boolean,
  34. autoCapitalize: null,
  35. autoComplete: spaceSeparated,
  36. autoFocus: boolean,
  37. autoPlay: boolean,
  38. capture: boolean,
  39. charSet: null,
  40. checked: boolean,
  41. cite: null,
  42. className: spaceSeparated,
  43. cols: number,
  44. colSpan: null,
  45. content: null,
  46. contentEditable: booleanish,
  47. controls: boolean,
  48. controlsList: spaceSeparated,
  49. coords: number | commaSeparated,
  50. crossOrigin: null,
  51. data: null,
  52. dateTime: null,
  53. decoding: null,
  54. default: boolean,
  55. defer: boolean,
  56. dir: null,
  57. dirName: null,
  58. disabled: boolean,
  59. download: overloadedBoolean,
  60. draggable: booleanish,
  61. encType: null,
  62. form: null,
  63. formAction: null,
  64. formEncType: null,
  65. formMethod: null,
  66. formNoValidate: boolean,
  67. formTarget: null,
  68. headers: spaceSeparated,
  69. height: number,
  70. hidden: boolean,
  71. high: number,
  72. href: null,
  73. hrefLang: null,
  74. htmlFor: spaceSeparated,
  75. httpEquiv: spaceSeparated,
  76. id: null,
  77. inputMode: null,
  78. integrity: null,
  79. is: null,
  80. isMap: boolean,
  81. itemId: null,
  82. itemProp: spaceSeparated,
  83. itemRef: spaceSeparated,
  84. itemScope: boolean,
  85. itemType: spaceSeparated,
  86. kind: null,
  87. label: null,
  88. lang: null,
  89. language: null,
  90. list: null,
  91. loop: boolean,
  92. low: number,
  93. manifest: null,
  94. max: null,
  95. maxLength: number,
  96. media: null,
  97. method: null,
  98. min: null,
  99. minLength: number,
  100. multiple: boolean,
  101. muted: boolean,
  102. name: null,
  103. nonce: null,
  104. noModule: boolean,
  105. noValidate: boolean,
  106. open: boolean,
  107. optimum: number,
  108. pattern: null,
  109. ping: spaceSeparated,
  110. placeholder: null,
  111. playsInline: boolean,
  112. poster: null,
  113. preload: null,
  114. readOnly: boolean,
  115. referrerPolicy: null,
  116. rel: spaceSeparated,
  117. required: boolean,
  118. reversed: boolean,
  119. rows: number,
  120. rowSpan: number,
  121. sandbox: spaceSeparated,
  122. scope: null,
  123. scoped: boolean,
  124. seamless: boolean,
  125. selected: boolean,
  126. shape: null,
  127. size: number,
  128. sizes: spaceSeparated,
  129. slot: null,
  130. span: number,
  131. spellCheck: booleanish,
  132. src: null,
  133. srcDoc: null,
  134. srcLang: null,
  135. srcSet: commaSeparated,
  136. start: number,
  137. step: null,
  138. style: null,
  139. tabIndex: number,
  140. target: null,
  141. title: null,
  142. translate: null,
  143. type: null,
  144. typeMustMatch: boolean,
  145. useMap: null,
  146. value: booleanish,
  147. width: number,
  148. wrap: null,
  149. // Legacy.
  150. // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
  151. align: null, // Several. Use CSS `text-align` instead,
  152. aLink: null, // `<body>`. Use CSS `a:active {color}` instead
  153. archive: spaceSeparated, // `<object>`. List of URIs to archives
  154. axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`
  155. background: null, // `<body>`. Use CSS `background-image` instead
  156. bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead
  157. border: number, // `<table>`. Use CSS `border-width` instead,
  158. borderColor: null, // `<table>`. Use CSS `border-color` instead,
  159. bottomMargin: number, // `<body>`
  160. cellPadding: null, // `<table>`
  161. cellSpacing: null, // `<table>`
  162. char: null, // Several table elements. When `align=char`, sets the character to align on
  163. charOff: null, // Several table elements. When `char`, offsets the alignment
  164. classId: null, // `<object>`
  165. clear: null, // `<br>`. Use CSS `clear` instead
  166. code: null, // `<object>`
  167. codeBase: null, // `<object>`
  168. codeType: null, // `<object>`
  169. color: null, // `<font>` and `<hr>`. Use CSS instead
  170. compact: boolean, // Lists. Use CSS to reduce space between items instead
  171. declare: boolean, // `<object>`
  172. event: null, // `<script>`
  173. face: null, // `<font>`. Use CSS instead
  174. frame: null, // `<table>`
  175. frameBorder: null, // `<iframe>`. Use CSS `border` instead
  176. hSpace: number, // `<img>` and `<object>`
  177. leftMargin: number, // `<body>`
  178. link: null, // `<body>`. Use CSS `a:link {color: *}` instead
  179. longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
  180. lowSrc: null, // `<img>`. Use a `<picture>`
  181. marginHeight: number, // `<body>`
  182. marginWidth: number, // `<body>`
  183. noResize: boolean, // `<frame>`
  184. noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`
  185. noShade: boolean, // `<hr>`. Use background-color and height instead of borders
  186. noWrap: boolean, // `<td>` and `<th>`
  187. object: null, // `<applet>`
  188. profile: null, // `<head>`
  189. prompt: null, // `<isindex>`
  190. rev: null, // `<link>`
  191. rightMargin: number, // `<body>`
  192. rules: null, // `<table>`
  193. scheme: null, // `<meta>`
  194. scrolling: booleanish, // `<frame>`. Use overflow in the child context
  195. standby: null, // `<object>`
  196. summary: null, // `<table>`
  197. text: null, // `<body>`. Use CSS `color` instead
  198. topMargin: number, // `<body>`
  199. valueType: null, // `<param>`
  200. version: null, // `<html>`. Use a doctype.
  201. vAlign: null, // Several. Use CSS `vertical-align` instead
  202. vLink: null, // `<body>`. Use CSS `a:visited {color}` instead
  203. vSpace: number, // `<img>` and `<object>`
  204. // Non-standard Properties.
  205. allowTransparency: null,
  206. autoCorrect: null,
  207. autoSave: null,
  208. prefix: null,
  209. property: null,
  210. results: number,
  211. security: null,
  212. unselectable: null
  213. }
  214. })