* This creates a string that is expected to be equivalent to the style * attribute generated by server-side rendering. It by-passes warnings and * security checks so it's not safe to use this value for anything other than * comparison. It is only used in DEV for SSR validation.
(styles)
| 14289 | * comparison. It is only used in DEV for SSR validation. |
| 14290 | */ |
| 14291 | function createDangerousStringForStyles(styles) { |
| 14292 | { |
| 14293 | var serialized = ''; |
| 14294 | var delimiter = ''; |
| 14295 | for (var styleName in styles) { |
| 14296 | if (!styles.hasOwnProperty(styleName)) { |
| 14297 | continue; |
| 14298 | } |
| 14299 | var styleValue = styles[styleName]; |
| 14300 | if (styleValue != null) { |
| 14301 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 14302 | serialized += delimiter + hyphenateStyleName(styleName) + ':'; |
| 14303 | serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); |
| 14304 | |
| 14305 | delimiter = ';'; |
| 14306 | } |
| 14307 | } |
| 14308 | return serialized || null; |
| 14309 | } |
| 14310 | } |
| 14311 | |
| 14312 | /** |
| 14313 | * Sets the value for multiple styles on a node. If a value is specified as |
no test coverage detected