Skip to content

Commit

Permalink
Merge pull request Modernizr#1371 from ssidorchick/svg-foreignobject
Browse files Browse the repository at this point in the history
Add SVG foreignObject tag support detection.
  • Loading branch information
patrickkettner committed Jun 30, 2014
2 parents 996ca33 + ee836f0 commit d8830c7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions feature-detects/svg/foreignobject.js
Original file line number Diff line number Diff line change
@@ -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')));
});
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"test/svg/clippaths",
"test/svg/filters",
"test/svg/inline",
"test/svg/foreignobject",
"test/svg/smil",
"test/svg",
"test/textarea/maxlength",
Expand Down

0 comments on commit d8830c7

Please sign in to comment.