feature(dom) isSVG: detect svg -> detect smil svg

This commit is contained in:
coderaiser 2014-03-26 15:04:30 -04:00
parent 1b3d7b6e2e
commit 2bdb1df5dc

View file

@ -267,18 +267,18 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
};
/**
* check svg support
* check SVG SMIL animation support
*/
this.isSVG = function() {
var rect, ret,
var rect, ret, svgNode,
create = document.createElementNS,
SVG_URL = 'http://www.w3.org/2000/svg';
if (create)
if (create) {
create = create.bind(document);
rect = create(SVG_URL,'svg').createSVGRect;
ret = !!rect;
svgNode = create(SVG_URL, 'animate');
ret = /SVGAnimate/.test(toString.call(svgNode));
}
return ret;
};