Skip to content

Commit

Permalink
fix(dom): add missing DOM props to domProps
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbonnet committed Mar 4, 2019
1 parent 8af5ecf commit 333f8aa
Showing 1 changed file with 203 additions and 124 deletions.
327 changes: 203 additions & 124 deletions src/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,136 +11,215 @@ import { hasProp, setWrapperName, getGlobal } from './tools'
import { EMPTY_OBJECT } from './immutables'

const PROP_NAMES = {
accept: null,
acceptCharset: null,
accessKey: null,
action: null,
allowFullScreen: null,
alt: null,
async: null,
autoComplete: null,
autoFocus: null,
autoPlay: null,
capture: null,
cellPadding: null,
cellSpacing: null,
challenge: null,
charSet: null,
checked: null,
cite: null,
classID: null,
className: null,
colSpan: null,
cols: null,
content: null,
contentEditable: null,
contextMenu: null,
controls: null,
controlsList: null,
coords: null,
crossOrigin: null,
data: null,
dateTime: null,
default: null,
defer: null,
dir: null,
disabled: null,
download: null,
draggable: null,
encType: null,
form: null,
formAction: null,
formEncType: null,
formMethod: null,
formNoValidate: null,
formTarget: null,
frameBorder: null,
headers: null,
height: null,
hidden: null,
high: null,
href: null,
hrefLang: null,
htmlFor: null,
httpEquiv: null,
icon: null,
id: null,
inputMode: null,
integrity: null,
is: null,
keyParams: null,
keyType: null,
kind: null,
label: null,
lang: null,
list: null,
loop: null,
low: null,
manifest: null,
marginHeight: null,
marginWidth: null,
max: null,
maxLength: null,
media: null,
mediaGroup: null,
method: null,
min: null,
minLength: null,
multiple: null,
muted: null,
name: null,
noValidate: null,
nonce: null,
open: null,
optimum: null,
pattern: null,
placeholder: null,
poster: null,
preload: null,
profile: null,
radioGroup: null,
readOnly: null,
rel: null,
required: null,
reversed: null,
role: null,
rowSpan: null,
rows: null,
sandbox: null,
scope: null,
scoped: null,
scrolling: null,
seamless: null,
selected: null,
shape: null,
size: null,
sizes: null,
span: null,
spellCheck: null,
src: null,
srcDoc: null,
srcLang: null,
srcSet: null,
start: null,
step: null,
style: null,
summary: null,
tabIndex: null,
target: null,
title: null,
type: null,
useMap: null,
value: null,
width: null,
wmode: null,
wrap: null,
accept: true,
acceptCharset: true,
accessKey: true,
action: true,
allowFullScreen: true,
alt: true,
async: true,
autoComplete: true,
autoFocus: true,
autoPlay: true,
capture: true,
cellPadding: true,
cellSpacing: true,
challenge: true,
charSet: true,
checked: true,
cite: true,
classID: true,
className: true,
cols: true,
colSpan: true,
content: true,
contentEditable: true,
contextMenu: true,
controls: true,
controlsList: true,
coords: true,
crossOrigin: true,
data: true,
dateTime: true,
default: true,
defer: true,
dir: true,
disabled: true,
download: true,
draggable: true,
encType: true,
form: true,
formAction: true,
formEncType: true,
formMethod: true,
formNoValidate: true,
formTarget: true,
frameBorder: true,
headers: true,
height: true,
hidden: true,
high: true,
href: true,
hrefLang: true,
htmlFor: true,
httpEquiv: true,
icon: true,
id: true,
inputMode: true,
integrity: true,
is: true,
keyParams: true,
keyType: true,
kind: true,
label: true,
lang: true,
list: true,
loop: true,
low: true,
manifest: true,
marginHeight: true,
marginWidth: true,
max: true,
maxLength: true,
media: true,
mediaGroup: true,
method: true,
min: true,
minLength: true,
multiple: true,
muted: true,
name: true,
nonce: true,
noValidate: true,
onAbort: true,
onAnimationEnd: true,
onAnimationIteration: true,
onAnimationStart: true,
onBlur: true,
onCanPlay: true,
onCanPlayThrough: true,
onChange: true,
onClick: true,
onCompositionEnd: true,
onCompositionStart: true,
onCompositionUpdate: true,
onContextMenu: true,
onCopy: true,
onCut: true,
onDoubleClick: true,
onDrag: true,
onDragEnd: true,
onDragEnter: true,
onDragExit: true,
onDragLeave: true,
onDragOver: true,
onDragStart: true,
onDrop: true,
onDurationChange: true,
onEmptied: true,
onEncrypted: true,
onEnded: true,
onError: true,
onFocus: true,
onGotPointerCapture: true,
onInput: true,
onInvalid: true,
onKeyDown: true,
onKeyPress: true,
onKeyUp: true,
onLoad: true,
onLoadedData: true,
onLoadedMetadata: true,
onLoadStart: true,
onLostPointerCapture: true,
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOut: true,
onMouseOver: true,
onMouseUp: true,
onPaste: true,
onPause: true,
onPlay: true,
onPlaying: true,
onPointerCancel: true,
onPointerDown: true,
onPointerEnter: true,
onPointerLeave: true,
onPointerMove: true,
onPointerOut: true,
onPointerOver: true,
onPointerUp: true,
onProgress: true,
onRateChange: true,
onScroll: true,
onSeeked: true,
onSeeking: true,
onSelect: true,
onStalled: true,
onSubmit: true,
onSuspend: true,
onTimeUpdate: true,
onToggle: true,
onTouchCancel: true,
onTouchEnd: true,
onTouchMove: true,
onTouchStart: true,
onTransitionEnd: true,
onVolumeChange: true,
onWaiting: true,
onWheel: true,
open: true,
optimum: true,
pattern: true,
placeholder: true,
poster: true,
preload: true,
profile: true,
radioGroup: true,
readOnly: true,
rel: true,
required: true,
reversed: true,
role: true,
rows: true,
rowSpan: true,
sandbox: true,
scope: true,
scoped: true,
scrolling: true,
seamless: true,
selected: true,
shape: true,
size: true,
sizes: true,
span: true,
spellCheck: true,
src: true,
srcDoc: true,
srcLang: true,
srcSet: true,
start: true,
step: true,
style: true,
summary: true,
tabIndex: true,
target: true,
title: true,
type: true,
useMap: true,
value: true,
width: true,
wmode: true,
wrap: true,
}

/*
Only keeps DOM properties.
*/
export const domProps = mapProps((props) =>
pickBy(props, (value, name) => name in PROP_NAMES),
pickBy(props, (value, name) => PROP_NAMES[name] === true),
)

class Refresher {
Expand Down

0 comments on commit 333f8aa

Please sign in to comment.