@@ -94,7 +94,7 @@ new function() {
9494 for ( var i = 0 , l = nodes . length ; i < l ; i ++ ) {
9595 var childNode = nodes [ i ] ,
9696 child ;
97- if ( childNode . nodeType == 1 && ( child = importSVG ( childNode ) ) ) {
97+ if ( childNode . nodeType === 1 && ( child = importSVG ( childNode ) ) ) {
9898 // When adding CompoundPaths to other CompoundPaths,
9999 // we need to "unbox" them first:
100100 if ( clip && child instanceof CompoundPath ) {
@@ -148,7 +148,7 @@ new function() {
148148 stops = [ ] ;
149149 for ( var i = 0 , l = nodes . length ; i < l ; i ++ ) {
150150 var child = nodes [ i ] ;
151- if ( child . nodeType == 1 )
151+ if ( child . nodeType === 1 )
152152 stops . push ( applyAttributes ( new GradientStop ( ) , child ) ) ;
153153 }
154154 var isRadial = type === 'radialgradient' ,
@@ -172,6 +172,10 @@ new function() {
172172 // NOTE: All importers are lowercase, since jsdom is using uppercase
173173 // nodeNames still.
174174 var importers = {
175+ '#document' : function ( node ) {
176+ return importSVG ( node . childNodes [ 0 ] ) ;
177+ } ,
178+
175179 // http://www.w3.org/TR/SVG/struct.html#Groups
176180 g : importGroup ,
177181 // http://www.w3.org/TR/SVG/struct.html#NewDocument
@@ -486,7 +490,7 @@ new function() {
486490 var type = node . nodeName . toLowerCase ( ) ,
487491 importer = importers [ type ] ,
488492 item = importer && importer ( node , type ) ,
489- data = node . getAttribute ( 'data-paper-data' ) ;
493+ data = type !== '#document' && node . getAttribute ( 'data-paper-data' ) ;
490494 // See importGroup() for an explanation of this filtering:
491495 if ( item && ! ( item instanceof Group ) )
492496 item = applyAttributes ( item , node ) ;
0 commit comments