inline.js 803 B

123456789101112131415161718192021222324252627
  1. /*!
  2. {
  3. "name": "Inline SVG",
  4. "property": "inlinesvg",
  5. "caniuse": "svg-html5",
  6. "tags": ["svg"],
  7. "notes": [{
  8. "name": "Test page",
  9. "href": "https://paulirish.com/demo/inline-svg"
  10. }, {
  11. "name": "Test page and results",
  12. "href": "https://codepen.io/eltonmesquita/full/GgXbvo/"
  13. }],
  14. "polyfills": ["inline-svg-polyfill"],
  15. "knownBugs": ["False negative on some Chromia browsers."]
  16. }
  17. !*/
  18. /* DOC
  19. Detects support for inline SVG in HTML (not within XHTML).
  20. */
  21. define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
  22. Modernizr.addTest('inlinesvg', function() {
  23. var div = createElement('div');
  24. div.innerHTML = '<svg/>';
  25. return (typeof SVGRect !== 'undefined' && div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';
  26. });
  27. });