[Sie-announce] SIEコード [2353] 0. 69 統合

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 2月 1日 (火) 23:12:54 JST


Revision: 2353
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2353
Author:   dhrname
Date:     2011-02-01 23:12:54 +0900 (Tue, 01 Feb 2011)

Log Message:
-----------
0.69 統合

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

Property Changed:
----------------
    branches/06x/org/
    branches/06x/org/w3c/
    branches/06x/org/w3c/core.js
    branches/06x/org/w3c/dom/css.js
    branches/06x/org/w3c/dom/events.js
    branches/06x/org/w3c/dom/svg.js


Property changes on: branches/06x/org
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org:1864-2067
/branches/06x/062/org:2071-2106
/branches/06x/063/org:2110-2146
/branches/06x/064/org:2149-2177
/branches/06x/065/org:2179-2209
/branches/06x/066/org:2211-2236
/branches/06x/067/org:2257-2282
/branches/06x/068/org:2284-2314
   + /branches/06x/061/org:1864-2067
/branches/06x/062/org:2071-2106
/branches/06x/063/org:2110-2146
/branches/06x/064/org:2149-2177
/branches/06x/065/org:2179-2209
/branches/06x/066/org:2211-2236
/branches/06x/067/org:2257-2282
/branches/06x/068/org:2284-2314
/branches/06x/069/org:2317-2352


Property changes on: branches/06x/org/w3c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c:1864-2067
/branches/06x/062/org/w3c:2071-2106
/branches/06x/063/org/w3c:2110-2146
/branches/06x/064/org/w3c:2149-2177
/branches/06x/065/org/w3c:2179-2209
/branches/06x/066/org/w3c:2211-2236
/branches/06x/067/org/w3c:2257-2282
/branches/06x/068/org/w3c:2284-2314
/branches/ufltima:1621-1788
   + /branches/06x/061/org/w3c:1864-2067
/branches/06x/062/org/w3c:2071-2106
/branches/06x/063/org/w3c:2110-2146
/branches/06x/064/org/w3c:2149-2177
/branches/06x/065/org/w3c:2179-2209
/branches/06x/066/org/w3c:2211-2236
/branches/06x/067/org/w3c:2257-2282
/branches/06x/068/org/w3c:2284-2314
/branches/06x/069/org/w3c:2317-2352
/branches/ufltima:1621-1788


Property changes on: branches/06x/org/w3c/core.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/core.js:1864-2067
/branches/06x/062/org/w3c/core.js:2071-2106
/branches/06x/063/org/w3c/core.js:2110-2146
/branches/06x/064/org/w3c/core.js:2149-2177
/branches/06x/065/org/w3c/core.js:2179-2209
/branches/06x/066/org/w3c/core.js:2211-2244
/branches/06x/067/org/w3c/core.js:2257-2282
/branches/06x/068/org/w3c/core.js:2284-2314
/branches/ufltima/core.js:1621-1854
   + /branches/06x/061/org/w3c/core.js:1864-2067
/branches/06x/062/org/w3c/core.js:2071-2106
/branches/06x/063/org/w3c/core.js:2110-2146
/branches/06x/064/org/w3c/core.js:2149-2177
/branches/06x/065/org/w3c/core.js:2179-2209
/branches/06x/066/org/w3c/core.js:2211-2244
/branches/06x/067/org/w3c/core.js:2257-2282
/branches/06x/068/org/w3c/core.js:2284-2314
/branches/06x/069/org/w3c/core.js:2317-2352
/branches/ufltima/core.js:1621-1854


Property changes on: branches/06x/org/w3c/dom/css.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/css.js:1864-2067
/branches/06x/062/org/w3c/dom/css.js:2071-2106
/branches/06x/063/org/w3c/dom/css.js:2110-2146
/branches/06x/064/org/w3c/dom/css.js:2149-2177
/branches/06x/065/org/w3c/dom/css.js:2179-2209
/branches/06x/066/org/w3c/dom/css.js:2211-2236
/branches/06x/067/org/w3c/dom/css.js:2257-2282
/branches/06x/068/org/w3c/dom/css.js:2284-2314
/branches/ufltima/dom/css.js:1621-1855
   + /branches/06x/061/org/w3c/dom/css.js:1864-2067
