* 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)
| 14317 | * @param {object} styles |
| 14318 | */ |
| 14319 | function setValueForStyles(node, styles, getStack) { |
| 14320 | var style = node.style; |
| 14321 | for (var styleName in styles) { |
| 14322 | if (!styles.hasOwnProperty(styleName)) { |
| 14323 | continue; |
| 14324 | } |
| 14325 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 14326 | { |
| 14327 | if (!isCustomProperty) { |
| 14328 | warnValidStyle$1(styleName, styles[styleName], getStack); |
| 14329 | } |
| 14330 | } |
| 14331 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); |
| 14332 | if (styleName === 'float') { |
| 14333 | styleName = 'cssFloat'; |
| 14334 | } |
| 14335 | if (isCustomProperty) { |
| 14336 | style.setProperty(styleName, styleValue); |
| 14337 | } else { |
| 14338 | style[styleName] = styleValue; |
| 14339 | } |
| 14340 | } |
| 14341 | } |
| 14342 | |
| 14343 | // For HTML, certain tags should omit their close tag. We keep a whitelist for |
| 14344 | // those special-case tags. |
no test coverage detected