function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=b?b:!1;b=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}