[Sie-announce] SIEコード [2317] 0. 68モジュール結合

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2011年 1月 21日 (金) 19:40:17 JST


Revision: 2317
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2317
Author:   dhrname
Date:     2011-01-21 19:40:17 +0900 (Fri, 21 Jan 2011)

Log Message:
-----------
0.68モジュール結合

Modified Paths:
--------------
    branches/06x/sie.js

Modified: branches/06x/sie.js
===================================================================
--- branches/06x/sie.js	2011-01-21 10:33:39 UTC (rev 2316)
+++ branches/06x/sie.js	2011-01-21 10:40:17 UTC (rev 2317)
@@ -1247,26 +1247,28 @@
 
 function MutationEvent(){
   Event.call(this);
-/*Node*/  this.relatedNode;
-/*string*/  this.prevValue;
-/*string*/  this.newValue;
-/*string*/  this.attrName;
-/*unsigned short*/  this.attrChange;
   return this;
 };
 MutationEvent.prototype = new Event();
 MutationEvent.constructor = Event;
-/*void*/  MutationEvent.prototype.initMutationEvent = function(/*string*/ typeArg, /*boolean*/ canBubbleArg,
+(function() {
+/*void*/  this.initMutationEvent = function(/*string*/ typeArg, /*boolean*/ canBubbleArg,
     /*boolean*/ cancelableArg, /*Node*/ relatedNodeArg, /*string*/ prevValueArg, /*string*/ newValueArg,
     /*string*/ attrNameArg, /*unsigned short*/ attrChangeArg) {
-  this.initEvent(typeArg, canBubbleArg, cancelableArg);
-  this.relatedNode = relatedNodeArg;
-  this.prevValue = prevValueArg;
-  this.newValue = newValueArg;
-  this.attrName = attrNameArg;
-  this.attrChange = attrChangeArg;
-  typeArg = canBubbleArg = cancelableArg = relatedNodeArg = prevValueArg = newValueArg = attrNameArg = attrChangeArg = null;
-};
+    this.initEvent(typeArg, canBubbleArg, cancelableArg);
+    this.relatedNode = relatedNodeArg;
+    this.prevValue = prevValueArg;
+    this.newValue = newValueArg;
+    this.attrName = attrNameArg;
+    this.attrChange = attrChangeArg;
+    typeArg = canBubbleArg = cancelableArg = relatedNodeArg = prevValueArg = newValueArg = attrNameArg = attrChangeArg = null;
+  };
+  /*Node*/  this.relatedNode = null;
+  /*string*/  this.prevValue = null;
+  /*string*/  this.newValue = null;
+  /*string*/  this.attrName = null;
+  /*unsigned short*/  this.attrChange = 2;
+}).apply(MutationEvent.prototype);
     // attrChangeType
 /*unsigned short*/  MutationEvent.MODIFICATION  = 1;
 /*unsigned short*/  MutationEvent.ADDITION      = 2;
@@ -1288,7 +1290,11 @@
   /*ここから*/
   var evt = this.ownerDocument.createEvent("MutationEvents");
   if (!s) { //ノードがなければ
-    evt.initMutationEvent("DOMAttrModified", true, false, newAttr, null, newAttr.nodeValue, newAttr.nodeName, MutationEvent.ADDITION);
+    /*initMutationEventメソッドは軽量化のため省略する*/
+    evt.initEvent("DOMAttrModified", true, false);
+    evt.relatedNode = newAttr;
+    evt.newValue = newAttr.nodeValue;
+    evt.attrName = newAttr.nodeName;
   } else {
     evt.initMutationEvent("DOMAttrModified", true, false, newAttr, s.nodeValue, newAttr.nodeValue, newAttr.nodeName, MutationEvent.MODIFICATION);
   }
@@ -2871,12 +2877,8 @@
  *valueInSpecifiedUnitsプロパティはpxに統一する前の数値。valueプロパティはpxに統一した後の数値
  */
 function SVGLength() {
-  /*readonly attribute unsigned short*/ this.unitType = SVGLength.SVG_LENGTHTYPE_UNKNOWN;
-  /*attribute float*/          this.value = 0;                  //利用単位における値
-  /*attribute float*/          this.valueInSpecifiedUnits = SVGLength.SVG_LENGTHTYPE_UNKNOWN;  //unitTypeにおける値
-  /*attribute DOMString*/      this.valueAsString;
-  this._percent = 0.01; //単位に%が使われていた場合、このプロパティの数値を1%として使う
-  return this;};
+  return this;
+};
     // Length Unit Types
   /*const unsigned short*/ SVGLength.SVG_LENGTHTYPE_UNKNOWN    = 0;
   /*const unsigned short*/ SVGLength.SVG_LENGTHTYPE_NUMBER     = 1;
