svnno****@sourc*****
svnno****@sourc*****
2009年 4月 3日 (金) 20:08:25 JST
Revision: 1116 http://svn.sourceforge.jp/view?root=sie&view=rev&rev=1116 Author: dhrname Date: 2009-04-03 20:08:25 +0900 (Fri, 03 Apr 2009) Log Message: ----------- スタイルシートのプロパティleftとtopのデフォルト値がIE8ではautoなので、それの対策 Modified Paths: -------------- branches/04x/046/sie.js Modified: branches/04x/046/sie.js =================================================================== --- branches/04x/046/sie.js 2009-04-01 13:18:15 UTC (rev 1115) +++ branches/04x/046/sie.js 2009-04-03 11:08:25 UTC (rev 1116) @@ -170,12 +170,12 @@ } catch(e) {stlog.add(e,129); } } -SVGtoVML.prototype.set = function stvset() { +SVGtoVML.prototype.set = function stvset(ob) { var w = this.w, h = this.h, c = this.children; var sw = this.swi.value, sh = this.shi.value; - try { this.setObject(this.use,sw,sh); this.setObject(c,sw,sh); + try { var backr = document.createElement("v:rect"); //背景の作成 backr.style.position = "absolute"; backr.style.width = w+ "px"; @@ -185,7 +185,7 @@ backr.setAttribute("filled", "false"); this.rootElement.appendChild(backr); var trstyle = this.rootElement.style; - var tpstyle = this.rootElement.parentNode.style; + var tpstyle = ob.style; trstyle.visibility = "visible"; //以下、画像を切り取り trstyle.overflow = "hidden"; @@ -195,11 +195,11 @@ var bfl = parseFloat(backrs.left), bft = parseFloat(backrs.top); var bl = -this.vi._tx var bt = -this.vi._ty; - if (bfl !== 0) { //内部の図形にずれが生じたとき + if (bfl !== 0 && !isNaN(bfl)) { //内部の図形にずれが生じたとき(isNaNはIE8でautoがデフォルト値のため) bl = bfl; tpstyle.left = -bl+ "px"; } - if (bft !== 0) { + if (bft !== 0 && !isNaN(bfl)) { bt = bft; tpstyle.top = -bt+ "px"; } @@ -1918,7 +1918,6 @@ var obst = ob.style; ob.innerHTML = dc; var obc = ob.getElementsByTagName("group").item(0); //obcはSVGのルート要素 - obc.outerHTML = obc.outerHTML //IE8の標準モード対策 var regaw = obc.getAttribute("svgwidth") || obwidth; var regah = obc.getAttribute("svgheight") || obheight; regw = new STLength(regaw,obwidth); @@ -1930,8 +1929,10 @@ var dn = new Date(); STdocument[dn] = new SVGtoVML(obc,obwidth,obheight,regw,regh); obj.parentNode.insertBefore(ob,obj); + ob.outerHTML = ob.outerHTML //IE8の標準モード対策 + obc.outerHTML = obc.outerHTML //IE8の標準モード対策 STdocument[dn].read(); - STdocument[dn].set(); + STdocument[dn].set(ob); alert((new Date()).getTime() - dn.getTime()); data = dc = null; if (NAIBU.STObject !== void 0) {NAIBU.STObject.next();}