-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CSSOM for style manipulations #566
Comments
BTW, no, adding 'unsafe-inline' is not a viable option. |
Unfortunately that’s not an option for us, a large portion of the styles have to be inline. Specifically, fixed columns, fixed headers and footers, and column widths all are accomplished with inline styles. VerticalCollection also achieves its occlusion through the use of inline styles (manipulating the height of occluded content). I realize the security concerns here, but I don’t think there is a way around this. If you know of a way to dynamically set values like |
You should be able to change it via JS yes? |
We actually are changing everything via JS, however we are setting them via I added a note to the MDN on this since it's not documented anywhere, event the CSP spec doesn't explicitly mention it (but it also doesn't explicitly disallow it). Will reopen this and rename, the styles are not optional but we need to use CSSOM to set them. |
Yes, that’s what I was referring to. Thank you! |
Currently we assign the style property directly when manipulating CSS. This is an XSS vector, and prevents security conscious users from using a CSP that prevents this type of manipulation. We can avoid it by assigning style properties directly on the `element.style` object, which filters the text safely (as per CSSOM). fixes #566
* [bugfix] Use CSSOM for style manipulations Currently we assign the style property directly when manipulating CSS. This is an XSS vector, and prevents security conscious users from using a CSP that prevents this type of manipulation. We can avoid it by assigning style properties directly on the `element.style` object, which filters the text safely (as per CSSOM). fixes #566 * fix prettier * fix api wrappers
Inline styling causes CSP violations and I'd much rather just put it in my CSS manually.
Additionally it would be nice to just be able to
@import
the styles in my CSS rather than do inline styles.The text was updated successfully, but these errors were encountered: