[Sie-announce] SIEコード [2496] SVGImageElementのvar文を整理

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 21日 (月) 20:28:42 JST


Revision: 2496
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2496
Author:   dhrname
Date:     2011-03-21 20:28:42 +0900 (Mon, 21 Mar 2011)

Log Message:
-----------
SVGImageElementのvar文を整理

Modified Paths:
--------------
    branches/07x/073/org/w3c/dom/svg.js

Modified: branches/07x/073/org/w3c/dom/svg.js
===================================================================
--- branches/07x/073/org/w3c/dom/svg.js	2011-03-21 11:19:24 UTC (rev 2495)
+++ branches/07x/073/org/w3c/dom/svg.js	2011-03-21 11:28:42 UTC (rev 2496)
@@ -1395,7 +1395,9 @@
     if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) {
       return; //強制終了させる
     }
-    var tnext = tar.nextSibling, tpar = tar.parentNode, isLast = true;
+    var tnext = tar.nextSibling,
+        tpar = tar.parentNode,
+        isLast = true;
     if (tnext && tnext._tar && tpar._tar && (tnext._tar.parentNode === tpar._tar)) {
       tpar._tar.insertBefore(tar._tar, tnext._tar);
     } else if (tnext && !tnext._tar && tpar._tar) {
@@ -1491,15 +1493,16 @@
     evt.target.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", "embed");
   }, false);
   this.addEventListener("SVGLoad", function(evt){
-    var tar = evt.target, style = tar.ownerDocument.defaultView.getComputedStyle(tar, "");
-    var fontSize = parseFloat(style.getPropertyValue("font-size"));
+    var tar = evt.target,
+        style = tar.ownerDocument.defaultView.getComputedStyle(tar, ""),
+        fontSize = parseFloat(style.getPropertyValue("font-size")),
+        tgtb = tar.transform.baseVal,
+        trans = tar.ownerDocument.documentElement.createSVGTransform();
     tar.x.baseVal._emToUnit(fontSize);
     tar.y.baseVal._emToUnit(fontSize);
     tar.width.baseVal._emToUnit(fontSize);
     tar.height.baseVal._emToUnit(fontSize);
     tar.instanceRoot = tar.animatedInstanceRoot = tar.ownerDocument.importNode(tar._instance, true);
-    var tgtb = tar.transform.baseVal;
-    var trans = tar.ownerDocument.documentElement.createSVGTransform();
     trans.setTranslate(tar.x.baseVal.value, tar.y.baseVal.value);
     tgtb.appendItem(trans);
     tar.appendChild(tar.instanceRoot);
@@ -1559,16 +1562,19 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      var tar = evt.target, style = tar.ownerDocument.defaultView.getComputedStyle(tar, "");
-      var fontSize = parseFloat(style.getPropertyValue("font-size"));
+      var tar = evt.target,
+          style = tar.ownerDocument.defaultView.getComputedStyle(tar, ""),
+          fontSize = parseFloat(style.getPropertyValue("font-size")),
+          ts = tar._tar.style,
+          ctm = tar.getScreenCTM(),
+          po = tar.ownerDocument.documentElement.createSVGPoint(),
+          fillOpacity = parseFloat(style.getPropertyValue("fill-opacity")),
+          ttfia;
       tar.x.baseVal._emToUnit(fontSize);
       tar.y.baseVal._emToUnit(fontSize);
       tar.width.baseVal._emToUnit(fontSize);
       tar.height.baseVal._emToUnit(fontSize);
-      var ts = tar._tar.style;
       ts.position = "absolute";
-      var ctm = tar.getScreenCTM();
-      var po = tar.ownerDocument.documentElement.createSVGPoint();
       po.x = tar.x.baseVal.value;
       po.y = tar.y.baseVal.value;
       po = po.matrixTransform(ctm);
@@ -1576,12 +1582,12 @@
       ts.top = po.y + "px";
       ts.width = tar.width.baseVal.value * ctm.a + "px";
       ts.height = tar.height.baseVal.value * ctm.d + "px";
-      var fillOpacity = parseFloat(style.getPropertyValue("fill-opacity"));
       if (fillOpacity !== 1) {
         ts.filter = "progid:DXImageTransform.Microsoft.Alpha";
-        var ttfia = tar._tar.filters.item('DXImageTransform.Microsoft.Alpha');
+        ttfia = tar._tar.filters.item('DXImageTransform.Microsoft.Alpha');
         ttfia.Style = 0;
         ttfia.Opacity = fillOpacity * 100;
+        ttfia = null;
       }
       evt = tar = style = fontSize = ts = ctm = po = fillOpacity = null;
     }, false);




Sie-announce メーリングリストの案内
Back to archive index