220 lines
6.2 KiB
JavaScript
220 lines
6.2 KiB
JavaScript
'use strict'
|
|
|
|
var types = require('./util/types')
|
|
var create = require('./util/create')
|
|
var caseInsensitiveTransform = require('./util/case-insensitive-transform')
|
|
|
|
var boolean = types.boolean
|
|
var overloadedBoolean = types.overloadedBoolean
|
|
var booleanish = types.booleanish
|
|
var number = types.number
|
|
var spaceSeparated = types.spaceSeparated
|
|
var commaSeparated = types.commaSeparated
|
|
|
|
module.exports = create({
|
|
space: 'html',
|
|
attributes: {
|
|
acceptcharset: 'accept-charset',
|
|
classname: 'class',
|
|
htmlfor: 'for',
|
|
httpequiv: 'http-equiv'
|
|
},
|
|
transform: caseInsensitiveTransform,
|
|
mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],
|
|
properties: {
|
|
// Standard Properties.
|
|
abbr: null,
|
|
accept: commaSeparated,
|
|
acceptCharset: spaceSeparated,
|
|
accessKey: spaceSeparated,
|
|
action: null,
|
|
allowFullScreen: boolean,
|
|
allowPaymentRequest: boolean,
|
|
allowUserMedia: boolean,
|
|
alt: null,
|
|
as: null,
|
|
async: boolean,
|
|
autoCapitalize: null,
|
|
autoComplete: spaceSeparated,
|
|
autoFocus: boolean,
|
|
autoPlay: boolean,
|
|
capture: boolean,
|
|
charSet: null,
|
|
checked: boolean,
|
|
cite: null,
|
|
className: spaceSeparated,
|
|
cols: number,
|
|
colSpan: null,
|
|
content: null,
|
|
contentEditable: booleanish,
|
|
controls: boolean,
|
|
controlsList: spaceSeparated,
|
|
coords: number | commaSeparated,
|
|
crossOrigin: null,
|
|
data: null,
|
|
dateTime: null,
|
|
decoding: null,
|
|
default: boolean,
|
|
defer: boolean,
|
|
dir: null,
|
|
dirName: null,
|
|
disabled: boolean,
|
|
download: overloadedBoolean,
|
|
draggable: booleanish,
|
|
encType: null,
|
|
form: null,
|
|
formAction: null,
|
|
formEncType: null,
|
|
formMethod: null,
|
|
formNoValidate: boolean,
|
|
formTarget: null,
|
|
headers: spaceSeparated,
|
|
height: number,
|
|
hidden: boolean,
|
|
high: number,
|
|
href: null,
|
|
hrefLang: null,
|
|
htmlFor: spaceSeparated,
|
|
httpEquiv: spaceSeparated,
|
|
id: null,
|
|
inputMode: null,
|
|
integrity: null,
|
|
is: null,
|
|
isMap: boolean,
|
|
itemId: null,
|
|
itemProp: spaceSeparated,
|
|
itemRef: spaceSeparated,
|
|
itemScope: boolean,
|
|
itemType: spaceSeparated,
|
|
kind: null,
|
|
label: null,
|
|
lang: null,
|
|
language: null,
|
|
list: null,
|
|
loop: boolean,
|
|
low: number,
|
|
manifest: null,
|
|
max: null,
|
|
maxLength: number,
|
|
media: null,
|
|
method: null,
|
|
min: null,
|
|
minLength: number,
|
|
multiple: boolean,
|
|
muted: boolean,
|
|
name: null,
|
|
nonce: null,
|
|
noModule: boolean,
|
|
noValidate: boolean,
|
|
open: boolean,
|
|
optimum: number,
|
|
pattern: null,
|
|
ping: spaceSeparated,
|
|
placeholder: null,
|
|
playsInline: boolean,
|
|
poster: null,
|
|
preload: null,
|
|
readOnly: boolean,
|
|
referrerPolicy: null,
|
|
rel: spaceSeparated,
|
|
required: boolean,
|
|
reversed: boolean,
|
|
rows: number,
|
|
rowSpan: number,
|
|
sandbox: spaceSeparated,
|
|
scope: null,
|
|
scoped: boolean,
|
|
seamless: boolean,
|
|
selected: boolean,
|
|
shape: null,
|
|
size: number,
|
|
sizes: spaceSeparated,
|
|
slot: null,
|
|
span: number,
|
|
spellCheck: booleanish,
|
|
src: null,
|
|
srcDoc: null,
|
|
srcLang: null,
|
|
srcSet: commaSeparated,
|
|
start: number,
|
|
step: null,
|
|
style: null,
|
|
tabIndex: number,
|
|
target: null,
|
|
title: null,
|
|
translate: null,
|
|
type: null,
|
|
typeMustMatch: boolean,
|
|
useMap: null,
|
|
value: booleanish,
|
|
width: number,
|
|
wrap: null,
|
|
|
|
// Legacy.
|
|
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
|
align: null, // Several. Use CSS `text-align` instead,
|
|
aLink: null, // `<body>`. Use CSS `a:active {color}` instead
|
|
archive: spaceSeparated, // `<object>`. List of URIs to archives
|
|
axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`
|
|
background: null, // `<body>`. Use CSS `background-image` instead
|
|
bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead
|
|
border: number, // `<table>`. Use CSS `border-width` instead,
|
|
borderColor: null, // `<table>`. Use CSS `border-color` instead,
|
|
bottomMargin: number, // `<body>`
|
|
cellPadding: null, // `<table>`
|
|
cellSpacing: null, // `<table>`
|
|
char: null, // Several table elements. When `align=char`, sets the character to align on
|
|
charOff: null, // Several table elements. When `char`, offsets the alignment
|
|
classId: null, // `<object>`
|
|
clear: null, // `<br>`. Use CSS `clear` instead
|
|
code: null, // `<object>`
|
|
codeBase: null, // `<object>`
|
|
codeType: null, // `<object>`
|
|
color: null, // `<font>` and `<hr>`. Use CSS instead
|
|
compact: boolean, // Lists. Use CSS to reduce space between items instead
|
|
declare: boolean, // `<object>`
|
|
event: null, // `<script>`
|
|
face: null, // `<font>`. Use CSS instead
|
|
frame: null, // `<table>`
|
|
frameBorder: null, // `<iframe>`. Use CSS `border` instead
|
|
hSpace: number, // `<img>` and `<object>`
|
|
leftMargin: number, // `<body>`
|
|
link: null, // `<body>`. Use CSS `a:link {color: *}` instead
|
|
longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
|
lowSrc: null, // `<img>`. Use a `<picture>`
|
|
marginHeight: number, // `<body>`
|
|
marginWidth: number, // `<body>`
|
|
noResize: boolean, // `<frame>`
|
|
noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`
|
|
noShade: boolean, // `<hr>`. Use background-color and height instead of borders
|
|
noWrap: boolean, // `<td>` and `<th>`
|
|
object: null, // `<applet>`
|
|
profile: null, // `<head>`
|
|
prompt: null, // `<isindex>`
|
|
rev: null, // `<link>`
|
|
rightMargin: number, // `<body>`
|
|
rules: null, // `<table>`
|
|
scheme: null, // `<meta>`
|
|
scrolling: booleanish, // `<frame>`. Use overflow in the child context
|
|
standby: null, // `<object>`
|
|
summary: null, // `<table>`
|
|
text: null, // `<body>`. Use CSS `color` instead
|
|
topMargin: number, // `<body>`
|
|
valueType: null, // `<param>`
|
|
version: null, // `<html>`. Use a doctype.
|
|
vAlign: null, // Several. Use CSS `vertical-align` instead
|
|
vLink: null, // `<body>`. Use CSS `a:visited {color}` instead
|
|
vSpace: number, // `<img>` and `<object>`
|
|
|
|
// Non-standard Properties.
|
|
allowTransparency: null,
|
|
autoCorrect: null,
|
|
autoSave: null,
|
|
prefix: null,
|
|
property: null,
|
|
results: number,
|
|
security: null,
|
|
unselectable: null
|
|
}
|
|
})
|