[Sie-announce] SIEコード [1963] SVGUseElementオブジェクトの実装開始

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 7月 22日 (木) 23:36:01 JST


Revision: 1963
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1963
Author:   dhrname
Date:     2010-07-22 23:36:01 +0900 (Thu, 22 Jul 2010)

Log Message:
-----------
SVGUseElementオブジェクトの実装開始

Modified Paths:
--------------
    branches/06x/061/org/w3c/dom/svg.js

Modified: branches/06x/061/org/w3c/dom/svg.js
===================================================================
--- branches/06x/061/org/w3c/dom/svg.js	2010-07-22 13:01:01 UTC (rev 1962)
+++ branches/06x/061/org/w3c/dom/svg.js	2010-07-22 14:36:01 UTC (rev 1963)
@@ -865,8 +865,8 @@
           }
           if (ui === 0) { //URIが#で始まるのであれば
             var doc = tar.ownerDocument, ele = doc.getElementById(id);
-            tar._instance = doc.importNode(ele);
-            var ev = tar.ownerDocument.createEvent("SVGEvents");
+            tar._instance = ele;
+            var ev = doc.createEvent("SVGEvents");
             ev.initEvent("SVGLoad", false, false);
             tar.dispacthEvent(ev);
             ev = null;
@@ -1274,6 +1274,27 @@
   /*readonly SVGAnimatedLength*/   this.height = new SVGAnimatedLength();
   /*readonly SVGElementInstance*/ this.instanceRoot = new SVGElementInstance(); //参照先インスタンスのルート
   /*readonly SVGElementInstance*/ this.animatedInstanceRoot = new SVGElementInstance();//アニメの最中のインスタンス。静止中は通常
+  this.addEventListener("DOMAttrModified", function(evt){
+    if (evt.eventPhase === Event.BUBBLING_PHASE) {
+      return;
+    }
+    evt.target._gtar.dipacthEvent(evt);
+  }, false);
+  this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
+    var tar = evt.target;
+    if (!!!tar._gtar) {
+      tar._gtar = tar.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "g");
+    }
+    tar._gtar.appendChild(this.instanceRoot);
+    var tgtb = tar._gtar.transform.baseVal;
+    tgtb.getItem(tgtb.numberOfItems).setTranslate(tar.x.baseVal.value, tar.y.baseVal.value);
+    tar = tgtb = null;
+  }, false);
+  this.addEventListener("SVGLoad", function(evt){
+    var tar = evt.target;
+    tar.instanceRoot = tar.animatedInstanceRoot = tar.ownerDocument.importNode(tar._instance, true);
+    tar = null;
+  }, false);
   SVGURIReference.apply(this);
   return this;
 };




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