Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/browser/ui/dom/DefaultDOMPropertyConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,29 @@ var DefaultDOMPropertyConfig = {
spellCheck: 'spellcheck',
srcDoc: 'srcdoc',
srcSet: 'srcset'
},
DOMMutationMethods: {
/**
* Setting `className` to null may cause it to be set to the string "null".
*
* @param {DOMElement} node
* @param {*} value
*/
className: function (node, value) {
// The className property of SVG elements is not a string but an
// "SVGAnimatedString" object and can't be written directly.
// if the property is a string, we write the property.
if (typeof node.className === 'string') {
node.className = value != null ? value : '';
} else {
// If not, fall back to using setAttribute.
if (value != null) {
node.setAttribute('class', value);
} else {
node.removeAttribute('class');
}
}
}
}
};

Expand Down