@@ -30,9 +30,31 @@ const ATTRIBUTE_TAGS_MAP = {
30
30
checked : [ 'input' ] ,
31
31
// image is required for SVG support, all other tags are HTML.
32
32
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
+ ] ,
34
55
property : [ 'meta' ] ,
35
56
viewBox : [ 'svg' ] ,
57
+ as : [ 'link' ] ,
36
58
} ;
37
59
38
60
const SVGDOM_ATTRIBUTE_NAMES = {
@@ -127,7 +149,7 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
127
149
// Element specific attributes
128
150
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
129
151
// 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' ,
131
153
'content' , 'coords' , 'csp' , 'data' , 'decoding' , 'default' , 'defer' , 'disabled' , 'form' ,
132
154
'headers' , 'height' , 'high' , 'href' , 'icon' , 'importance' , 'integrity' , 'kind' , 'label' ,
133
155
'language' , 'loading' , 'list' , 'loop' , 'low' , 'max' , 'media' , 'method' , 'min' , 'multiple' , 'muted' ,
@@ -168,7 +190,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
168
190
'onCompositionUpdate' , 'onCut' , 'onDoubleClick' , 'onDrag' , 'onDragEnd' , 'onDragEnter' , 'onDragExit' , 'onDragLeave' ,
169
191
'onError' , 'onFocus' , 'onInput' , 'onKeyDown' , 'onKeyPress' , 'onKeyUp' , 'onLoad' , 'onWheel' , 'onDragOver' ,
170
192
'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' ,
172
194
'rowSpan' , 'srcDoc' , 'srcLang' , 'srcSet' , 'useMap' ,
173
195
// SVG attributes
174
196
// See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -226,11 +248,28 @@ const ARIA_PROPERTIES = [
226
248
'aria-posinset' , 'aria-rowcount' , 'aria-rowindex' , 'aria-rowindextext' , 'aria-rowspan' , 'aria-setsize' ,
227
249
] ;
228
250
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
+
229
264
function getDOMPropertyNames ( context ) {
230
265
const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
231
266
// this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
232
267
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 ) ;
234
273
}
235
274
return ALL_DOM_PROPERTY_NAMES ;
236
275
}
0 commit comments