* 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)
| 15222 | * @param {object} styles |
| 15223 | */ |
| 15224 | function setValueForStyles(node, styles, getStack) { |
| 15225 | var style = node.style; |
| 15226 | for (var styleName in styles) { |
| 15227 | if (!styles.hasOwnProperty(styleName)) { |
| 15228 | continue; |
| 15229 | } |
| 15230 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 15231 | { |
| 15232 | if (!isCustomProperty) { |
| 15233 | warnValidStyle$1(styleName, styles[styleName], getStack); |
| 15234 | } |
| 15235 | } |
| 15236 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); |
| 15237 | if (styleName === 'float') { |
| 15238 | styleName = 'cssFloat'; |
| 15239 | } |
| 15240 | if (isCustomProperty) { |
| 15241 | style.setProperty(styleName, styleValue); |
| 15242 | } else { |
| 15243 | style[styleName] = styleValue; |
| 15244 | } |
| 15245 | } |
| 15246 | } |
| 15247 | |
| 15248 | // For HTML, certain tags should omit their close tag. We keep a whitelist for |
| 15249 | // those special-case tags. |
no test coverage detected