* 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)
| 15056 | * comparison. It is only used in DEV for SSR validation. |
| 15057 | */ |
| 15058 | function createDangerousStringForStyles(styles) { |
| 15059 | { |
| 15060 | var serialized = ''; |
| 15061 | var delimiter = ''; |
| 15062 | for (var styleName in styles) { |
| 15063 | if (!styles.hasOwnProperty(styleName)) { |
| 15064 | continue; |
| 15065 | } |
| 15066 | var styleValue = styles[styleName]; |
| 15067 | if (styleValue != null) { |
| 15068 | var isCustomProperty = styleName.indexOf('--') === 0; |
| 15069 | serialized += delimiter + hyphenateStyleName(styleName) + ':'; |
| 15070 | serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); |
| 15071 | |
| 15072 | delimiter = ';'; |
| 15073 | } |
| 15074 | } |
| 15075 | return serialized || null; |
| 15076 | } |
| 15077 | } |
| 15078 | |
| 15079 | /** |
| 15080 | * Sets the value for multiple styles on a node. If a value is specified as |
no test coverage detected