Skip to content

Instantly share code, notes, and snippets.

@paulmolluzzo
Last active October 18, 2020 02:41
Show Gist options
  • Save paulmolluzzo/b3b9155b9b9c9addaee3ca0bb5da670b to your computer and use it in GitHub Desktop.
Save paulmolluzzo/b3b9155b9b9c9addaee3ca0bb5da670b to your computer and use it in GitHub Desktop.
Missing HTML Props
const latestAttrs = {
"*": [
"className",
"dangerouslySetInnerHTML",
"dir",
"draggable",
"hidden",
"htmlFor",
"id",
"is",
"itemID",
"itemProp",
"itemRef",
"itemScope",
"itemType",
"lang",
"style",
"suppressContentEditableWarning",
"title"
],
"a": [
"coords",
"download",
"href",
"name",
"rel",
"shape",
"target",
"type"
],
"abbr": [
"title"
],
"applet": [
"alt",
"height",
"name",
"width"
],
"area": [
"alt",
"coords",
"download",
"href",
"rel",
"shape",
"target",
"type"
],
"audio": [
"controls",
"loop",
"muted",
"preload",
"src"
],
"base": [
"href",
"target"
],
"basefont": [
"size"
],
"bdo": [
"dir"
],
"blockquote": [
"cite"
],
"button": [
"disabled",
"form",
"name",
"type",
"value"
],
"canvas": [
"height",
"width"
],
"col": [
"span",
"width"
],
"colgroup": [
"span",
"width"
],
"data": [
"value"
],
"del": [
"cite"
],
"details": [
"open"
],
"dfn": [
"title"
],
"dialog": [
"open"
],
"embed": [
"height",
"src",
"type",
"width"
],
"fieldset": [
"disabled",
"form",
"name"
],
"font": [
"size"
],
"form": [
"accept",
"action",
"method",
"name",
"target"
],
"frame": [
"name",
"scrolling",
"src"
],
"frameset": [
"cols",
"rows"
],
"head": [
"profile"
],
"hr": [
"size",
"width"
],
"html": [
"manifest"
],
"iframe": [
"height",
"name",
"sandbox",
"scrolling",
"src",
"width"
],
"img": [
"alt",
"height",
"name",
"sizes",
"src",
"width"
],
"input": [
"accept",
"alt",
"autoCapitalize",
"autoCorrect",
"checked",
"defaultChecked",
"defaultValue",
"disabled",
"form",
"height",
"list",
"max",
"min",
"multiple",
"name",
"onChange",
"pattern",
"placeholder",
"required",
"size",
"src",
"step",
"title",
"type",
"value",
"width"
],
"ins": [
"cite"
],
"keygen": [
"challenge",
"disabled",
"form",
"name"
],
"label": [
"form"
],
"li": [
"type",
"value"
],
"link": [
"color",
"href",
"integrity",
"media",
"nonce",
"rel",
"scope",
"sizes",
"target",
"title",
"type"
],
"map": [
"name"
],
"menu": [
"label",
"type"
],
"menuitem": [
"checked",
"default",
"disabled",
"icon",
"label",
"title",
"type"
],
"meta": [
"content",
"name"
],
"meter": [
"high",
"low",
"max",
"min",
"optimum",
"value"
],
"object": [
"data",
"form",
"height",
"name",
"type",
"width"
],
"ol": [
"reversed",
"start",
"type"
],
"optgroup": [
"disabled",
"label"
],
"option": [
"disabled",
"label",
"selected",
"value"
],
"output": [
"form",
"name"
],
"param": [
"name",
"type",
"value"
],
"pre": [
"width"
],
"progress": [
"max",
"value"
],
"q": [
"cite"
],
"script": [
"async",
"defer",
"integrity",
"nonce",
"src",
"type"
],
"select": [
"defaultValue",
"disabled",
"form",
"multiple",
"name",
"onChange",
"required",
"size",
"value"
],
"slot": [
"name"
],
"source": [
"media",
"sizes",
"src",
"type"
],
"style": [
"media",
"nonce",
"title",
"type"
],
"table": [
"summary",
"width"
],
"td": [
"headers",
"height",
"scope",
"width"
],
"textarea": [
"autoCapitalize",
"autoCorrect",
"cols",
"defaultValue",
"disabled",
"form",
"name",
"onChange",
"placeholder",
"required",
"rows",
"value",
"wrap"
],
"th": [
"headers",
"height",
"scope",
"width"
],
"track": [
"default",
"kind",
"label",
"src"
],
"ul": [
"type"
],
"video": [
"controls",
"height",
"loop",
"muted",
"poster",
"preload",
"src",
"width"
],
"svg": [
"accentHeight",
"accumulate",
"additive",
"alignmentBaseline",
"allowReorder",
"alphabetic",
"amplitude",
"arabicForm",
"ascent",
"attributeName",
"attributeType",
"autoReverse",
"azimuth",
"baseFrequency",
"baseProfile",
"baselineShift",
"bbox",
"begin",
"bias",
"by",
"calcMode",
"capHeight",
"clip",
"clipPath",
"clipPathUnits",
"clipRule",
"color",
"colorInterpolation",
"colorInterpolationFilters",
"colorProfile",
"colorRendering",
"contentScriptType",
"contentStyleType",
"cursor",
"cx",
"cy",
"d",
"decelerate",
"descent",
"diffuseConstant",
"direction",
"display",
"divisor",
"dominantBaseline",
"dur",
"dx",
"dy",
"edgeMode",
"elevation",
"enableBackground",
"end",
"exponent",
"externalResourcesRequired",
"fill",
"fillOpacity",
"fillRule",
"filter",
"filterRes",
"filterUnits",
"floodColor",
"floodOpacity",
"focusable",
"fontFamily",
"fontSize",
"fontSizeAdjust",
"fontStretch",
"fontStyle",
"fontVariant",
"fontWeight",
"format",
"from",
"fx",
"fy",
"g1",
"g2",
"glyphName",
"glyphOrientationHorizontal",
"glyphOrientationVertical",
"glyphRef",
"gradientTransform",
"gradientUnits",
"hanging",
"height",
"horizAdvX",
"horizOriginX",
"ideographic",
"imageRendering",
"in",
"in2",
"intercept",
"k",
"k1",
"k2",
"k3",
"k4",
"kernelMatrix",
"kernelUnitLength",
"kerning",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"letterSpacing",
"lightingColor",
"limitingConeAngle",
"local",
"markerEnd",
"markerHeight",
"markerMid",
"markerStart",
"markerUnits",
"markerWidth",
"mask",
"maskContentUnits",
"maskUnits",
"mathematical",
"mode",
"numOctaves",
"offset",
"opacity",
"operator",
"order",
"orient",
"orientation",
"origin",
"overflow",
"overlinePosition",
"overlineThickness",
"paintOrder",
"panose1",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointerEvents",
"points",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"r",
"radius",
"refX",
"refY",
"renderingIntent",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"restart",
"result",
"rotate",
"rx",
"ry",
"scale",
"seed",
"shapeRendering",
"slope",
"spacing",
"specularConstant",
"specularExponent",
"speed",
"spreadMethod",
"startOffset",
"stdDeviation",
"stemh",
"stemv",
"stitchTiles",
"stopColor",
"stopOpacity",
"strikethroughPosition",
"strikethroughThickness",
"string",
"stroke",
"strokeDasharray",
"strokeDashoffset",
"strokeLinecap",
"strokeLinejoin",
"strokeMiterlimit",
"strokeOpacity",
"strokeWidth",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textAnchor",
"textDecoration",
"textLength",
"textRendering",
"to",
"transform",
"u1",
"u2",
"underlinePosition",
"underlineThickness",
"unicode",
"unicodeBidi",
"unicodeRange",
"unitsPerEm",
"vAlphabetic",
"vHanging",
"vIdeographic",
"vMathematical",
"values",
"vectorEffect",
"version",
"vertAdvY",
"vertOriginX",
"vertOriginY",
"viewBox",
"viewTarget",
"visibility",
"width",
"widths",
"wordSpacing",
"writingMode",
"x",
"x1",
"x2",
"xChannelSelector",
"xHeight",
"xlinkActuate",
"xlinkArcrole",
"xlinkHref",
"xlinkRole",
"xlinkShow",
"xlinkTitle",
"xlinkType",
"xmlBase",
"xmlLang",
"xmlSpace",
"xmlns",
"xmlnsXlink",
"y",
"y1",
"y2",
"yChannelSelector",
"z",
"zoomAndPan"
]
};
const htmlProps = [
'accept',
'acceptCharset',
'accessKey',
'action',
'allowFullScreen',
'allowTransparency',
'alt',
'as',
'async',
'autoComplete',
'// autoFocus',
'autoPlay',
'capture',
'cellPadding',
'cellSpacing',
'charSet',
'challenge',
'checked',
'cite',
'classID',
'className',
'cols',
'colSpan',
'content',
'contentEditable',
'contextMenu',
'controls',
'coords',
'crossOrigin',
'data',
'dateTime',
'default',
'defer',
'dir',
'disabled',
'download',
'draggable',
'encType',
'form',
'formAction',
'formEncType',
'formMethod',
'formNoValidate',
'formTarget',
'frameBorder',
'headers',
'height',
'hidden',
'high',
'href',
'hrefLang',
'htmlFor',
'httpEquiv',
'icon',
'id',
'inputMode',
'integrity',
'is',
'keyParams',
'keyType',
'kind',
'label',
'lang',
'list',
'loop',
'low',
'manifest',
'marginHeight',
'marginWidth',
'max',
'maxLength',
'media',
'mediaGroup',
'method',
'min',
'minLength',
'multiple',
'muted',
'name',
'nonce',
'noValidate',
'open',
'optimum',
'pattern',
'placeholder',
'playsInline',
'poster',
'preload',
'profile',
'radioGroup',
'readOnly',
'referrerPolicy',
'rel',
'required',
'reversed',
'role',
'rows',
'rowSpan',
'sandbox',
'scope',
'scoped',
'scrolling',
'seamless',
'selected',
'shape',
'size',
'sizes',
'span',
'spellCheck',
'src',
'srcDoc',
'srcLang',
'srcSet',
'start',
'step',
'style',
'summary',
'tabIndex',
'target',
'title',
'type',
'useMap',
'value',
'width',
'wmode',
'wrap',
'about',
'datatype',
'inlist',
'prefix',
'property',
'resource',
'typeof',
'vocab',
'autoCapitalize',
'autoCorrect',
'autoSave',
'color',
'itemProp',
'itemScope',
'itemType',
'itemID',
'itemRef',
'results',
'security',
'unselectable',
]
const svgProps = [
'accentHeight',
'accumulate',
'additive',
'alignmentBaseline',
'allowReorder',
'alphabetic',
'amplitude',
'arabicForm',
'ascent',
'attributeName',
'attributeType',
'autoReverse',
'azimuth',
'baseFrequency',
'baseProfile',
'baselineShift',
'bbox',
'begin',
'bias',
'by',
'calcMode',
'capHeight',
'clip',
'clipPath',
'clipRule',
'clipPathUnits',
'colorInterpolation',
'colorInterpolationFilters',
'colorProfile',
'colorRendering',
'contentScriptType',
'contentStyleType',
'cursor',
'cx',
'cy',
'd',
'decelerate',
'descent',
'diffuseConstant',
'direction',
'display',
'divisor',
'dominantBaseline',
'dur',
'dx',
'dy',
'edgeMode',
'elevation',
'enableBackground',
'end',
'exponent',
'externalResourcesRequired',
'fill',
'fillOpacity',
'fillRule',
'filter',
'filterRes',
'filterUnits',
'floodColor',
'floodOpacity',
'focusable',
'fontFamily',
'fontSize',
'fontSizeAdjust',
'fontStretch',
'fontStyle',
'fontVariant',
'fontWeight',
'format',
'from',
'fx',
'fy',
'g1',
'g2',
'glyphName',
'glyphOrientationHorizontal',
'glyphOrientationVertical',
'glyphRef',
'gradientTransform',
'gradientUnits',
'hanging',
'horizAdvX',
'horizOriginX',
'ideographic',
'imageRendering',
'in',
'in2',
'intercept',
'k',
'k1',
'k2',
'k3',
'k4',
'kernelMatrix',
'kernelUnitLength',
'kerning',
'keyPoints',
'keySplines',
'keyTimes',
'lengthAdjust',
'letterSpacing',
'lightingColor',
'limitingConeAngle',
'local',
'markerEnd',
'markerMid',
'markerStart',
'markerHeight',
'markerUnits',
'markerWidth',
'mask',
'maskContentUnits',
'maskUnits',
'mathematical',
'mode',
'numOctaves',
'offset',
'opacity',
'operator',
'order',
'orient',
'orientation',
'origin',
'overflow',
'overlinePosition',
'overlineThickness',
'paintOrder',
'panose1',
'pathLength',
'patternContentUnits',
'patternTransform',
'patternUnits',
'pointerEvents',
'points',
'pointsAtX',
'pointsAtY',
'pointsAtZ',
'preserveAlpha',
'preserveAspectRatio',
'primitiveUnits',
'r',
'radius',
'refX',
'refY',
'renderingIntent',
'repeatCount',
'repeatDur',
'requiredExtensions',
'requiredFeatures',
'restart',
'result',
'rotate',
'rx',
'ry',
'scale',
'seed',
'shapeRendering',
'slope',
'spacing',
'specularConstant',
'specularExponent',
'speed',
'spreadMethod',
'startOffset',
'stdDeviation',
'stemh',
'stemv',
'stitchTiles',
'stopColor',
'stopOpacity',
'strikethroughPosition',
'strikethroughThickness',
'string',
'stroke',
'strokeDasharray',
'strokeDashoffset',
'strokeLinecap',
'strokeLinejoin',
'strokeMiterlimit',
'strokeOpacity',
'strokeWidth',
'surfaceScale',
'systemLanguage',
'tableValues',
'targetX',
'targetY',
'textAnchor',
'textDecoration',
'textRendering',
'textLength',
'to',
'transform',
'u1',
'u2',
'underlinePosition',
'underlineThickness',
'unicode',
'unicodeBidi',
'unicodeRange',
'unitsPerEm',
'vAlphabetic',
'vHanging',
'vIdeographic',
'vMathematical',
'values',
'vectorEffect',
'version',
'vertAdvY',
'vertOriginX',
'vertOriginY',
'viewBox',
'viewTarget',
'visibility',
'widths',
'wordSpacing',
'writingMode',
'x',
'xHeight',
'x1',
'x2',
'xChannelSelector',
'xlinkActuate',
'xlinkArcrole',
'xlinkHref',
'xlinkRole',
'xlinkShow',
'xlinkTitle',
'xlinkType',
'xmlBase',
'xmlns',
'xmlnsXlink',
'xmlLang',
'xmlSpace',
'y',
'y1',
'y2',
'yChannelSelector',
'z',
'zoomAndPan',
]
const allAttrs = [];
const svgAttrs = [];
for (var key in latestAttrs) {
if (!latestAttrs.hasOwnProperty(key) && key !== 'svg') continue;
const obj = latestAttrs[key];
for (var prop in obj) {
// skip loop if the property is from prototype
if(!obj.hasOwnProperty(prop)) continue;
if (allAttrs.indexOf(obj[prop]) < 0) {
allAttrs.push(obj[prop])
}
}
}
latestAttrs.svg.forEach(prop => {
if (svgAttrs.indexOf(prop) < 0) {
svgAttrs.push(prop)
}
})
htmlProps.forEach(prop => {
if (allAttrs.indexOf(prop) < 0) {
console.log(`Missing HTML attr: ${prop}`)
}
})
svgProps.forEach(prop => {
if (svgAttrs.indexOf(prop) < 0) {
console.log(`Missing svg attr: ${prop}`)
}
})
acceptCharset
accessKey
allowFullScreen
allowTransparency
as
autoComplete
// autoFocus
autoPlay
capture
cellPadding
cellSpacing
charSet
classID
colSpan
contentEditable
contextMenu
crossOrigin
dateTime
encType
formAction
formEncType
formMethod
formNoValidate
formTarget
frameBorder
hrefLang
httpEquiv
inputMode
keyParams
keyType
marginHeight
marginWidth
maxLength
mediaGroup
minLength
noValidate
playsInline
radioGroup
readOnly
referrerPolicy
role
rowSpan
scoped
seamless
spellCheck
srcDoc
srcLang
srcSet
tabIndex
useMap
wmode
about
datatype
inlist
prefix
property
resource
typeof
vocab
autoSave
results
security
unselectable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment