Fix svg matching performance issue

This commit is contained in:
Niklas von Hertzen 2014-11-02 18:54:39 +02:00
parent 1793b802b1
commit 6ece2a3d5a
3 changed files with 3 additions and 3 deletions

2
dist/html2canvas.js vendored
View File

@ -1029,7 +1029,7 @@ ImageLoader.prototype.loadImage = function(imageData) {
};
ImageLoader.prototype.isSVG = function(src) {
return (/(.+).svg$/i.test(src)) || SVGContainer.prototype.isInline(src);
return src.substring(src.length - 3).toLowerCase() === "svg" || SVGContainer.prototype.isInline(src);
};
ImageLoader.prototype.imageExists = function(images, src) {

File diff suppressed because one or more lines are too long

View File

@ -76,7 +76,7 @@ ImageLoader.prototype.loadImage = function(imageData) {
};
ImageLoader.prototype.isSVG = function(src) {
return (/(.+).svg$/i.test(src)) || SVGContainer.prototype.isInline(src);
return src.substring(src.length - 3).toLowerCase() === "svg" || SVGContainer.prototype.isInline(src);
};
ImageLoader.prototype.imageExists = function(images, src) {