@@ -116,23 +116,47 @@ const SVGDOM_ATTRIBUTE_NAMES = {
116
116
'xml:space' : 'xmlSpace' ,
117
117
} ;
118
118
119
- const DOM_PROPERTY_NAMES = [
120
- // Standard
121
- 'acceptCharset' , 'accessKey' , 'allowFullScreen' , 'autoComplete' , 'autoFocus' , 'autoPlay' ,
122
- 'cellPadding' , 'cellSpacing' , 'classID' , 'className' , 'colSpan' , 'contentEditable' , 'contextMenu' ,
123
- 'dateTime' , 'encType' , 'formAction' , 'formEncType' , 'formMethod' , 'formNoValidate' , 'formTarget' ,
124
- 'frameBorder' , 'hrefLang' , 'htmlFor' , 'httpEquiv' , 'inputMode' , 'keyParams' , 'keyType' , 'marginHeight' , 'marginWidth' ,
119
+ const DOM_PROPERTY_NAMES_ONE_WORD = [
120
+ // Global attributes - can be used on any HTML/DOM element
121
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
122
+ 'dir' , 'draggable' , 'hidden' , 'id' , 'lang' , 'nonce' , 'part' , 'slot' , 'style' , 'title' , 'translate' ,
123
+ // Element specific attributes
124
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
125
+ // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
126
+ 'accept' , 'action' , 'allow' , 'alt' , 'async' , 'buffered' , 'capture' , 'challenge' , 'cite' , 'code' , 'cols' ,
127
+ 'content' , 'coords' , 'csp' , 'data' , 'decoding' , 'default' , 'defer' , 'disabled' , 'form' ,
128
+ 'headers' , 'height' , 'high' , 'href' , 'icon' , 'importance' , 'integrity' , 'kind' , 'label' ,
129
+ 'language' , 'loading' , 'list' , 'loop' , 'low' , 'max' , 'media' , 'method' , 'min' , 'multiple' , 'muted' ,
130
+ 'name' , 'open' , 'optimum' , 'pattern' , 'ping' , 'placeholder' , 'poster' , 'preload' , 'profile' ,
131
+ 'rel' , 'required' , 'reversed' , 'role' , 'rows' , 'sandbox' , 'scope' , 'selected' , 'shape' , 'size' , 'sizes' ,
132
+ 'span' , 'src' , 'start' , 'step' , 'target' , 'type' , 'value' , 'width' , 'wrap' ,
133
+ // React specific attributes
134
+ 'ref' ,
135
+ ] ;
136
+
137
+ const DOM_PROPERTY_NAMES_TWO_WORDS = [
138
+ // Global attributes - can be used on any HTML/DOM element
139
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
140
+ 'accessKey' , 'autoCapitalize' , 'autoFocus' , 'contentEditable' , 'enterKeyHint' , 'exportParts' ,
141
+ 'inputMode' , 'itemID' , 'itemRef' , 'itemProp' , 'itemScope' , 'itemType' , 'spellCheck' , 'tabIndex' ,
142
+ // Element specific attributes
143
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
144
+ // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
145
+ 'acceptCharset' , 'allowFullScreen' , 'autoComplete' , 'autoPlay' , 'cellPadding' , 'cellSpacing' , 'classID' , 'codeBase' ,
146
+ 'colSpan' , 'contextMenu' , 'dateTime' , 'encType' , 'formAction' , 'formEncType' , 'formMethod' , 'formNoValidate' , 'formTarget' ,
147
+ 'frameBorder' , 'hrefLang' , 'httpEquiv' , 'isMap' , 'keyParams' , 'keyType' , 'marginHeight' , 'marginWidth' ,
125
148
'maxLength' , 'mediaGroup' , 'minLength' , 'noValidate' , 'onAnimationEnd' , 'onAnimationIteration' , 'onAnimationStart' ,
126
149
'onBlur' , 'onChange' , 'onClick' , 'onContextMenu' , 'onCopy' , 'onCompositionEnd' , 'onCompositionStart' ,
127
150
'onCompositionUpdate' , 'onCut' , 'onDoubleClick' , 'onDrag' , 'onDragEnd' , 'onDragEnter' , 'onDragExit' , 'onDragLeave' ,
128
151
'onError' , 'onFocus' , 'onInput' , 'onKeyDown' , 'onKeyPress' , 'onKeyUp' , 'onLoad' , 'onWheel' , 'onDragOver' ,
129
152
'onDragStart' , 'onDrop' , 'onMouseDown' , 'onMouseEnter' , 'onMouseLeave' , 'onMouseMove' , 'onMouseOut' , 'onMouseOver' ,
130
- 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onTransitionEnd' , 'radioGroup' , 'readOnly' , 'rowSpan' ,
131
- 'spellCheck' , 'srcDoc' , 'srcLang' , 'srcSet' , 'tabIndex' , 'useMap' ,
132
- // Non standard
133
- 'autoCapitalize' , 'autoCorrect' ,
134
- 'autoSave' ,
135
- 'itemProp' , 'itemScope' , 'itemType' , 'itemRef' , 'itemID' ,
153
+ 'onMouseUp' , 'onPaste' , 'onScroll' , 'onSelect' , 'onSubmit' , 'onTransitionEnd' , 'radioGroup' , 'readOnly' , 'referrerPolicy' ,
154
+ 'rowSpan' , 'srcDoc' , 'srcLang' , 'srcSet' , 'useMap' ,
155
+ // Safari/Apple specific, no listing available
156
+ 'autoCorrect' , // https://stackoverflow.com/questions/47985384/html-autocorrect-for-text-input-is-not-working
157
+ 'autoSave' , // https://stackoverflow.com/questions/25456396/what-is-autosave-attribute-supposed-to-do-how-do-i-use-it
158
+ // React specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes
159
+ 'className' , 'dangerouslySetInnerHTML' , 'defaultValue' , 'htmlFor' , 'onChange' , 'suppressContentEditableWarning' , 'suppressHydrationWarning' ,
136
160
] ;
137
161
138
162
const DOM_PROPERTIES_IGNORE_CASE = [ 'charset' ] ;
@@ -155,11 +179,12 @@ const ARIA_PROPERTIES = [
155
179
] ;
156
180
157
181
function getDOMPropertyNames ( context ) {
182
+ const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
158
183
// this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
159
184
if ( ! testReactVersion ( context , '>= 16.1.0' ) ) {
160
- return [ 'allowTransparency' ] . concat ( DOM_PROPERTY_NAMES ) ;
185
+ return [ 'allowTransparency' ] . concat ( ALL_DOM_PROPERTY_NAMES ) ;
161
186
}
162
- return DOM_PROPERTY_NAMES ;
187
+ return ALL_DOM_PROPERTY_NAMES ;
163
188
}
164
189
165
190
// ------------------------------------------------------------------------------
0 commit comments