@@ -1062,79 +1062,9 @@ _html2canvas.Parse = function (images, options) {
10621062 }
10631063 }
10641064
1065- function svgDOMRender ( body , stack ) {
1066- var img = new Image ( ) ,
1067- docWidth = documentWidth ( ) ,
1068- docHeight = documentHeight ( ) ,
1069- html = "" ;
1070-
1071- function parseDOM ( el ) {
1072- var children = _html2canvas . Util . Children ( el ) ,
1073- len = children . length ,
1074- attr ,
1075- a ,
1076- alen ,
1077- elm ,
1078- i ;
1079- for ( i = 0 ; i < len ; i += 1 ) {
1080- elm = children [ i ] ;
1081- if ( elm . nodeType === 3 ) {
1082- // Text node
1083- html += elm . nodeValue . replace ( / < / g, "<" ) . replace ( / > / g, ">" ) ;
1084- } else if ( elm . nodeType === 1 ) {
1085- // Element
1086- if ( ! / ^ ( s c r i p t | m e t a | t i t l e ) $ / . test ( elm . nodeName . toLowerCase ( ) ) ) {
1087-
1088- html += "<" + elm . nodeName . toLowerCase ( ) ;
1089-
1090- // add attributes
1091- if ( elm . hasAttributes ( ) ) {
1092- attr = elm . attributes ;
1093- alen = attr . length ;
1094- for ( a = 0 ; a < alen ; a += 1 ) {
1095- html += " " + attr [ a ] . name + '="' + attr [ a ] . value + '"' ;
1096- }
1097- }
1098-
1099-
1100- html += '>' ;
1101-
1102- parseDOM ( elm ) ;
1103-
1104-
1105- html += "</" + elm . nodeName . toLowerCase ( ) + ">" ;
1106- }
1107- }
1108-
1109- }
1110-
1111- }
1112-
1113- parseDOM ( body ) ;
1114- img . src = [
1115- "data:image/svg+xml," ,
1116- "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='" + docWidth + "' height='" + docHeight + "'>" ,
1117- "<foreignObject width='" + docWidth + "' height='" + docHeight + "'>" ,
1118- "<html xmlns='http://www.w3.org/1999/xhtml' style='margin:0;'>" ,
1119- html . replace ( / \# / g, "%23" ) ,
1120- "</html>" ,
1121- "</foreignObject>" ,
1122- "</svg>"
1123- ] . join ( "" ) ;
1124-
1125- img . onload = function ( ) {
1126- stack . svgRender = img ;
1127- } ;
1128-
1129- }
1130-
11311065 function init ( ) {
11321066 var stack = renderElement ( element , null ) ;
11331067
1134- if ( support . svgRendering ) {
1135- svgDOMRender ( document . documentElement , stack ) ;
1136- }
1137-
11381068 Array . prototype . slice . call ( element . children , 0 ) . forEach ( function ( childElement ) {
11391069 parseElement ( childElement , stack ) ;
11401070 } ) ;
0 commit comments