/branches/06x/062/org/w3c/dom/css.js:2071-2106
/branches/06x/063/org/w3c/dom/css.js:2110-2146
/branches/06x/064/org/w3c/dom/css.js:2149-2177
/branches/06x/065/org/w3c/dom/css.js:2179-2209
/branches/06x/066/org/w3c/dom/css.js:2211-2236
/branches/06x/067/org/w3c/dom/css.js:2257-2282
/branches/06x/068/org/w3c/dom/css.js:2284-2314
/branches/06x/069/org/w3c/dom/css.js:2317-2352
/branches/ufltima/dom/css.js:1621-1855

Modified: branches/06x/org/w3c/dom/events.js
===================================================================
--- branches/06x/org/w3c/dom/events.js	2011-02-01 13:57:48 UTC (rev 2352)
+++ branches/06x/org/w3c/dom/events.js	2011-02-01 14:12:54 UTC (rev 2353)
@@ -96,7 +96,7 @@
 function EventException() {
   DOMException.call(this,arguments);
   if (this.code === 0) {
-    this.message = "Uuspecified Event Type Error (イベントの型を定義されましたか)";
+    this.message = "Uuspecified Event Type Error";
   }
   return this;
 };
@@ -140,30 +140,55 @@
   if (!evt.type || evt.type === "") { //Eventの型が設定されていないとき
     throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR);
   }
+  if (!this.ownerDocument._isLoaded) {
+    if (evt.type === "SVGLoad") {
+      this.ownerDocument._isLoaded = 1;
+    }
+    if (!this.ownerDocument._limit_time_) {
+      this.ownerDocument._limit_time_ = evt.timeStamp;
+    } else {
+      var time = this.ownerDocument._limit_time_;
+      if ((evt.timeStamp - time) > 1000) {
+        if (this.ownerDocument.implementation._buffer_) {
+          /*1秒を超えたらバッファにため込んで後で使う*/
+          var tob = this.ownerDocument.implementation._buffer_;
+          tob[tob.length] = this;
+          tob[tob.length] = evt;
+        } else {
+          this.ownerDocument.implementation._buffer_ = [];
+        }
+        return true;
+      }
+    }
+  }
   evt.target = this;
   evt.eventPhase = 1;//Event.CAPTURING_PHASE
-  var te = this, s = [];
-  //配列sに、このノードからドキュメントノードにいたるまでの、DOMツリーのリストを作成しておく
-  do {
-    s[s.length] = te;
+  var te = this;
+  //このノードからドキュメントノードにいたるまでの、DOMツリーのリストを作成しておく
+  var td = this.ownerDocument;
+  td[/*Event.BUBBLING_PHASE*/ 3] = null;
+  /*以下の処理では、documentElementのparentNodeが
+   *Documentノードではなく、nullになっていることを前提としている。
+   *したがって、documentElementのparentNodeがもし、Documentノードのオブジェクトならば、以下を書き換えるべきである
+   */
+  while (te.parentNode) {
+    te.parentNode[/*Event.CAPTURING_PHASE*/ 1] = te;
+    te[/*Event.BUBBLING_PHASE*/ 3] = te.parentNode;
     te = te.parentNode;
-  } while (te);
-  s[s.length] = this.ownerDocument;
+  }
+  td[/*Event.CAPTURING_PHASE*/ 1] = te;
+  te[/*Event.BUBBLING_PHASE*/ 3] = td;
   /*最初に捕獲フェーズでDOMツリーを下っていき、イベントのターゲットについたら、
    *そこで、浮上フェーズとして折り返すように、反復処理をおこなう。
-   *nは捕獲フェーズの段階で1、浮上フェーズに切り替わったら-1となる
-   *
    */
-  for (var i=0, n=1, d=0, tce = null, sli = s.length, slii = sli*2-1;i<slii;++i){
-    var d = sli - i - 1;
-    if (d === 0){ //イベントのターゲットに到着(折り返し地点)
-      n = -1;
-      evt.eventPhase = 2;//Event.AT_TARGET;
-      evt.currentTarget = evt.target;
-    } else {
-      evt.currentTarget = s[d*n];
+  var type = /*Event.CAPTURING_PHASE*/ 1;
+  while (td) {
+    evt.currentTarget = td;
+    if (td === this) { //イベントのターゲットに到着(折り返し地点)
+      type = 2;//Event.AT_TARGET;
     }
-    tce = evt.currentTarget._capter; //tceは登録しておいたリスナーのリスト
+    evt.eventPhase = type;
+    var tce = td._capter; //tceは登録しておいたリスナーのリスト
     for (var j=0,tcli=tce.length;j<tcli;++j){
       if (tce[j]) {
         tce[j].handleEvent(evt);
@@ -173,15 +198,16 @@
     if (evt._stop) {
       break; //stopPropagationメソッドが呼ばれたら、停止する
     }
-    if (d === 0) {
+    if (td === this) {
       if (!evt.bubbles) {
         break; //浮上フェーズに移行せず、停止する
       }
-      evt.eventPhase = 3;//Event.BUBBLING_PHASE;
+      type = 3;//Event.BUBBLING_PHASE;
     }
+    td = td[type];
   }
   var ed = evt._default
-  evt = te = s = d = tce = n = sli = slii = dn = i = null;
+  evt = te = s = d = tce = n = td = type = null;
   return ed;
 };
 


Property changes on: branches/06x/org/w3c/dom/events.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/events.js:1864-2067
/branches/06x/062/org/w3c/dom/events.js:2071-2106
/branches/06x/063/org/w3c/dom/events.js:2110-2146
/branches/06x/064/org/w3c/dom/events.js:2149-2177
/branches/06x/065/org/w3c/dom/events.js:2179-2209
/branches/06x/066/org/w3c/dom/events.js:2211-2244
/branches/06x/067/org/w3c/dom/events.js:2257-2282
/branches/06x/068/org/w3c/dom/events.js:2284-2314
/branches/ufltima/dom/events.js:1621-1856
   + /branches/06x/061/org/w3c/dom/events.js:1864-2067
/branches/06x/062/org/w3c/dom/events.js:2071-2106
/branches/06x/063/org/w3c/dom/events.js:2110-2146
/branches/06x/064/org/w3c/dom/events.js:2149-2177
/branches/06x/065/org/w3c/dom/events.js:2179-2209
/branches/06x/066/org/w3c/dom/events.js:2211-2244
/branches/06x/067/org/w3c/dom/events.js:2257-2282
/branches/06x/068/org/w3c/dom/events.js:2284-2314
/branches/06x/069/org/w3c/dom/events.js:2317-2352
/branches/ufltima/dom/events.js:1621-1856

Modified: branches/06x/org/w3c/dom/svg.js
===================================================================
--- branches/06x/org/w3c/dom/svg.js	2011-02-01 13:57:48 UTC (rev 2352)
+++ branches/06x/org/w3c/dom/svg.js	2011-02-01 14:12:54 UTC (rev 2353)
@@ -286,19 +286,6 @@
         }
       }
     }
-    if (tar.parentNode) {
-      var evtt = tar.ownerDocument.createEvent("MutationEvents");
-      evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
-      evtt.target = tar;
-      evtt.eventPhase = Event.AT_TARGET;
-      var tce = tar._capter; //tceは登録しておいたリスナーのリスト
-      for (var j=0,tcli=tce.length;j<tcli;++j){
-        if (tce[j]) {
-          tce[j].handleEvent(evtt);
-        }
-      }
-      evtt = null;
-    }
     evt = _parseFloat = name = tar = null;
   }, false);
   return this;
@@ -1148,7 +1135,30 @@
       tar.viewport.height = tar.height.baseVal.value;
     }
     evt = name = null;
-  }, false);  
+  }, false);
+  this.addEventListener("SVGLoad", function(evt){
+    this.addEventListener("DOMAttrModified", function(evt){
+      if (evt.eventPhase === Event.BUBBLING_PHASE) {
+        var tar = evt.target;
+        if (tar.parentNode) {
+          var evtt = tar.ownerDocument.createEvent("MutationEvents");
+          evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null);
+          evtt.target = tar;
+          evtt.eventPhase = Event.AT_TARGET;
+          var tce = tar._capter; //tceは登録しておいたリスナーのリスト
+          for (var j=0,tcli=tce.length;j<tcli;++j){
+            if (tce[j]) {
+              tce[j].handleEvent(evtt);
+            }
+          }
+          evtt = null;
+        }
+        tar = null;
+      }
+      evt = null;
+    }, false);
+    evt = null;
+  }, true);
   return this;
 };
 SVGSVGElement.constructor = SVGElement;
@@ -1675,15 +1685,35 @@
         }
       }
       s.defaultView._cache = s.defaultView._cache_ele = null;
-      s = evt = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = w = h = sw = sh = null;
+      evt = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = w = h = sw = sh = null;
       trstyle = tpstyle = backrs = viewWidth = viewHeight = text = bfl = bft = bl = bt = backdown = backright = null;
       /*IEのメモリリーク対策として、空関数を入力*/
       this.xmlhttp.onreadystatechange = NAIBU.emptyFunction;
       alert(+(new Date()) - dsd.getTime())
       if (this._next) {
+        s = null;
         this._next._init();
       } else {
         /*全要素の読み込みが終了した場合*/
+        if (s.implementation._buffer_) {
+          /*以下はバッファリングにためておいた要素とイベントを、後から実行する*/
+          NAIBU._buff = setInterval(function(){
+            if (DOMImplementation._buffer_.length === 0) {
+              clearInterval(Event._buff);              
+            }
+            for (var i=0;i<50;++i) {
+              var s = DOMImplementation._buffer_.shift(), evt = DOMImplementation._buffer_.shift();
+              s.dispatchEvent(evt);
+              s = evt = null;
+              if (!DOMImplementation._buffer_[1]) {
+                clearInterval(NAIBU._buff);
+                DOMImplementation._buffer_ = null;
+                return;
+              }
+            }
+          }, 1);
+        }
+        s = null;
         NAIBU.Time.start();
         delete NAIBU.doc;
       }
@@ -1780,13 +1810,13 @@
     if (n !== 0) {
       s.a = this.d / n;
       s.b = -this.b / n;
-      s.c = this.c / n;
+      s.c = -this.c / n;
       s.d = this.a / n;
       s.e = (this.c * this.f - this.d * this.e) / n;
       s.f = (this.b * this.e - this.a * this.f) / n;
       return s;
     } else {
-      throw (new SVGException(SVGException.SVG_MATRIX_NOT_INVERTABLE))
+      throw (new SVGException(SVGException.SVG_MATRIX_NOT_INVERTABLE));
     }
   },
   /*SVGMatrix*/ translate : function(/*float*/ x, /*float*/ y ) {
@@ -1820,17 +1850,21 @@
     m.c = -m.b;
     m.d = m.a;
     var s =  this.multiply(m);
-    m = null;
+    m = rad = null;
     return s;
   },
   //座標(x, y)と原点の角度の分だけ、回転する
   /*SVGMatrix*/ rotateFromVector : function(/*float*/ x, /*float*/ y ) {
-    if (x === 0 || y === 0) {
+    if ((x === 0) || (y === 0) || !isFinite(x) || !isFinite(y)) {
       throw (new SVGException(SVGException.SVG_INVALID_VALUE_ERR))
     }
-    var m = this.rotate(Math.atan2(y, x));
+    var m = new SVGMatrix(), rad = Math.atan2(y, x);
+    m.a = Math.cos(rad);
+    m.b = Math.sin(rad);
+    m.c = -m.b;
+    m.d = m.a;
     var s =  this.multiply(m);
-    m = null;
+    m = rad = null;
     return s;
   },
   /*SVGMatrix*/ flipX : function() {
@@ -2647,32 +2681,26 @@
        */
       var tar = evt.target, matrix = tar.getScreenCTM(), tlist = tar.normalizedPathSegList, _parseInt = parseInt;
       var dat = [], ma = matrix.a, mb = matrix.b, mc = matrix.c, md = matrix.d, me = matrix.e, mf = matrix.f;
-      var isZ = tar._com._isZ, isM = tar._com._isM, isL = tar._com._isL, isC = tar._com._isC;
+      var cname = tar._com._nameCom, isZ = tar._com._isZ, isC = tar._com._isC;
       for (var i=0, tli=tlist.numberOfItems;i<tli;++i) {
         var ti = tlist.getItem(i), tps = ti.pathSegTypeAsLetter;
-        /*IE6の高速化のために、以下では、x += "";のような文字連結ではなくて、
-         *x[data.length] = "";という形をとった
-         */
-        if (isZ[tps]) {
-          dat[dat.length] = " x ";
-        } else {
-          if (isM[tps]) {
-            dat[dat.length] = "m";
-          } else if (isL[tps]) {
-            dat[dat.length] = "l";
-          } else if (isC[tps]) {
-            dat[dat.length] = "c";
-            /*CTM(mx)の行列と座標(x, y)の積を算出する。数学における表現は以下のとおり
-             *[ma mc me]   [x]
-             *[mb md mf] * [y]
-             *[0  0  1 ]   [1]
-             */
-
-            dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10)+ " " +_parseInt(mb*ti.x1 + md*ti.y1 + mf, 10);
-            dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10)+ " " +_parseInt(mb*ti.x2 + md*ti.y2 + mf, 10);
-          }
-          dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10)+ " " +_parseInt(mb*ti.x + md*ti.y + mf, 10);
+        var t = cname[tps];
+        if (isC[tps]) {
+          /*CTM(mx)の行列と座標(x, y)の積を算出する。数学における表現は以下のとおり
+           *[ma mc me]   [x]
+           *[mb md mf] * [y]
+           *[0  0  1 ]   [1]
+           */
+          t += ([_parseInt(ma*ti.x1 + mc*ti.y1 + me, 10),
+                 _parseInt(mb*ti.x1 + md*ti.y1 + mf, 10),
+                 _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10),
+                 _parseInt(mb*ti.x2 + md*ti.y2 + mf, 10),
+                 _parseInt(ma*ti.x + mc*ti.y + me, 10),
+                 _parseInt(mb*ti.x + md*ti.y + mf, 10)]).join(" ");
+        } else if (!isZ[tps]) {
+          t += _parseInt(ma*ti.x + mc*ti.y + me, 10)+ " " +_parseInt(mb*ti.x + md*ti.y + mf, 10);
         }
+        dat[i] = t;
       }
       var vi = tar.ownerDocument.documentElement;
       var w = vi.width.baseVal.value, h = vi.height.baseVal.value;
@@ -2681,7 +2709,7 @@
       tar._tar.coordsize = w + " " + h;
       NAIBU._setPaint(tar, matrix);
       delete tar._cacheMatrix, tar._currentStyle;
-      evt = tar = dat = w = h = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isM = isL = isC = i = tli = tps = ti = null;
+      evt = tar = dat = t = w = h = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isC = i = tli = tps = ti = cname = null;
     }, false);
     evt = tar = null;
   }, false);
@@ -2690,6 +2718,13 @@
 SVGPathElement.constructor = SVGElement;
 SVGPathElement.prototype = new SVGElement();
 SVGPathElement.prototype._com = {
+  _nameCom : {
+    z : " x ",
+    Z : " x ",
+    C : "c",
+    L : "l",
+    M : "m"
+  },
   _isZ : {
     z : 1,
     Z : 1
@@ -5165,6 +5200,10 @@
     }
     tar._frame = function() {
       var _tar = tar;
+      /*公式に関しては、SMIL2.0 Animation Moduleの単純アニメーション関数の項を参照
+       * 3.4.2 Specifying the simple animation function f(t)
+       *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction
+       */
       var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 1, tg = _tar.getCurrentTime();
       if ((n !== -1) && (d !== 0) && (tg <= d)) {
         var ii = Math.floor((tg*n) / d);


Property changes on: branches/06x/org/w3c/dom/svg.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/svg.js:1864-2067
/branches/06x/062/org/w3c/dom/svg.js:2071-2106
/branches/06x/063/org/w3c/dom/svg.js:2110-2146
/branches/06x/064/org/w3c/dom/svg.js:2149-2177
/branches/06x/065/org/w3c/dom/svg.js:2179-2209
/branches/06x/066/org/w3c/dom/svg.js:2211-2239
/branches/06x/067/org/w3c/dom/svg.js:2257-2282
/branches/06x/068/org/w3c/dom/svg.js:2284-2314
/branches/06x/069/org/w3c/dom/svg.js:2329-2331
/branches/ufltima/dom/svg.js:1621-1856
   + /branches/06x/061/org/w3c/dom/svg.js:1864-2067
/branches/06x/062/org/w3c/dom/svg.js:2071-2106
/branches/06x/063/org/w3c/dom/svg.js:2110-2146
/branches/06x/064/org/w3c/dom/svg.js:2149-2177
/branches/06x/065/org/w3c/dom/svg.js:2179-2209
/branches/06x/066/org/w3c/dom/svg.js:2211-2239
/branches/06x/067/org/w3c/dom/svg.js:2257-2282
/branches/06x/068/org/w3c/dom/svg.js:2284-2314
/branches/06x/069/org/w3c/dom/svg.js:2317-2352
/branches/ufltima/dom/svg.js:1621-1856




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