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 CSP error in MdProgressSpinner #1850

Merged
merged 4 commits into from
Jul 13, 2018
Merged

Fix CSP error in MdProgressSpinner #1850

merged 4 commits into from
Jul 13, 2018

Conversation

ldursw
Copy link
Contributor

@ldursw ldursw commented Jul 8, 2018

The current release injects a <style> tag into the page with the animation CSS for the spinner. In pages that have a restrictive CSP (i.e., without 'unsafe-inline') an error is shown in the DevTools console and the spinner becomes a solid ring.

This PR removes the style injection by using CSS variables instead.

@Samuell1
Copy link
Member

Samuell1 commented Jul 9, 2018

Hey, thanks for PR!

Does this work for all latest browsers?

@ldursw
Copy link
Contributor Author

ldursw commented Jul 9, 2018

Yes, it does. I've tested in Chrome 67, Firefox 61, Edge 17, and Opera 54. I haven't tested in Firefox before, the latest commit fixes some issues.


MdProgressSpinner.diameters.add(this.mdDiameter)
attachCircleStyle () {
const circle = this.$el.getElementsByClassName('md-progress-spinner-circle')[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be this changed to $refs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

@Samuell1 Samuell1 merged commit 96d3d8d into vuematerial:dev Jul 13, 2018
marcosmoura added a commit that referenced this pull request May 11, 2019
* origin: (55 commits)
  fix(MdSvgLoader): svg loader for invalid / missing mimetype (#1942)
  docs(Icon): fix minor typo (#1973)
  fix(MdRouterLink): new router-link registration name (#1978)
  chore: apply discord vanity URL (#1927)
  docs(ROADMAP.md): replace dead slack invite link with discord invite link (#1924)
  docs(Table): fix grammar issues (#1902)
  feat: router link components improvements (#1651)
  fix(MdTable): recalculate fixed header width on data changes (#1877)
  fix(MdDialogContent): missing theme class (#1876)
  docs(Elevation and Layout): Typos fixed and improved documentation. (#1878)
  fix(MdTable): nextTick selection data (#1874)
  docs(BottomBar): fix typo (#1875)
  docs(MdButton): escape a tag (#1872)
  docs(Input): typos and correction
  chore: upgrade dependencies
  fix(MdField): remove firefox required box-shadow
  feat: disable complexity rules for some methods
  fix(MdProgressSpinner): fix CSP error (#1850)
  fix: MdBadge do not accept color #1854 issue (#1856)
  fix: fix the repeated generated css theme classes if there is multiple themes defined (#1784)
  ...
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.

3 participants