mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-04 03:44:45 +00:00
IE8 and lower now actually render and show any loaded SVG
This commit is contained in:
parent
3795149dda
commit
f71f634afd
1 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue