Open axe312ger opened 8 years ago
:+1: We could use battle-proofed browser detection libs, and a normal XMLHttpRequest
for async svg-stack loading.
I think a test for linked external svg content is not present in modernizr. See github.
Sounds like a nice challenge to create a as small as possible but feature complete implementation of a new polyfill lib.
I did some screenshots tests via crossbrowsertesting and http://haz.io/. IE Edge down to IE 9 return true for all svg tests.
Is it kind of a try and it fails
way of detection, or can it be determined by any missing API method?
I think it must be try and fail, I see no other way.
Every IE browser, also Edge, do have the problem that linked external svg's are not supported.
One workaround was to render the whole svg stack at the bottom of the website. But with this technique, the icons can not be cached and will be loaded on every request.
svg4everybody is a possible polyfill, it replaces the linked svg's with inline svg's while the page is loading. But it turned out that this script is a performance killer and crashes IE 10 and below.
Suggested solution
Create a polyfill which detects browser which do not support linked svg's. For these browsers, load the svg-stack via ajax and attach it to the bottom of the page. This should be a way smaller performance impact than svg4everybody is and allows the browser to cache the whole stack file.