Uh oh!
There was an error while loading. Please reload this page.
fix(icon): make svg filters work in Safari/Firefox - #11959
Conversation
SVG filters do not work in Safari/FF because of paths in url needing to be updated to current path This fixesangular#9276
googlebot
commented
Jun 27, 2018
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
googlebot
commented
Jun 27, 2018
CLAs look good, thanks! |
| private _updateUrlPaths(svg: SVGElement) { | ||
| const currentPath = this._location.prepareExternalUrl(this._location.path()); | ||
| svg.outerHTML = svg.outerHTML.replace(/url\((.*)\)/, `url(${currentPath}$1)`); |
There was a problem hiding this comment.
This seems very inefficient since it's asking the browser to parse the HTML once and then re-parse it once the URLs are updated. Since you're using a regex anyway, why not do it before the element is even created?
There was a problem hiding this comment.
Regex does seem a bit brittle I agree. I'll admit I didn't read through the code at all, so I probably could of found a better spot. When I get a few minutes somehow I'll read the code and find a better spot for this!
Hi @MikaAK! This PR has merge conflicts due to recent upstream merges. |
MikaAK
commented
Oct 5, 2018
Fixed by #12428 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
SVG filters do not work in Safari/FF because of paths in url needing to be updated to current path
This fixes#9276
WIP