Skip to content

Commit a902f92

Browse files
committed
remove svg rendering
1 parent 2c58c56 commit a902f92

2 files changed

Lines changed: 0 additions & 75 deletions

File tree

src/Parse.js

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -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,"&lt;").replace(/>/g,"&gt;");
1084-
} else if ( elm.nodeType === 1 ) {
1085-
// Element
1086-
if ( !/^(script|meta|title)$/.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
});

src/renderers/Canvas.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ _html2canvas.Renderer.Canvas = function(options) {
8585
ctx.fillStyle = fstyle;
8686

8787

88-
if ( options.svgRendering && zStack.svgRender !== undefined ) {
89-
// TODO: enable async rendering to support this
90-
ctx.drawImage( zStack.svgRender, 0, 0 );
91-
} else {
9288
for ( i = 0, queueLen = queue.length; i < queueLen; i+=1 ) {
9389
storageContext = queue.splice(0, 1)[0];
9490
storageContext.canvasPosition = storageContext.canvasPosition || {};
@@ -112,7 +108,6 @@ _html2canvas.Renderer.Canvas = function(options) {
112108
ctx.restore();
113109
}
114110
}
115-
}
116111

117112
h2clog("html2canvas: Renderer: Canvas renderer done - returning canvas obj");
118113

0 commit comments

Comments
 (0)