-
Notifications
You must be signed in to change notification settings - Fork 351
Description
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.