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
Restrictions about svg #9243
Comments
Hi, any update in this question? Thanks |
@eduardcotmrf Do you have an example SVG? Basically, we restricted xlinks to |
What we want to achieve is something like this: HTML example:
SVG EXAMPLE:
So the browser will cache the below.svg file and the icons data won't be contained in the HTML. |
@eduardcotmrf Thanks for the examples. I don't see any major problem opening this up as long as the Caches can correctly proxy these links. So, let's start with caches and we'll enable in validator. |
What can we do to help? /cc @alexmrf |
@eduardcotmrf At this point we need to wait for the caches (Google, Cloudflare, etc) to implement the proxy for these links and update the modifications best practices. For Google AMP Cache it's tracked internally at b/62073090. Once those are done then it can be enabled in the validator. |
Do we have any update on this? Thanks! |
Unfortunately not right now. |
Add svg image url example in preparation of #9243. <svg class="icon" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="https://example.com/test.svg#icon"></use></svg>
@eduardcotmrf cache changes are proceeding. Once they're in, we'll update the validator to allow it. |
Thank you! |
This is now live in prod. |
Does AMP provide polyfill for external svg use? |
In the documentation (https://www.ampproject.org/docs/reference/spec#svg) it says that you cannot reference any svg with the "xlink:href" attribute not starting wtih '#'. Why is that?
In our amp page we have to load icons that are used below the fold but because of this restriction we are having them inline in the html above the fold and then used with '#' references. That makes no sense as this icons are not used and they represent a huge amount of data to be downloaded with the html.
Is there any special reason for this restriction? Aren't icons like images that can be downloaded later?
Thanks!
The text was updated successfully, but these errors were encountered: