1 | 'use strict'
|
---|
2 |
|
---|
3 | var types = require('./util/types')
|
---|
4 | var create = require('./util/create')
|
---|
5 | var caseInsensitiveTransform = require('./util/case-insensitive-transform')
|
---|
6 |
|
---|
7 | var boolean = types.boolean
|
---|
8 | var overloadedBoolean = types.overloadedBoolean
|
---|
9 | var booleanish = types.booleanish
|
---|
10 | var number = types.number
|
---|
11 | var spaceSeparated = types.spaceSeparated
|
---|
12 | var commaSeparated = types.commaSeparated
|
---|
13 |
|
---|
14 | module.exports = create({
|
---|
15 | space: 'html',
|
---|
16 | attributes: {
|
---|
17 | acceptcharset: 'accept-charset',
|
---|
18 | classname: 'class',
|
---|
19 | htmlfor: 'for',
|
---|
20 | httpequiv: 'http-equiv'
|
---|
21 | },
|
---|
22 | transform: caseInsensitiveTransform,
|
---|
23 | mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],
|
---|
24 | properties: {
|
---|
25 | // Standard Properties.
|
---|
26 | abbr: null,
|
---|
27 | accept: commaSeparated,
|
---|
28 | acceptCharset: spaceSeparated,
|
---|
29 | accessKey: spaceSeparated,
|
---|
30 | action: null,
|
---|
31 | allow: null,
|
---|
32 | allowFullScreen: boolean,
|
---|
33 | allowPaymentRequest: boolean,
|
---|
34 | allowUserMedia: boolean,
|
---|
35 | alt: null,
|
---|
36 | as: null,
|
---|
37 | async: boolean,
|
---|
38 | autoCapitalize: null,
|
---|
39 | autoComplete: spaceSeparated,
|
---|
40 | autoFocus: boolean,
|
---|
41 | autoPlay: boolean,
|
---|
42 | capture: boolean,
|
---|
43 | charSet: null,
|
---|
44 | checked: boolean,
|
---|
45 | cite: null,
|
---|
46 | className: spaceSeparated,
|
---|
47 | cols: number,
|
---|
48 | colSpan: null,
|
---|
49 | content: null,
|
---|
50 | contentEditable: booleanish,
|
---|
51 | controls: boolean,
|
---|
52 | controlsList: spaceSeparated,
|
---|
53 | coords: number | commaSeparated,
|
---|
54 | crossOrigin: null,
|
---|
55 | data: null,
|
---|
56 | dateTime: null,
|
---|
57 | decoding: null,
|
---|
58 | default: boolean,
|
---|
59 | defer: boolean,
|
---|
60 | dir: null,
|
---|
61 | dirName: null,
|
---|
62 | disabled: boolean,
|
---|
63 | download: overloadedBoolean,
|
---|
64 | draggable: booleanish,
|
---|
65 | encType: null,
|
---|
66 | enterKeyHint: null,
|
---|
67 | form: null,
|
---|
68 | formAction: null,
|
---|
69 | formEncType: null,
|
---|
70 | formMethod: null,
|
---|
71 | formNoValidate: boolean,
|
---|
72 | formTarget: null,
|
---|
73 | headers: spaceSeparated,
|
---|
74 | height: number,
|
---|
75 | hidden: boolean,
|
---|
76 | high: number,
|
---|
77 | href: null,
|
---|
78 | hrefLang: null,
|
---|
79 | htmlFor: spaceSeparated,
|
---|
80 | httpEquiv: spaceSeparated,
|
---|
81 | id: null,
|
---|
82 | imageSizes: null,
|
---|
83 | imageSrcSet: commaSeparated,
|
---|
84 | inputMode: null,
|
---|
85 | integrity: null,
|
---|
86 | is: null,
|
---|
87 | isMap: boolean,
|
---|
88 | itemId: null,
|
---|
89 | itemProp: spaceSeparated,
|
---|
90 | itemRef: spaceSeparated,
|
---|
91 | itemScope: boolean,
|
---|
92 | itemType: spaceSeparated,
|
---|
93 | kind: null,
|
---|
94 | label: null,
|
---|
95 | lang: null,
|
---|
96 | language: null,
|
---|
97 | list: null,
|
---|
98 | loading: null,
|
---|
99 | loop: boolean,
|
---|
100 | low: number,
|
---|
101 | manifest: null,
|
---|
102 | max: null,
|
---|
103 | maxLength: number,
|
---|
104 | media: null,
|
---|
105 | method: null,
|
---|
106 | min: null,
|
---|
107 | minLength: number,
|
---|
108 | multiple: boolean,
|
---|
109 | muted: boolean,
|
---|
110 | name: null,
|
---|
111 | nonce: null,
|
---|
112 | noModule: boolean,
|
---|
113 | noValidate: boolean,
|
---|
114 | onAbort: null,
|
---|
115 | onAfterPrint: null,
|
---|
116 | onAuxClick: null,
|
---|
117 | onBeforePrint: null,
|
---|
118 | onBeforeUnload: null,
|
---|
119 | onBlur: null,
|
---|
120 | onCancel: null,
|
---|
121 | onCanPlay: null,
|
---|
122 | onCanPlayThrough: null,
|
---|
123 | onChange: null,
|
---|
124 | onClick: null,
|
---|
125 | onClose: null,
|
---|
126 | onContextMenu: null,
|
---|
127 | onCopy: null,
|
---|
128 | onCueChange: null,
|
---|
129 | onCut: null,
|
---|
130 | onDblClick: null,
|
---|
131 | onDrag: null,
|
---|
132 | onDragEnd: null,
|
---|
133 | onDragEnter: null,
|
---|
134 | onDragExit: null,
|
---|
135 | onDragLeave: null,
|
---|
136 | onDragOver: null,
|
---|
137 | onDragStart: null,
|
---|
138 | onDrop: null,
|
---|
139 | onDurationChange: null,
|
---|
140 | onEmptied: null,
|
---|
141 | onEnded: null,
|
---|
142 | onError: null,
|
---|
143 | onFocus: null,
|
---|
144 | onFormData: null,
|
---|
145 | onHashChange: null,
|
---|
146 | onInput: null,
|
---|
147 | onInvalid: null,
|
---|
148 | onKeyDown: null,
|
---|
149 | onKeyPress: null,
|
---|
150 | onKeyUp: null,
|
---|
151 | onLanguageChange: null,
|
---|
152 | onLoad: null,
|
---|
153 | onLoadedData: null,
|
---|
154 | onLoadedMetadata: null,
|
---|
155 | onLoadEnd: null,
|
---|
156 | onLoadStart: null,
|
---|
157 | onMessage: null,
|
---|
158 | onMessageError: null,
|
---|
159 | onMouseDown: null,
|
---|
160 | onMouseEnter: null,
|
---|
161 | onMouseLeave: null,
|
---|
162 | onMouseMove: null,
|
---|
163 | onMouseOut: null,
|
---|
164 | onMouseOver: null,
|
---|
165 | onMouseUp: null,
|
---|
166 | onOffline: null,
|
---|
167 | onOnline: null,
|
---|
168 | onPageHide: null,
|
---|
169 | onPageShow: null,
|
---|
170 | onPaste: null,
|
---|
171 | onPause: null,
|
---|
172 | onPlay: null,
|
---|
173 | onPlaying: null,
|
---|
174 | onPopState: null,
|
---|
175 | onProgress: null,
|
---|
176 | onRateChange: null,
|
---|
177 | onRejectionHandled: null,
|
---|
178 | onReset: null,
|
---|
179 | onResize: null,
|
---|
180 | onScroll: null,
|
---|
181 | onSecurityPolicyViolation: null,
|
---|
182 | onSeeked: null,
|
---|
183 | onSeeking: null,
|
---|
184 | onSelect: null,
|
---|
185 | onSlotChange: null,
|
---|
186 | onStalled: null,
|
---|
187 | onStorage: null,
|
---|
188 | onSubmit: null,
|
---|
189 | onSuspend: null,
|
---|
190 | onTimeUpdate: null,
|
---|
191 | onToggle: null,
|
---|
192 | onUnhandledRejection: null,
|
---|
193 | onUnload: null,
|
---|
194 | onVolumeChange: null,
|
---|
195 | onWaiting: null,
|
---|
196 | onWheel: null,
|
---|
197 | open: boolean,
|
---|
198 | optimum: number,
|
---|
199 | pattern: null,
|
---|
200 | ping: spaceSeparated,
|
---|
201 | placeholder: null,
|
---|
202 | playsInline: boolean,
|
---|
203 | poster: null,
|
---|
204 | preload: null,
|
---|
205 | readOnly: boolean,
|
---|
206 | referrerPolicy: null,
|
---|
207 | rel: spaceSeparated,
|
---|
208 | required: boolean,
|
---|
209 | reversed: boolean,
|
---|
210 | rows: number,
|
---|
211 | rowSpan: number,
|
---|
212 | sandbox: spaceSeparated,
|
---|
213 | scope: null,
|
---|
214 | scoped: boolean,
|
---|
215 | seamless: boolean,
|
---|
216 | selected: boolean,
|
---|
217 | shape: null,
|
---|
218 | size: number,
|
---|
219 | sizes: null,
|
---|
220 | slot: null,
|
---|
221 | span: number,
|
---|
222 | spellCheck: booleanish,
|
---|
223 | src: null,
|
---|
224 | srcDoc: null,
|
---|
225 | srcLang: null,
|
---|
226 | srcSet: commaSeparated,
|
---|
227 | start: number,
|
---|
228 | step: null,
|
---|
229 | style: null,
|
---|
230 | tabIndex: number,
|
---|
231 | target: null,
|
---|
232 | title: null,
|
---|
233 | translate: null,
|
---|
234 | type: null,
|
---|
235 | typeMustMatch: boolean,
|
---|
236 | useMap: null,
|
---|
237 | value: booleanish,
|
---|
238 | width: number,
|
---|
239 | wrap: null,
|
---|
240 |
|
---|
241 | // Legacy.
|
---|
242 | // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
---|
243 | align: null, // Several. Use CSS `text-align` instead,
|
---|
244 | aLink: null, // `<body>`. Use CSS `a:active {color}` instead
|
---|
245 | archive: spaceSeparated, // `<object>`. List of URIs to archives
|
---|
246 | axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`
|
---|
247 | background: null, // `<body>`. Use CSS `background-image` instead
|
---|
248 | bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead
|
---|
249 | border: number, // `<table>`. Use CSS `border-width` instead,
|
---|
250 | borderColor: null, // `<table>`. Use CSS `border-color` instead,
|
---|
251 | bottomMargin: number, // `<body>`
|
---|
252 | cellPadding: null, // `<table>`
|
---|
253 | cellSpacing: null, // `<table>`
|
---|
254 | char: null, // Several table elements. When `align=char`, sets the character to align on
|
---|
255 | charOff: null, // Several table elements. When `char`, offsets the alignment
|
---|
256 | classId: null, // `<object>`
|
---|
257 | clear: null, // `<br>`. Use CSS `clear` instead
|
---|
258 | code: null, // `<object>`
|
---|
259 | codeBase: null, // `<object>`
|
---|
260 | codeType: null, // `<object>`
|
---|
261 | color: null, // `<font>` and `<hr>`. Use CSS instead
|
---|
262 | compact: boolean, // Lists. Use CSS to reduce space between items instead
|
---|
263 | declare: boolean, // `<object>`
|
---|
264 | event: null, // `<script>`
|
---|
265 | face: null, // `<font>`. Use CSS instead
|
---|
266 | frame: null, // `<table>`
|
---|
267 | frameBorder: null, // `<iframe>`. Use CSS `border` instead
|
---|
268 | hSpace: number, // `<img>` and `<object>`
|
---|
269 | leftMargin: number, // `<body>`
|
---|
270 | link: null, // `<body>`. Use CSS `a:link {color: *}` instead
|
---|
271 | longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
---|
272 | lowSrc: null, // `<img>`. Use a `<picture>`
|
---|
273 | marginHeight: number, // `<body>`
|
---|
274 | marginWidth: number, // `<body>`
|
---|
275 | noResize: boolean, // `<frame>`
|
---|
276 | noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`
|
---|
277 | noShade: boolean, // `<hr>`. Use background-color and height instead of borders
|
---|
278 | noWrap: boolean, // `<td>` and `<th>`
|
---|
279 | object: null, // `<applet>`
|
---|
280 | profile: null, // `<head>`
|
---|
281 | prompt: null, // `<isindex>`
|
---|
282 | rev: null, // `<link>`
|
---|
283 | rightMargin: number, // `<body>`
|
---|
284 | rules: null, // `<table>`
|
---|
285 | scheme: null, // `<meta>`
|
---|
286 | scrolling: booleanish, // `<frame>`. Use overflow in the child context
|
---|
287 | standby: null, // `<object>`
|
---|
288 | summary: null, // `<table>`
|
---|
289 | text: null, // `<body>`. Use CSS `color` instead
|
---|
290 | topMargin: number, // `<body>`
|
---|
291 | valueType: null, // `<param>`
|
---|
292 | version: null, // `<html>`. Use a doctype.
|
---|
293 | vAlign: null, // Several. Use CSS `vertical-align` instead
|
---|
294 | vLink: null, // `<body>`. Use CSS `a:visited {color}` instead
|
---|
295 | vSpace: number, // `<img>` and `<object>`
|
---|
296 |
|
---|
297 | // Non-standard Properties.
|
---|
298 | allowTransparency: null,
|
---|
299 | autoCorrect: null,
|
---|
300 | autoSave: null,
|
---|
301 | disablePictureInPicture: boolean,
|
---|
302 | disableRemotePlayback: boolean,
|
---|
303 | prefix: null,
|
---|
304 | property: null,
|
---|
305 | results: number,
|
---|
306 | security: null,
|
---|
307 | unselectable: null
|
---|
308 | }
|
---|
309 | })
|
---|