Fix #document importing for all browsers.

Safari doesn't know document.children...
This commit is contained in:
Jürg Lehni 2013-11-03 12:30:49 +01:00
parent aec4c70b9a
commit 7430c3f159

View file

@ -167,7 +167,13 @@ new function() {
// nodeNames still.
var importers = {
'#document': function(node, type, isRoot, options) {
return importSVG(node.children[0], isRoot, options);
var children = node.childNodes;
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i];
if (child.nodeType === 1)
return importSVG(child, isRoot, options);
}
return null;
},
// http://www.w3.org/TR/SVG/struct.html#Groups