bug(Layout): createEmptyStyleRule not adding nonce correctly in Chrome #28780
Labels
area: cdk/layout
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
The style element that is created with the function createEmptyStyleRule does not have the CSP nonce when the site is serving in Chrome.
The nonce is added the following way:
mediaQueryStyleNode.nonce = nonce;
see hereBut it should be done this way I think:
mediaQueryStyleNode.addAttribute('nonce', nonce);
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-4szyku?file=src%2Findex.html
Steps to reproduce:
ngCspNonce="RANDOM_CSP_NONCE_PLACEHOLDER"
to theapp-root
component in index.htmlExpected Behavior
<style type="text/css" nonce="RANDOM_CSP_NONCE_PLACEHOLDER"></style>Actual Behavior
<style type="text/css"></style>Environment
The text was updated successfully, but these errors were encountered: