Open keithamus opened 9 years ago
This is a great conversation to have. We’ve been searching for a feature detection solution since we started this project. I’ll leave this ticket open for some time in case a new answer reveals itself.
It'd be quite nice if, in the interim, I could manually fire the polyfill script and it wasn't guarded by the UA sniff. i.e. if I require it, it UA sniffs and automatically runs, but it returns a function which lets me manually call to run the polyfill when I'm sure I'll need it.
That is primary feature in 2.0 which is set to be released today. #62
@jonathantneal, is this good to close then?
With Microsoft Edge out, svg4everybody 1.0 does not polyfill Edge properly, because it uses UA sniffing.
I've seen that 2.0 now sniffs for edge too, but ultimately it could be better (if seemingly tricky) to use feature detection to see if SVG's
<use xlink:href>
is supported.Here's some things that I've tried so far, that haven't been too successful:
document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#XlinkAttribute', '1.1')
- unfortunately IE9-11 and Safari 7 returntrue
despite not supporting external resources.'children' in document.createElementNS('http://www.w3.org/2000/svg', 'use')
- this returns false in everything except Chrome and Firefox, but unfortunately is a false negative in Safari 8.I realise this isn't much help, but I just wanted to open the conversation and show some of my working to save time in the hunt for the right feature detection test.