File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,29 @@ var HTMLDOMPropertyConfig = {
154
154
spellCheck : 'spellcheck' ,
155
155
srcDoc : 'srcdoc' ,
156
156
srcSet : 'srcset'
157
+ } ,
158
+ DOMMutationMethods : {
159
+ /**
160
+ * Setting `className` to null may cause it to be set to the string "null".
161
+ *
162
+ * @param {DOMElement } node
163
+ * @param {* } value
164
+ */
165
+ className : function ( node , value ) {
166
+ // The className property of SVG elements is not a string but an
167
+ // "SVGAnimatedString" object and can't be written directly.
168
+ // if the property is a string, we write the property.
169
+ if ( typeof node . className === 'string' ) {
170
+ node . className = value != null ? value : '' ;
171
+ } else {
172
+ // If not, fall back to using setAttribute.
173
+ if ( value != null ) {
174
+ node . setAttribute ( 'class' , value ) ;
175
+ } else {
176
+ node . removeAttribute ( 'class' ) ;
177
+ }
178
+ }
179
+ }
157
180
}
158
181
} ;
159
182
You can’t perform that action at this time.
0 commit comments