diff --git a/feature-detects/svg/foreignobject.js b/feature-detects/svg/foreignobject.js new file mode 100644 index 0000000000..182cefbd47 --- /dev/null +++ b/feature-detects/svg/foreignobject.js @@ -0,0 +1,20 @@ +/*! +{ + "name": "SVG foreignObject", + "property": "svgforeignobject", + "tags": ["svg"], + "notes": [{ + "name": "W3C Spec", + "href": "http://www.w3.org/TR/SVG11/extend.html" + }] +} +!*/ +/* DOC +Detects support for foreignObject tag in SVG. +*/ +define(['Modernizr', 'toStringFn'], function( Modernizr, toStringFn ) { + Modernizr.addTest('svgforeignobject', function() { + return !!document.createElementNS && + /SVGForeignObject/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'))); + }); +}); diff --git a/lib/config-all.json b/lib/config-all.json index ccd7bd0d9f..c615b193cc 100644 --- a/lib/config-all.json +++ b/lib/config-all.json @@ -208,6 +208,7 @@ "test/svg/clippaths", "test/svg/filters", "test/svg/inline", + "test/svg/foreignobject", "test/svg/smil", "test/svg", "test/textarea/maxlength",