* 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)
| 14445 | * @param {object} styles |
| 14446 | */ |
| 14447 | function setValueForStyles(node, styles, getStack) { |
| 14448 | var style = node.style; |
| 14449 | for (var styleName in styles) { |
| 14450 | if (!styles.hasOwnProperty(styleName)) { |
| 14451 | continue; |
| 14452 | } |
| 14453 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 14454 | { |
| 14455 | if (!isCustomProperty) { |
| 14456 | warnValidStyle$1(styleName, styles[styleName], getStack); |
| 14457 | } |
| 14458 | } |
| 14459 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); |
| 14460 | if (styleName === 'float') { |
| 14461 | styleName = 'cssFloat'; |
| 14462 | } |
| 14463 | if (isCustomProperty) { |
| 14464 | style.setProperty(styleName, styleValue); |
| 14465 | } else { |
| 14466 | style[styleName] = styleValue; |
| 14467 | } |
| 14468 | } |
| 14469 | } |
| 14470 | |
| 14471 | // For HTML, certain tags should omit their close tag. We keep a whitelist for |
| 14472 | // those special-case tags. |
no test coverage detected