* 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)
| 15177 | * @param {object} styles |
| 15178 | */ |
| 15179 | function setValueForStyles(node, styles, getStack) { |
| 15180 | var style = node.style; |
| 15181 | for (var styleName in styles) { |
| 15182 | if (!styles.hasOwnProperty(styleName)) { |
| 15183 | continue; |
| 15184 | } |
| 15185 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 15186 | { |
| 15187 | if (!isCustomProperty) { |
| 15188 | warnValidStyle$1(styleName, styles[styleName], getStack); |
| 15189 | } |
| 15190 | } |
| 15191 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); |
| 15192 | if (styleName === 'float') { |
| 15193 | styleName = 'cssFloat'; |
| 15194 | } |
| 15195 | if (isCustomProperty) { |
| 15196 | style.setProperty(styleName, styleValue); |
| 15197 | } else { |
| 15198 | style[styleName] = styleValue; |
| 15199 | } |
| 15200 | } |
| 15201 | } |
| 15202 | |
| 15203 | // For HTML, certain tags should omit their close tag. We keep a whitelist for |
| 15204 | // those special-case tags. |
no test coverage detected