svnno****@sourc*****
svnno****@sourc*****
2009年 5月 15日 (金) 19:08:22 JST
Revision: 1165 http://svn.sourceforge.jp/view?root=sie&view=rev&rev=1165 Author: dhrname Date: 2009-05-15 19:08:22 +0900 (Fri, 15 May 2009) Log Message: ----------- 0.47の統合 Modified Paths: -------------- branches/04x/sie.js Property Changed: ---------------- branches/04x/sie.js Modified: branches/04x/sie.js =================================================================== --- branches/04x/sie.js 2009-05-13 11:34:34 UTC (rev 1164) +++ branches/04x/sie.js 2009-05-15 10:08:22 UTC (rev 1165) @@ -90,9 +90,8 @@ } } //他のページに移動する際に起動 -function unsvgtovml(){ - NAIBU = stlog = STLog = STdocument = null; - PaintColor = FontStyle = null; +function unsvgtovml() { + NAIBU = stlog = STLog = PaintColor = FontStyle = null; } //vmlの名前空間をセット(必須) @@ -101,15 +100,11 @@ document.namespaces.add("v","urn:schemas-microsoft-com:vml"); document.namespaces.add("o","urn:schemas-microsoft-com:office:office"); var st = document.createStyleSheet(); - var vmlUrl = "behavior: url(#default#VML);display:inline-block;"; //inline-blockはIEのバグ対策 - st.addRule("v\\:rect",vmlUrl); - st.addRule("v\\:image",vmlUrl); - st.addRule("v\\:fill",vmlUrl); - st.addRule("v\\:stroke",vmlUrl); - st.addRule("o\\:opacity2",vmlUrl); - st.addRule("dn\\:defs","display:none"); - st.addRule("v\\:group", vmlUrl+ "position:relative;width:100%;height:100%;"); - st.addRule("v\\:shape", vmlUrl+ "width:100%;height:100%;"); + var vmlUrl = "behavior: url(#default#VML);display:inline-block;} "; //inline-blockはIEのバグ対策 + st.cssText = "v\\:rect{" +vmlUrl+ "v\\:image{" +vmlUrl+ "v\\:fill{" +vmlUrl+ "v\\:stroke{" +vmlUrl+ "o\\:opacity2{" +vmlUrl + + "dn\\:defs{display:none}" + + "v\\:group{position:relative;width:100%;height:100%;" +vmlUrl + + "v\\:shape{width:100%;height:100%;" +vmlUrl; } } @@ -167,8 +162,8 @@ la[i] = new st(li[i], w, h); } this[nodes] = la; - } catch(e) {stlog.add(e,129); - } + li = null; + } catch(e) {stlog.add(e,129);} } SVGtoVML.prototype.set = function stvset(ob) { var w = this.w, h = this.h, c = this.children; @@ -295,7 +290,7 @@ } catch(e){stlog.add(e,3002);} } while (te); } - name = gname = matrix = null; + nods = name = gname = matrix = cmatrix = null; } //object要素とembed要素の取得を総括して行う @@ -352,7 +347,7 @@ STGroupElement.prototype.set = function (sw,sh) { try{ stvsetob(this.children,sw,sh); - delete (this.children); + this.children = this.transformable = null; } catch(e){stlog.addd(e,3145)} } STGroupElement.prototype.chset = SVGtoVML.prototype.chset; @@ -397,6 +392,7 @@ l[i] = new STTSpanElement(li[i],this.dx,this.dy,this.transformable, w, h); } this.tspan = l; + li = null; } catch(e) {stlog.add(e,129264);} return this; } @@ -463,7 +459,7 @@ } tts.left = ptm.x - tancx; tts.top = ptm.y - tancy; - p = ptm = tancx = tancy = null; + p = ptm = tancx = tancy = fij = null; this.textLength = textLength; } catch(e) {stlog.add(e,2831);} } @@ -532,7 +528,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); - list = pl = plm = dat = null; + list = pl = plm = dat = this.paint = ttm = this.transformable = null; } catch(e) {stlog.add(e,257);} } @@ -639,7 +635,7 @@ ele.path = dat + " e"; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); - dat = this.paint = this.d = preCom = x = y = x0 = y0 = dx = dy = tma = tmb = tmc = tmd = tme = tmf = null; //解放 + dat = this.paint = ttm = this.transformable = this.d = preCom = x = y = x0 = y0 = dx = dy = tma = tmb = tmc = tmd = tme = tmf = null; //解放 } catch(e) {stlog.add(e,372);} } @@ -705,6 +701,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); + dat = F = pl = plm = this.paint = ttm = this.transformable = null; //解放 } catch(e) {stlog.add(e,406);} } @@ -731,6 +728,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); + dat = F = pl = plm = this.paint = ttm = this.transformable = null; //解放 } catch(e) {stlog.add(e,440);} } @@ -763,6 +761,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); + dat = list = pl = plm = this.paint = ttm = this.transformable = null; //解放 } catch(e) {stlog.add(e,479);} } @@ -795,6 +794,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); + dat = list = pl = plm = this.paint = ttm = this.transformable = null; //解放 } catch(e) {stlog.add(e,519);} } @@ -845,6 +845,7 @@ ele.path = dat; ele.coordsize = w + " " + h; this.paint.set(w, h, ttm); + dat = list = pl = plm = this.paint = ttm = this.transformable = null; //解放 } catch(ee) {stlog.add(ee,576);} } @@ -885,6 +886,7 @@ ttfia.Opacity = parseFloat(this.paint.fillopacity)*100; } this.xlink.set(); + dat = pt = this.xlink = this.paint = ttm = this.transformable = null; //解放 } catch(e) {stlog.set(e,21896);} } @@ -966,7 +968,6 @@ NAIBU.PaintColor.prototype.getParent = function( /*element*/ ele) { var parent = ele.parentNode; if (parent.tagName !== "group" && parent.tagName !== "A") { - NAIBU.PaintColor.rootElement = parent; return null; } else { var cache = this.cache; @@ -1045,6 +1046,7 @@ if (strokeOpacity < 1) { strokeElement.setAttribute("opacity", strokeOpacity); } + strokeOpacity = null; } strokeElement.setAttribute("miterlimit", this.strokemiterlimit); strokeElement.setAttribute("joinstyle", this.strokelinejoin); @@ -1066,6 +1068,7 @@ } } strokeElement.setAttribute("dashstyle", this.strokedasharray); + tsd = strs = null; } } catch(e) {stlog.add(e,720); strokeElement.on = "false";} el.appendChild(strokeElement); @@ -1232,6 +1235,7 @@ } var stops = grad2.getElementsByTagName("stop"); if (!stops) { + grad = grad2 = stops = null; return false; } var length = stops.length; @@ -1327,7 +1331,7 @@ } else { return false; } - stops = type = color = colors = opacity = null; + stops = type = lengh = color = colors = opacity = null; return false; } @@ -1408,12 +1412,12 @@ if (tft) { var coma = tft.match(NAIBU.comaR); //コマンド文字にマッチ translate var list = tft.match(NAIBU.listR); //カッコ内のリストにマッチ (10 20 30...) + var a,b,c,d,e,f,lis,deg,rad,degli,matri; for (var j=0;j<coma.length;j++) { - var lis = list[j], com = coma[j]; - var a,b,c,d,e,f; - var deg = lis.match(NAIBU.degR); - var rad = parseFloat(deg[0]) / 180 * Math.PI; - var degli = deg.length; + lis = list[j], com = coma[j]; + deg = lis.match(NAIBU.degR); + rad = parseFloat(deg[0]) / 180 * Math.PI; + degli = deg.length; if (degli === 6) { a = parseFloat(deg[0]); b = parseFloat(deg[1]); c = parseFloat(deg[2]); d = parseFloat(deg[3]); e = parseFloat(deg[4]); f = parseFloat(deg[5]); } else if (degli === 3) { @@ -1438,11 +1442,11 @@ break; } } - var matri = new Matrix(a,b,c,d,e,f); + matri = new Matrix(a,b,c,d,e,f); matrix = matrix.multiply(matri); - lis = com = matri = deg = rad = null; + lis = com = deg = rad = null; } - list = coma = mat = null; + list = coma = mat = matri = null; } } catch(e) {stlog.add(e,816);} return matrix; @@ -1478,6 +1482,7 @@ var pmt = p.matrixTransform(ttm); F[i++] = pmt.x; F[i++] = pmt.y; + p = pmt = null; } var s = new PList(F); return s; @@ -1490,13 +1495,7 @@ } //Matrix同士の積を算出 Matrix.prototype.multiply = function matrixmultiply( /*Matrix*/ m) { - var a = this.a * m.a + this.c * m.b; - var b = this.b * m.a + this.d * m.b; - var c = this.a * m.c + this.c * m.d; - var d = this.b * m.c + this.d * m.d; - var e = this.a * m.e + this.c * m.f + this.e; - var f = this.b * m.e + this.d * m.f + this.f; - var s = new Matrix(a,b,c,d,e,f); + var s = new Matrix(this.a * m.a + this.c * m.b,this.b * m.a + this.d * m.b,this.a * m.c + this.c * m.d,this.b * m.c + this.d * m.d,this.a * m.e + this.c * m.f + this.e,this.b * m.e + this.d * m.f + this.f); return s; } //行列式 @@ -1724,6 +1723,7 @@ ut = this._tani[tani]; } this.newValueSpecifiedUnits(ut,v); + d = wort = f = v = tani = ut = null; //解放 } catch(e) {stlog.add(e,1133); this.value = 1000;} return this; } @@ -1807,8 +1807,6 @@ case "new": this.tar.setAttribute("target","_blank"); break; - default: - break; } this.tar.setAttribute("href",uri); } @@ -1855,19 +1853,17 @@ return xmlhttp; } var success = true; -//SVGDocumentを収納しておく -var STdocument = new Array(); //IE用。object要素のデータからVMLを作成 function ca( /*object*/ data) { if (success && data.success) { - var dn = data.num-1; try { - var obj = data.obj[dn]; + var obj = data.obj[data.num-1]; var obw = new STLength(obj.getAttribute("width"),obj.clientWidth), obh = new STLength(obj.getAttribute("height"),obj.clientHeight); - var obwidth = obw.value, obheight = obh.value; + var obwidth = obw.value, obheight = obh.value; } catch(e) {stlog.add(e,1209);} //正規表現でソースをVML用に書き換え + //xmlns属性削除はバグが起きないように必須 var dc = data.content .replace(/<!DOCTYPE/, "<!--") .replace(/(?:dtd">|\]>)/, "-->") @@ -1915,20 +1911,22 @@ var ob = document.createElement("v:group"); var obst = ob.style; ob.innerHTML = dc; + data = dc = null; var obc = ob.getElementsByTagName("group").item(0); //obcはSVGのルート要素 var regaw = obc.getAttribute("svgwidth") || obwidth; var regah = obc.getAttribute("svgheight") || obheight; - regw = new STLength(regaw,obwidth); - regh = new STLength(regah,obheight); + var regw = new STLength(regaw,obwidth); + var regh = new STLength(regah,obheight); var regwv = regw.value, reghv = regh.value; obst.width = regwv+ "px"; obst.height = reghv+ "px"; ob.coordsize = regwv +" "+ reghv; - STdocument[dn] = new SVGtoVML(obc,obwidth,obheight,regw,regh); + var STdocument = new SVGtoVML(obc,obwidth,obheight,regw,regh); obj.parentNode.insertBefore(ob,obj); - STdocument[dn].read(ob); - STdocument[dn].set(ob); - data = dc = null; + STdocument.read(ob); + STdocument.set(ob); + STdocument = obw = obh = regw = regh = null; + NAIBU.PaintColor.prototype.cache = {}; //キャッシュの初期化 if (NAIBU.STObject !== void 0) {NAIBU.STObject.next();} } } @@ -1943,7 +1941,7 @@ xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState === 4 && xmlhttp.status === 200) { -fn({success:true, status:xmlhttp.status,content:xmlhttp.responseText,contentType:xmlhttp.getResponseHeader("Content-Type"),obj:ob,num:n}); + fn({success:true,content:xmlhttp.responseText,obj:ob,num:n}); xmlhttp = null; } } Property changes on: branches/04x/sie.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 + /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 /branches/04x/047/sie.js:1131-1164