@@ -30,9 +30,16 @@ const ATTRIBUTE_TAGS_MAP = {
3030 checked : [ 'input' ] ,
3131 // image is required for SVG support, all other tags are HTML.
3232 crossOrigin : [ 'script' , 'img' , 'video' , 'audio' , 'link' , 'image' ] ,
33- fill : [ 'svg' ] ,
33+ fill : [ // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill
34+ // Fill color
35+ 'altGlyph' , 'circle' , 'ellipse' , 'path' , 'polygon' , 'polyline' , 'rect' , 'text' , 'textPath' , 'tref' ,
36+ 'tspan' , 'svg' ,
37+ // Animation final state
38+ 'animate' , 'animateColor' , 'animateMotion' , 'animateTransform' , 'set' ,
39+ ] ,
3440 property : [ 'meta' ] ,
3541 viewBox : [ 'svg' ] ,
42+ as : [ 'link' ] ,
3643} ;
3744
3845const SVGDOM_ATTRIBUTE_NAMES = {
@@ -127,7 +134,7 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
127134 // Element specific attributes
128135 // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
129136 // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
130- 'accept' , 'action' , 'allow' , 'alt' , 'async' , 'buffered' , 'capture' , 'challenge' , 'cite' , 'code' , 'cols' ,
137+ 'accept' , 'action' , 'allow' , 'alt' , 'as' , ' async', 'buffered' , 'capture' , 'challenge' , 'cite' , 'code' , 'cols' ,
131138 'content' , 'coords' , 'csp' , 'data' , 'decoding' , 'default' , 'defer' , 'disabled' , 'form' ,
132139 'headers' , 'height' , 'high' , 'href' , 'icon' , 'importance' , 'integrity' , 'kind' , 'label' ,
133140 'language' , 'loading' , 'list' , 'loop' , 'low' , 'max' , 'media' , 'method' , 'min' , 'multiple' , 'muted' ,
@@ -168,7 +175,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
168175 'onCompositionUpdate' , 'onCut' , 'onDoubleClick' , 'onDrag' , 'onDragEnd' , 'onDragEnter' , 'onDragExit' , 'onDragLeave' ,
169176 'onError' , 'onFocus' , 'onInput' , 'onKeyDown' , 'onKeyPress' , 'onKeyUp' , 'onLoad' , 'onWheel' , 'onDragOver' ,
170177 'onDragStart' , 'onDrop' , 'onMouseDown' , 'onMouseEnter' , 'onMouseLeave' , 'onMouseMove' , 'onMouseOut' , 'onMouseOver' ,
171- 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onTransitionEnd' , 'radioGroup' , 'readOnly' , 'referrerPolicy' ,
178+ 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onToggle' , ' onTransitionEnd', 'radioGroup' , 'readOnly' , 'referrerPolicy' ,
172179 'rowSpan' , 'srcDoc' , 'srcLang' , 'srcSet' , 'useMap' ,
173180 // SVG attributes
174181 // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -230,7 +237,12 @@ function getDOMPropertyNames(context) {
230237 const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
231238 // this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
232239 if ( ! testReactVersion ( context , '>= 16.1.0' ) ) {
233- return [ 'allowTransparency' ] . concat ( ALL_DOM_PROPERTY_NAMES ) ;
240+ return ALL_DOM_PROPERTY_NAMES . concat ( [ 'allowTransparency' ] ) ;
241+ }
242+ // these were added in React v16.4.0, see https://reactjs.org/blog/2018/05/23/react-v-16-4.html and https://github.com/facebook/react/pull/12507
243+ if ( testReactVersion ( context , '>= 16.4.0' ) ) {
244+ return ALL_DOM_PROPERTY_NAMES . concat ( [ 'onPointerDown' , 'onPointerMove' , 'onPointerUp' , 'onPointerCancel' , 'onGotPointerCapture' , 'onLostPointerCapture' ,
245+ 'onPointerEnter' , 'onPointerLeave' , 'onPointerOver' , 'onPointerOut' ] ) ;
234246 }
235247 return ALL_DOM_PROPERTY_NAMES ;
236248}
0 commit comments