* Sets the value for multiple styles on a node. If a value is specified as * '' (empty string), the corresponding style property will be unset. * * @param {DOMElement} node * @param {object} styles
(node, styles, getStack)
| 15084 | * @param {object} styles |
| 15085 | */ |
| 15086 | function setValueForStyles(node, styles, getStack) { |
| 15087 | var style = node.style; |
| 15088 | for (var styleName in styles) { |
| 15089 | if (!styles.hasOwnProperty(styleName)) { |
| 15090 | continue; |
| 15091 | } |
| 15092 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 15093 | { |
| 15094 | if (!isCustomProperty) { |
| 15095 | warnValidStyle$1(styleName, styles[styleName], getStack); |
| 15096 | } |
| 15097 | } |
| 15098 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); |
| 15099 | if (styleName === 'float') { |
| 15100 | styleName = 'cssFloat'; |
| 15101 | } |
| 15102 | if (isCustomProperty) { |
| 15103 | style.setProperty(styleName, styleValue); |
| 15104 | } else { |
| 15105 | style[styleName] = styleValue; |
| 15106 | } |
| 15107 | } |
| 15108 | } |
| 15109 | |
| 15110 | // For HTML, certain tags should omit their close tag. We keep a whitelist for |
| 15111 | // those special-case tags. |
no test coverage detected