mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix #document importing for all browsers.
Safari doesn't know document.children...
This commit is contained in:
parent
aec4c70b9a
commit
7430c3f159
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue