IE8 and lower now actually render and show any loaded SVG

This commit is contained in:
Tim de Koning 2012-01-18 10:44:03 +01:00
parent 3795149dda
commit f71f634afd

View file

@ -582,12 +582,15 @@
function onComplete(r) {
var xml = r.responseXML;
if (!xml) return;
if (!xml.documentElement && fabric.window.ActiveXObject && r.responseText) {
xml = new ActiveXObject('Microsoft.XMLDOM');
xml.async = 'false';
//IE chokes on DOCTYPE
xml.loadXML(r.responseText.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i,''));
}
if (!xml.documentElement) return;
var doc = xml.documentElement;
if (!doc) return;
fabric.parseSVGDocument(doc, function (results, options) {
fabric.parseSVGDocument(xml.documentElement, function (results, options) {
svgCache.set(url, {
objects: fabric.util.array.invoke(results, 'toObject'),
options: options