Skip to content
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

fix: update tooltip positioning for CSP #714

Merged
merged 2 commits into from
Nov 18, 2022
Merged

Conversation

mayagbarnes
Copy link
Contributor

@mayagbarnes mayagbarnes commented Nov 14, 2022

For sites with Content Security Policies that do not feature the unsafe-inline specification, it seems the more preferable approach for tooltip positioning is using the CSS Object Model method .style.

Currently, vega-tooltip uses setAttribute to adjust the tooltip positioning (top & left) at the same time - here. This invokes the HTML parser and CSP inline checks are triggered, blocking the operation. When the tooltip positioning is directly adjusted via .style.top & .style.left, the operations successfully comply with a CSP directive of style-src: self.

Some discussion/context here

@mayagbarnes mayagbarnes marked this pull request as ready for review November 14, 2022 06:40
@domoritz
Copy link
Member

Thank you. Looks great.

src/Handler.ts Outdated Show resolved Hide resolved
@domoritz domoritz changed the title Update tooltip positioning for CSP fix: update tooltip positioning for CSP Nov 18, 2022
@domoritz domoritz enabled auto-merge (squash) November 18, 2022 22:35
@domoritz domoritz merged commit f551864 into vega:next Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants