[Sie-announce] SIEコード [1987]

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 9月 5日 (日) 23:10:39 JST


Revision: 1987
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1987
Author:   dhrname
Date:     2010-09-05 23:10:39 +0900 (Sun, 05 Sep 2010)

Log Message:
-----------


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-09-04 14:15:16 UTC (rev 1986)
+++ branches/06x/061/org/w3c/dom/svg.js	2010-09-05 14:10:39 UTC (rev 1987)
@@ -4060,6 +4060,7 @@
   this.style.setProperty = function(){};
   this._tar = null;
   /*readonly SVGElement*/ this.targetElement;
+  this._beginValue = this._endValue = null;
   this._currentFrame = 0;
   this._currentCount = 0;
   /*_maxCountはrepeatCount属性で指定された数値
@@ -4098,7 +4099,29 @@
   this.addEventListener("DOMAttrModified", function(evt){
     var tar = evt.target, name = evt.attrName;
     if (name === "begin") {
-      tar._eventSync(evt.newValue,
+      tar._beginValue = evt.newValue;
+    } else if (name === "end") {
+      tar._endValue = evt.newValue;
+    } else if (name === "dur") {
+      tar._simpleDuration = tar._getOffset(evt.newValue);
+    } else if (name === "repeatCount") {
+      tar._maxCount = parseFloat(evt.newValue);
+      tar._isRepeat = true;
+    } else if (name === "repeatDur") {
+      tar._maxDur = parseFloat(evt.newValue);
+      tar._isRepeat = true;
+    }
+    evt = null;
+  }, false);
+  this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
+    var tar = evt.target;
+    if (tar.hasAttributeNS("http://www.w3.org/1999/xlink", "xlink:href")) {
+      tar.targetElement = tar.ownerDocument.getElementById(tar.getAttributeNS("http://www.w3.org/1999/xlink", "xlink:href").substring(1))
+    } else {
+      tar.targetElement = tar.parentNode;
+    }
+    if (tar._beginValue) {
+      tar._eventSync(tar._beginValue,
           (function(te, offse, ta, t) {
             ta.addEventListener( t.match(te._eventRegExp)[0],
               function(){
@@ -4111,29 +4134,18 @@
                 }
               }, false);
             }), "beginElementAt");
-    } else if (name === "end") {
-      tar._eventSync(evt.newValue,
+    }
+    if (tar._endValue) {
+      tar._eventSync(tar._endValue,
           (function(te, offse, ta, t) {
             ta.addEventListener( t.match(te._eventRegExp)[0],
                 function(){
                   te.endElementAt(offse);
                 }, false );
             }), "endElementAt");
-    } else if (name === "dur") {
-      tar._simpleDuration = tar._getOffset(evt.newValue);
-    } else if (name === "repeatCount") {
-      tar._maxCount = parseFloat(evt.newValue);
-      tar._isRepeat = true;
-    } else if (name === "repeatDur") {
-      tar._maxDur = parseFloat(evt.newValue);
-      tar._isRepeat = true;
     }
-    evt = null;
+    evt = tar = null;
   }, false);
-  this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
-    evt.target.targetElement = evt.target.parentNode;
-    evt = null;
-  }, false);
   this.addEventListener("repeatEvent", function(evt) {
     var tar = evt.target;
     if ((tar._currentCount >= tar._maxCount) || (tar.getCurrentTime() >= (tar._maxDur+tar.getStartTime()))) {
@@ -4170,8 +4182,8 @@
   this._begin = NAIBU.Time.Max;
   if ( /(mouse|activ|click)/.test(t) ) { //イベントがある場合
     var tar;
-    if ( /\.\D/.test(t) ) {
-      tar = this.ownerDocument.getElementById( t.substring(0, t.indexOf(".")) );
+    if ( /([^;]+)\.\D/.test(t) ) {
+      tar = this.ownerDocument.getElementById(RegExp.$1);
     } else {
       tar = this.targetElement;
     }




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