File tree 1 file changed +5
-0
lines changed 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,11 @@ export function get_root_for_style(node: Node): ShadowRoot | Document {
155
155
}
156
156
157
157
export function append_stylesheet ( node : ShadowRoot | Document , style : HTMLStyleElement ) {
158
+ // For transitions to work without 'style-src: unsafe-inline' Content Security Policy,
159
+ // these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.
160
+ // Using the hash for the empty string (for an empty tag) works in all browsers except Safari.
161
+ // So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.
162
+ // The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.
158
163
style . textContent = style . textContent || '/* empty */' ;
159
164
append ( ( node as Document ) . head || node , style ) ;
160
165
return style . sheet as CSSStyleSheet ;
You can’t perform that action at this time.
0 commit comments