@@ -2890,13 +2892,21 @@
   /*const unsigned short*/ SVGLength.SVG_LENGTHTYPE_PT         = 9;
   /*const unsigned short*/ SVGLength.SVG_LENGTHTYPE_PC         = 10;
 
-SVGLength.prototype = {/*newValueSpedifiedUnitsメソッド
+SVGLength.prototype = {
+  /*readonly attribute unsigned short*/ unitType : SVGLength.SVG_LENGTHTYPE_UNKNOWN,
+  /*attribute float*/          value : 0,                  //利用単位における値
+  /*attribute float*/          valueInSpecifiedUnits : SVGLength.SVG_LENGTHTYPE_UNKNOWN,  //unitTypeにおける値
+  /*attribute DOMString*/      valueAsString : "0",
+  _percent : 0.01, //単位に%が使われていた場合、このプロパティの数値を1%として使う
+/*newValueSpedifiedUnitsメソッド
  *新しくunitTypeにおける値を設定する
  *例:2pxならば、x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 2);となる
  */
   newValueSpecifiedUnits : function (/*unsigned short*/ unitType, /*float*/ valueInSpecifiedUnits) {
     var n = 1, _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す
     if (unitType === SVGLength.SVG_LENGTHTYPE_NUMBER) {
+    } else if (unitType === SVGLength.SVG_LENGTHTYPE_PX) {
+      _s = "px";
     } else if (unitType === SVGLength.SVG_LENGTHTYPE_PERCENTAGE) {
       n = this._percent;
       _s = "%"
@@ -2920,11 +2930,13 @@
     } else if (unitType === SVGLength.SVG_LENGTHTYPE_PC) {
       n = 15;
       _s = "pc";
+    } else {
+      throw new DOMException(DOMException.NOT_SUPPORTED_ERR);
     }
     this.unitType = unitType;
     this.value = valueInSpecifiedUnits * n;
     this.valueInSpecifiedUnits = valueInSpecifiedUnits;
-    this.valuAsString = valueInSpecifiedUnits + _s;
+    this.valueAsString = valueInSpecifiedUnits + _s;
     n = _s = null;
   },
 /*convertToSpecifiedUnitsメソッド
@@ -2936,7 +2948,8 @@
  */
   convertToSpecifiedUnits : function (/*unsigned short*/ unitType) {
     this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits);
-  }};
+  }
+};
 function SVGAnimatedLength() {
   /*readonly SVGLength*/ this.animVal;
   this.baseVal = new SVGLength();
@@ -3333,7 +3346,7 @@
             if (tar.localName === "image") {
               tar._tar.src = uri;
             }
-            xmlhttp.open("GET", uri, true);
+            xmlhttp.open("GET", uri, false);
             xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
             xmlhttp.onreadystatechange = function() {
               if (xmlhttp.readyState === 4  &&  xmlhttp.status === 200) {
@@ -3349,6 +3362,10 @@
                   if (tar.localName !== "script" && tar.localName !== "style") {
                     var doc = new ActiveXObject("MSXML2.DomDocument");
                     str = xmlhttp.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->");
+                    NAIBU.doc.async = false;
+                    NAIBU.doc.validateOnParse = false;
+                    NAIBU.doc.resolveExternals = false;
+                    NAIBU.doc.preserveWhiteSpace = false;
                     doc.loadXML(str);
                     var ele = doc.documentElement;
                     tar._instance = tar.ownerDocument.importNode(ele, true);
@@ -3537,7 +3554,8 @@
 };
 /*SVGLength*/     SVGSVGElement.prototype.createSVGLength = function(){
   var s = new SVGLength();
-  s.unitType = /*SVG_LENGTHTYPE_NUMBER*/ 1;  return s;
+  s.unitType = /*SVG_LENGTHTYPE_NUMBER*/ 1;
+  return s;
 };
 /*SVGPoint*/      SVGSVGElement.prototype.createSVGPoint = function(){
   var s = new SVGPoint();
@@ -3924,10 +3942,6 @@
        *スクロール時にバグが起きるので、0に戻してやる必要がある。
        */
       screen.updateInterval = 999;
-      window.onscroll = function () {
-        screen.updateInterval = 0;
-        screen.updateInterval = 99;
-      }
       var objei = this._tar;
       if (/&[^;]+;/.test(str)) {
         /*以下の処理は、実体参照を使ったとき
@@ -4129,7 +4143,7 @@
    */
   /*SVGMatrix*/ multiply : function(/*SVGMatrix*/ secondMatrix ) {
     var s = new SVGMatrix(), m = secondMatrix;
-    if (isNaN(m.a) || isNaN(m.b) || isNaN(m.c) || isNaN(m.d) || isNaN(m.e) || isNaN(m.f)) {
+    if (!isFinite(m.a) || !isFinite(m.b) || !isFinite(m.c) || !isFinite(m.d) || !isFinite(m.e) || !isFinite(m.f)) {
       throw (new Error("引数の値がNumber型ではありません"));
     }
     s.a = this.a * m.a + this.c * m.b;
@@ -4587,7 +4601,7 @@
     } else {
       el.appendChild(fillElement);
     }
-    fc = fillOpacity = null;
+    fillElement = fc = num = fillOpacity = null;
   } else if (fill.uri) {
     /*以下では、Gradation関連の要素に、イベントを渡すことで、
      *この要素の、グラデーション描画を行う
@@ -4668,7 +4682,7 @@
     } else {
       el.appendChild(strokeElement);
     }
-    tsd = null;
+    strokeElement = tsd = null;
   } else {
     el.stroked = "false";
   }
@@ -5037,13 +5051,10 @@
              *[0  0  1 ]   [1]
              */
 
-            dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10);
-            dat[dat.length] = _parseInt(mb*ti.x1 + md*ti.y1 + mf, 10);
-            dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10);
-            dat[dat.length] = _parseInt(mb*ti.x2 + md*ti.y2 + mf, 10);
+            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);
-          dat[dat.length] = _parseInt(mb*ti.x + md*ti.y + mf, 10);
+          dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10)+ " " +_parseInt(mb*ti.x + md*ti.y + mf, 10);
         }
       }
       var vi = tar.ownerDocument.documentElement;
