welsonjs/node_modules/modernizr/feature-detects/svg/asimg.js

28 lines
883 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
{
"name": "SVG as an <img> tag source",
"property": "svgasimg",
"caniuse": "svg-img",
"tags": ["svg"],
"aliases": ["svgincss"],
"authors": ["Chris Coyier"],
"notes": [{
"name": "HTML5 Spec",
"href": "https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element"
}]
}
!*/
define(['Modernizr', 'addTest'], function(Modernizr) {
// Original Async test by Stu Cox
// https://gist.github.com/chriscoyier/8774501
// Now a Sync test based on good results here
// https://codepen.io/chriscoyier/pen/bADFx
// Note http://www.w3.org/TR/SVG11/feature#Image is *supposed* to represent
// support for the `<image>` tag in SVG, not an SVG file linked from an `<img>`
// tag in HTML but its a heuristic which works
Modernizr.addTest('svgasimg', document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'));
});