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

Validate Not Running After Page Start #187

Open
trisys3 opened this issue Dec 12, 2018 · 0 comments
Open

Validate Not Running After Page Start #187

trisys3 opened this issue Dec 12, 2018 · 0 comments

Comments

@trisys3
Copy link

trisys3 commented Dec 12, 2018

The polyfill function seems to run for as long as the page is up, whether you're using an old browser like IE11 or manually use polyfill: true. However, it doesn't seem to use the validate function after page load, so SVGs which get added through AJAX-ed HTML, like in a SPA, don't get polyfilled. Was this for performance?

I want to use the polyfill only for SVGs that have gradients, as certain browsers don't add gradients for <use>d SVGs. At time of writing, Firefox uses gradients as long as they're at the top level, or in a <defs> block at the top level, otherwise they're ignored. Chrome/Safari/Edge don't add gradients to SVGs that come from a <use>, and there's no indication of when they will. This seems too complicated a use case to polyfill, so I'm not surprised I haven't found any npm package providing said polyfill.

If I need to, I can live with polyfilling all SVGs on browsers besides Firefox, and that's what I plan to do until this issue is resolved, if it ever is. We have more SVGs that don't have gradients than SVGs that do, so I wanted to polyfill only the ones that do.

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

No branches or pull requests

1 participant