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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 7月 4日 (日) 21:22:51 JST


Revision: 1922
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1922
Author:   dhrname
Date:     2010-07-04 21:22:51 +0900 (Sun, 04 Jul 2010)

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


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

Modified: branches/06x/061/org/w3c/dom/events.js
===================================================================
--- branches/06x/061/org/w3c/dom/events.js	2010-07-03 14:26:37 UTC (rev 1921)
+++ branches/06x/061/org/w3c/dom/events.js	2010-07-04 12:22:51 UTC (rev 1922)
@@ -400,6 +400,16 @@
    *挿入されたときに発火する。間接的な挿入とは、サブツリーを作っておいて、それをいっぺんに挿入する場合など。
    *このイベントは浮上しないことに注意を要する
    */
+  var te = this, s;
+  //配列sに、このノードからドキュメントノードにいたるまでの、DOMツリーのリストを作成しておく
+  do {
+    s = te;
+    te = te.parentNode;
+  } while (te);
+  if (s !== this.ownerDocument.documentElement) {
+    evt = s = null;
+    return;
+  }
   evt = this.ownerDocument.createEvent("MutationEvents");
   evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
   n.dispatchEvent(evt);

Modified: branches/06x/061/org/w3c/dom/svg.js
===================================================================
--- branches/06x/061/org/w3c/dom/svg.js	2010-07-03 14:26:37 UTC (rev 1921)
+++ branches/06x/061/org/w3c/dom/svg.js	2010-07-04 12:22:51 UTC (rev 1922)
@@ -809,9 +809,6 @@
       return; //強制終了させる
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target;
       /*xlink:href属性とxml:base属性を手がかりに、
        *ハイパーリンクのURIを決定する処理を行う
@@ -1041,16 +1038,6 @@
     }
     evt = name = null;
   }, false);  
-  this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
-    var tar = evt.target;
-    if (evt.eventPhase === Event.CAPTURING_PHASE) {
-      /*svg要素にまだ、挿入されていない要素については、描画を始めるべきではない。
-       *_isPassedがundefinedならば、まだ挿入されていないことになり、描画しないようにする
-       */
-      evt._isPassed = 1;
-    }
-    evt = tar = null;
-  }, true);
   return this;
 };
 SVGSVGElement.constructor = SVGElement;
@@ -2278,9 +2265,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
-      if (!!!evt._isPassed) {
-        return;
-      }
       /*以下の処理は、normalizedpathSegListとCTMに基づいて、
        *SVGのd属性をVMLに変換していく処理である。
        */
@@ -2506,9 +2490,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target;
       var rx = tar.hasAttributeNS(null, "rx"), ry = tar.hasAttributeNS(null, "ry");
       var x = tar.x.baseVal.value, y = tar.y.baseVal.value, xw = x + tar.width.baseVal.value, yh = y + tar.height.baseVal.value;
@@ -2584,9 +2565,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target;
       var cx = tar.cx.baseVal.value, cy = tar.cy.baseVal.value, rx = ry = tar.r.baseVal.value;
       var top = cy - ry, left = cx - rx, bottom = cy + ry, right = cx + rx;
@@ -2645,9 +2623,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target;
       var cx = tar.cx.baseVal.value, cy = tar.cy.baseVal.value, rx = tar.rx.baseVal.value, ry = tar.ry.baseVal.value;
       var top = cy - ry, left = cx - rx, bottom = cy + ry, right = cx + rx;
@@ -2706,9 +2681,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target;
       var list = ["m", tar.x1.baseVal.value, tar.y1.baseVal.value, "l", tar.x2.baseVal.value, tar.y2.baseVal.value];
       //以下は、配列listそのものをCTMで座標変換していく処理
@@ -2780,9 +2752,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target, tp = tar.points;
       //以下は、配列listそのものをCTMで座標変換していく処理
       var ctm = tar.getScreenCTM();
@@ -2846,9 +2815,6 @@
       tar.parentNode._tar.appendChild(tar._tar);
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target, tp = tar.points;
       //以下は、配列listそのものをCTMで座標変換していく処理
       var ctm = tar.getScreenCTM();
@@ -2906,9 +2872,6 @@
     }
     var tar = evt.target;
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target, ti = tar.firstChild, tp = tar.parentNode;
       tar._list = [];   //文字の位置を格納しておくリスト
       var x = 0, y = 0, n = 0; //現在のテキスト位置と順番
@@ -3166,9 +3129,6 @@
       }
     }
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-      if (!!!evt._isPassed) {
-        return;
-      }
       var tar = evt.target, ti = tar.firstChild;
       var style = tar.ownerDocument.defaultView.getComputedStyle(tar, null);
       var n = parseFloat(style.getPropertyValue("font-size")) * Math.sqrt(Math.abs(tar.getScreenCTM()._determinant()));
@@ -3383,9 +3343,6 @@
   /*readonly SVGAnimatedTransformList*/ this.gradientTransform = new SVGAnimatedTransformList();
   /*readonly SVGAnimatedEnumeration*/   this.spreadMethod = new SVGAnimatedEnumeration();
   this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-    if (!!!evt._isPassed) {
-      return;
-    }
     var grad = evt.target, ele = evt._tar, t = evt._style; //eleはv:fill要素やv:stroke要素のノード、tはラップした要素ノードのスタイルを収納
     if (!!!ele) { //まだ、path要素などが設定されていない場合
       return;
@@ -3437,17 +3394,14 @@
   /*readonly SVGAnimatedLength*/ this.x2 = new SVGAnimatedLength();
   /*readonly SVGAnimatedLength*/ this.y2 = new SVGAnimatedLength();
   this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-    if (!!!evt._isPassed) {
+    var grad = evt.target, ele = evt._tar, angle = 270;
+    if (!!!ele) { //まだ、path要素などが設定されていない場合
       return;
     }
-      var grad = evt.target, ele = evt._tar, angle = 270;
-      if (!!!ele) { //まだ、path要素などが設定されていない場合
-        return;
-      }
-      angle = 270 - Math.atan2(grad.y2.baseVal.value-grad.y1.baseVal.value, grad.x2.baseVal.value-grad.x1.baseVal.value) * 180 / Math.PI;
-      if (angle >= 360) {
-        angle -= 360;
-      }
+    angle = 270 - Math.atan2(grad.y2.baseVal.value-grad.y1.baseVal.value, grad.x2.baseVal.value-grad.x1.baseVal.value) * 180 / Math.PI;
+    if (angle >= 360) {
+      angle -= 360;
+    }
     ele.setAttribute("type", "gradient");
     ele.setAttribute("angle", angle + "");
     evt = ele = grad = angle = null;
@@ -3465,9 +3419,6 @@
   /*readonly SVGAnimatedLength*/ this.fx = new SVGAnimatedLength();
   /*readonly SVGAnimatedLength*/ this.fy = new SVGAnimatedLength();
   this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) {
-    if (!!!evt._isPassed) {
-      return;
-    }
     var grad = evt.target, ele = evt._tar, tar = evt._ttar; //eleはv:fill要素。tarはターゲットとになる要素
     if (!!!ele) { //まだ、path要素などが設定されていない場合
       return;
@@ -3699,9 +3650,6 @@
     tar = evt = null;
   }, false);
   this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
-    if (!!!evt._isPassed) {
-      return;
-    }
     var tar = evt.target;
     if (tar._tar) {
       var txts = tar._tar.style;




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