@@ -30,9 +30,31 @@ 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' ,
36+ 'circle' ,
37+ 'ellipse' ,
38+ 'g' ,
39+ 'path' ,
40+ 'polygon' ,
41+ 'polyline' ,
42+ 'rect' ,
43+ 'svg' ,
44+ 'text' ,
45+ 'textPath' ,
46+ 'tref' ,
47+ 'tspan' ,
48+ // Animation final state
49+ 'animate' ,
50+ 'animateColor' ,
51+ 'animateMotion' ,
52+ 'animateTransform' ,
53+ 'set' ,
54+ ] ,
3455 property : [ 'meta' ] ,
3556 viewBox : [ 'svg' ] ,
57+ as : [ 'link' ] ,
3658} ;
3759
3860const SVGDOM_ATTRIBUTE_NAMES = {
@@ -127,7 +149,7 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
127149 // Element specific attributes
128150 // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
129151 // 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' ,
152+ 'accept' , 'action' , 'allow' , 'alt' , 'as' , ' async', 'buffered' , 'capture' , 'challenge' , 'cite' , 'code' , 'cols' ,
131153 'content' , 'coords' , 'csp' , 'data' , 'decoding' , 'default' , 'defer' , 'disabled' , 'form' ,
132154 'headers' , 'height' , 'high' , 'href' , 'icon' , 'importance' , 'integrity' , 'kind' , 'label' ,
133155 'language' , 'loading' , 'list' , 'loop' , 'low' , 'max' , 'media' , 'method' , 'min' , 'multiple' , 'muted' ,
@@ -168,7 +190,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
168190 'onCompositionUpdate' , 'onCut' , 'onDoubleClick' , 'onDrag' , 'onDragEnd' , 'onDragEnter' , 'onDragExit' , 'onDragLeave' ,
169191 'onError' , 'onFocus' , 'onInput' , 'onKeyDown' , 'onKeyPress' , 'onKeyUp' , 'onLoad' , 'onWheel' , 'onDragOver' ,
170192 'onDragStart' , 'onDrop' , 'onMouseDown' , 'onMouseEnter' , 'onMouseLeave' , 'onMouseMove' , 'onMouseOut' , 'onMouseOver' ,
171- 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onTransitionEnd' , 'radioGroup' , 'readOnly' , 'referrerPolicy' ,
193+ 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onToggle' , ' onTransitionEnd', 'radioGroup' , 'readOnly' , 'referrerPolicy' ,
172194 'rowSpan' , 'srcDoc' , 'srcLang' , 'srcSet' , 'useMap' ,
173195 // SVG attributes
174196 // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -226,11 +248,28 @@ const ARIA_PROPERTIES = [
226248 'aria-posinset' , 'aria-rowcount' , 'aria-rowindex' , 'aria-rowindextext' , 'aria-rowspan' , 'aria-setsize' ,
227249] ;
228250
251+ const REACT_ON_PROPS = [
252+ 'onGotPointerCapture' ,
253+ 'onLostPointerCapture' ,
254+ 'onPointerCancel' ,
255+ 'onPointerDown' ,
256+ 'onPointerEnter' ,
257+ 'onPointerLeave' ,
258+ 'onPointerMove' ,
259+ 'onPointerOut' ,
260+ 'onPointerOver' ,
261+ 'onPointerUp' ,
262+ ] ;
263+
229264function getDOMPropertyNames ( context ) {
230265 const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
231266 // this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
232267 if ( ! testReactVersion ( context , '>= 16.1.0' ) ) {
233- return [ 'allowTransparency' ] . concat ( ALL_DOM_PROPERTY_NAMES ) ;
268+ return ALL_DOM_PROPERTY_NAMES . concat ( 'allowTransparency' ) ;
269+ }
270+ // 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
271+ if ( testReactVersion ( context , '>= 16.4.0' ) ) {
272+ return ALL_DOM_PROPERTY_NAMES . concat ( REACT_ON_PROPS ) ;
234273 }
235274 return ALL_DOM_PROPERTY_NAMES ;
236275}
0 commit comments