@@ -7148,7 +7159,10 @@
   Max : 7000,
   start : function() {
   if (NAIBU.Clip.length > 0) {
-    screen.updateInterval = 42; //24fpsとして描画処理
+    window.onscroll = function () {
+      screen.updateInterval = 0;
+      screen.updateInterval = 42; //24fpsとして描画処理
+    }
     NAIBU.stop = setInterval( (function() {
 /*      try{*/
         var ntc = NAIBU.Time.currentFrame++;
@@ -7187,6 +7201,11 @@
         }),
          1
       );
+    } else {
+      window.onscroll = function () {
+        screen.updateInterval = 0;
+               window.onscroll = NAIBU.emptyFunction;
+      }
     }
  }
 };
@@ -7272,7 +7291,7 @@
     var attrName = tar.getAttributeNS(null, "attributeName"), newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName);
     var ttr = tar.targetElement, tta = ttr[attrName];
     tar._frame = function() {
-      var d = tar.getSimpleDuration() * 0.8, n = tar._valueList.length - 1, tg = tar.getCurrentTime();
+      var d = tar.getSimpleDuration() * 0.8, n = tar._valueList.length - 2, tg = tar.getCurrentTime();
       if ((n !== -1) && (d !== 0) && (tg <= d)) {
         var ii = Math.floor((tg*n) / d);
       } else {
@@ -7523,7 +7542,7 @@
     }
     tar._frame = function() {
       var _tar = tar;
-      var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 1, tg = _tar.getCurrentTime();
+      var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 2, tg = _tar.getCurrentTime();
       if ((n !== -1) && (d !== 0) && (tg <= d)) {
         var ii = Math.floor((tg*n) / d);
       } else {
@@ -7677,6 +7696,7 @@
     if (evt.eventPhase === Event.BUBBLING_PHASE) {
       return; //強制終了させる
     }
+    evt.target.ownerDocument.documentElement._svgload_limited--
     evt.target.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", "embed");
   }, false);
   this.addEventListener("SVGLoad", function(evt){




Sie-announce メーリングリストの案内
Zurück zum Archiv-Index