@@ -30,9 +30,16 @@ 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' , 'circle' , 'ellipse' , 'path' , 'polygon' , 'polyline' , 'rect' , 'text' , 'textPath' , 'tref' ,
36
+ 'tspan' , 'svg' ,
37
+ // Animation final state
38
+ 'animate' , 'animateColor' , 'animateMotion' , 'animateTransform' , 'set' ,
39
+ ] ,
34
40
property : [ 'meta' ] ,
35
41
viewBox : [ 'svg' ] ,
42
+ as : [ 'link' ] ,
36
43
} ;
37
44
38
45
const SVGDOM_ATTRIBUTE_NAMES = {
@@ -127,7 +134,7 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
127
134
// Element specific attributes
128
135
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
129
136
// 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' ,
131
138
'content' , 'coords' , 'csp' , 'data' , 'decoding' , 'default' , 'defer' , 'disabled' , 'form' ,
132
139
'headers' , 'height' , 'high' , 'href' , 'icon' , 'importance' , 'integrity' , 'kind' , 'label' ,
133
140
'language' , 'loading' , 'list' , 'loop' , 'low' , 'max' , 'media' , 'method' , 'min' , 'multiple' , 'muted' ,
@@ -168,7 +175,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
168
175
'onCompositionUpdate' , 'onCut' , 'onDoubleClick' , 'onDrag' , 'onDragEnd' , 'onDragEnter' , 'onDragExit' , 'onDragLeave' ,
169
176
'onError' , 'onFocus' , 'onInput' , 'onKeyDown' , 'onKeyPress' , 'onKeyUp' , 'onLoad' , 'onWheel' , 'onDragOver' ,
170
177
'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' ,
172
179
'rowSpan' , 'srcDoc' , 'srcLang' , 'srcSet' , 'useMap' ,
173
180
// SVG attributes
174
181
// See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -230,7 +237,12 @@ function getDOMPropertyNames(context) {
230
237
const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
231
238
// this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
232
239
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' ] ) ;
234
246
}
235
247
return ALL_DOM_PROPERTY_NAMES ;
236
248
}
0 commit comments