clippaths.js 691 B

12345678910111213141516171819202122
  1. /*!
  2. {
  3. "name": "SVG clip paths",
  4. "property": "svgclippaths",
  5. "tags": ["svg"],
  6. "notes": [{
  7. "name": "Demo",
  8. "href": "http://srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg"
  9. }]
  10. }
  11. !*/
  12. /* DOC
  13. Detects support for clip paths in SVG (only, not on HTML content).
  14. See [this discussion](https://github.com/Modernizr/Modernizr/issues/213) regarding applying SVG clip paths to HTML content.
  15. */
  16. define(['Modernizr', 'toStringFn'], function(Modernizr, toStringFn) {
  17. Modernizr.addTest('svgclippaths', function() {
  18. return !!document.createElementNS &&
  19. /SVGClipPath/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'clipPath')));
  20. });
  21. });