Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

md-icon: svg <clipPath> no longer works #7467

Closed
mpiasta-ca opened this issue Mar 8, 2016 · 2 comments
Closed

md-icon: svg <clipPath> no longer works #7467

mpiasta-ca opened this issue Mar 8, 2016 · 2 comments
Assignees
Labels
needs: manual testing This issue or PR needs to have some manual testing and verification done P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review
Milestone

Comments

@mpiasta-ca
Copy link

After the commit 810c4f3, any svg with <clipPath id="..."> fails to render the clipPath, because line 433 @ "src/components/icon/js/iconService.js" removes all svg child id, but this id is required for clipPath to work.

Created after issue report: #7381

I tested with the change from 810c4f3, and here is screenshot to show the breaking change. In this example, the five square svg icons are actually supposed to appear as circles (the only reason the "Canada" icon works is because it doesn't use a clipPath).

clip-path-id-issue

Potential solution: instead of removing ID from the svg's child elements, need to prefix a random string to all child element id's at render (not at caching). If done at caching, issue 7381 will still persist (svg breaks when the icon is rendered more than once, because IDs are no longer unique [Firefox, IE]). So best to attach this random prefix string in <md-icon> right before the svg is rendered (one string that is attached to all IDs of that svg, so that they can still reference each other throughxml:link="..." and clip-path: url(#...)).

@devversion
Copy link
Member

@mpiasta-ca I like the solution. This seems to be a elegant way.

@topherfangio topherfangio added the P1: urgent Urgent issues that should be addressed in the next minor or patch release. label Mar 17, 2016
@devversion devversion added pr: merge ready This PR is ready for a caretaker to review needs: manual testing This issue or PR needs to have some manual testing and verification done labels Mar 18, 2016
@ThomasBurleson ThomasBurleson modified the milestone: Backlog Apr 20, 2016
@ThomasBurleson ThomasBurleson modified the milestones: - Backlog, Deprecated May 26, 2016
@devversion
Copy link
Member

The cached icons id's are now always prefixed with a incrementing prefix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: manual testing This issue or PR needs to have some manual testing and verification done P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

No branches or pull requests

4 participants