[Sie-announce] SIEコード [2107] 0. 62統合

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 2日 (火) 21:39:16 JST


Revision: 2107
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2107
Author:   dhrname
Date:     2010-11-02 21:39:16 +0900 (Tue, 02 Nov 2010)

Log Message:
-----------
0.62統合

Modified Paths:
--------------
    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 Changed:
----------------
    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/w3c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c:1864-2067
/branches/ufltima:1621-1788
   + /branches/06x/061/org/w3c:1864-2067
/branches/06x/062/org/w3c:2071-2106
/branches/ufltima:1621-1788

Modified: branches/06x/org/w3c/core.js
===================================================================
--- branches/06x/org/w3c/core.js	2010-11-01 14:30:38 UTC (rev 2106)
+++ branches/06x/org/w3c/core.js	2010-11-02 12:39:16 UTC (rev 2107)
@@ -81,6 +81,7 @@
  Error.apply(this, arguments);
  this.code = n;
  var s = [
+   "", //数合わせのため
    "Index Size Error (入力値が大きすぎるか、マイナスの値ではありませんか)",
    "DOMString Size Error (テキストの指定範囲が文字数を超えていませんか)",
    "Hierarchy Request Error (先祖ノードを子ノードとして付け加えることができないようです)",
@@ -89,7 +90,7 @@
    "No Data Allowed Error",
    "No Modification Allowed Error",
    "Not Found Error (お探しになっているノードが見つかりませんでした)",
-   "Not Supported Error (指定されたノード型とは別の型をご用意ください)",
+   "Not Supported Error",
    "Inuse Attribute Error (その属性ノードはすでに他の要素へ属していないでしょうか)",
    "Invalid State Error (仕様や注意事項をよくお読みの上、正しくお使いください)",
    "Syntax Error",
@@ -372,7 +373,7 @@
  *どんな機能をサポートしているかどうかをチェック
  */
 /*boolean*/ isSupported : function( /*string*/ feature, version) {
-  return (this.ownerDocument.implementation.hasFeature(feature, version));
+  return (this.ownerDocument.implementation.hasFeature(feature+"", version+""));
 },
 /*hasAttributesメソッド
  *ノードが属性を持っているかどうか
@@ -401,7 +402,6 @@
  *ノードの集合。ノードリストと違って、順序が決まっていない。削除不可
  */
 function NamedNodeMap() {
-  this.length = 0;
   return this;
 }
 /*_copyNode
@@ -414,6 +414,7 @@
 };
 
 NamedNodeMap.prototype = {
+ /*number*/ length : 0,
 /*
  *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること
  */
@@ -479,11 +480,11 @@
  */
 function CharacterData(){
  Node.apply(this);
- this.length = 0;
+ return this;
 };
 CharacterData.prototype = new Node();                    //ノードのプロトタイプチェーンを作って、継承
 CharacterData.constructor = Node;
-
+CharacterData.prototype.length = 0;
 /*substringDataメソッド
  *offsetから数えてcount分の文字列を取り出す
  */
@@ -529,25 +530,25 @@
  */
 function Attr() {
   Node.apply(this);
-  this.nodeType = Node.ATTRIBUTE_NODE;
   delete this._capter;
   return this;
 };
 Attr.prototype = new Node();                    //ノードのプロトタイプチェーンを作って、継承
 Attr.constructor = Node;
+Attr.prototype.nodeType = Node.ATTRIBUTE_NODE;
 
 /*Element
  *要素ノード。削除不可。
  */
 function Element() {
   Node.apply(this);
-  this.nodeType = Node.ELEMENT_NODE;
-  this.nodeValue = null;
   this.attributes = new NamedNodeMap();          //属性を収納
   return this;
 };
 Element.prototype = new Node();                  //ノードのプロトタイプチェーンを作って、継承
 Element.constructor = Node;
+Element.prototype.nodeType = Node.ELEMENT_NODE;
+Element.prototype.nodeValue = null;
 /*
  *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること
  *(getAttributeとsetAttributeは普及しているので機能させる
@@ -646,14 +647,12 @@
  *テキストノード。削除不可。
  */
 function Text() {
-  CharacterData.apply(this, arguments);
-  this.nodeType = Node.TEXT_NODE;
-  this.nodeName = "#text";
   return this;
 };
 Text.prototype = new CharacterData();                       //文字データのプロトタイプチェーンを作って、継承
 Text.constructor = CharacterData;
-
+Text.prototype.nodeType = Node.TEXT_NODE;
+Text.prototype.nodeName = "#text";
 /*Text*/ Text.prototype.splitText = function(/*long*/ offset) {
   var pre = this.substringData(0, offset - 1);              //このノードからoffsetまでの文字列を取り出して、
   this.replaceData(0, this.length - 1, pre);                //このノードの文字列と置き換える
@@ -672,13 +671,12 @@
  *コメントノード。<!-- --!>で表現される。削除不可。
  */
 function Comment() {
-  this.nodeType = Node.COMMENT_NODE;
-  this.nodeName = "#comment";
   return this;
 };
 Comment.prototype = new CharacterData();                    //文字データのプロトタイプチェーンを作って、継承
 Comment.constructor = CharacterData;
-
+Comment.prototype.nodeType = Node.COMMENT_NODE;
+Comment.prototype.nodeName = "#comment";
 /*CDATASection
  *CDATA領域を示すノード。<![CDATA[ ]]!>で表現される。削除不可。
  */
@@ -804,8 +802,8 @@
  */
 /*Text*/               Document.prototype.createTextNode = function( /*string*/ data) {
   var s = new Text();
-  s.data = s.nodeValue = data;
-  s.length = data.length;
+  s.data = s.nodeValue = data+"";
+  s.length = (data+"").length;
   s.ownerDocument = this;
   return s;
 };


Property changes on: branches/06x/org/w3c/core.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/core.js:1864-2067
/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/ufltima/core.js:1621-1854

Modified: branches/06x/org/w3c/dom/css.js
===================================================================
--- branches/06x/org/w3c/dom/css.js	2010-11-01 14:30:38 UTC (rev 2106)
+++ branches/06x/org/w3c/dom/css.js	2010-11-02 12:39:16 UTC (rev 2107)
@@ -344,7 +344,6 @@
 };
 
 function CSSPrimitiveValue() {
-  CSSValue.call(this);
   return this;
 };
 
@@ -529,7 +528,7 @@
   fill : "black",
   stroke : "none",
   cursor : "auto",
-  visibility : "visible",
+  visibility : "visiblee", //visibleが正しいが、初期値を見分ける必要があるため、visibleeとする
   display : "inline-block",
   opacity : "1",
   fillOpacity : "1",
@@ -702,30 +701,40 @@
   }
   var style = this.defaultView.getComputedStyle(tar, "")
   s.setProperty = function(propertyName, value, priority) {
-    var tar = elt, el = tar._tar;
+    var tar = elt, el = tar._tar, isFill = isStroke = false;
     if (!!!tar._fillElement) {
       tar._fillElement = document.createElement("v:fill"); //キャッシュを作る
-      el.appendChild(tar._fillElement);
+    } else {
+      /*あらかじめ消しおかないと、効果が出ない*/
+      el.removeChild(tar._fillElement);
+      isFill = true;
     }
     if (!!!tar._strokeElement) {
       tar._strokeElement = document.createElement("v:stroke");
-      el.appendChild(tar._strokeElement);
+    } else {
+      /*あらかじめ消しおかないと、効果が出ない*/
+      el.removeChild(tar._strokeElement);
+      isStroke = true;
     }
+
     var fillElement = tar._fillElement, strokeElement = tar._strokeElement;
     setProp.call(s, propertyName, value, priority);
     if (propertyName === "fill-opacity") {
       var fillOpacity = parseFloat(value) * style._list._opacity; //opacityを掛け合わせる
       if (fillOpacity < 1) {
         fillElement.setAttribute("opacity", fillOpacity+"");
+        isFill = true;
       }
     } else if (propertyName === "opacity") {
       var fillOpacity = parseFloat(style.getPropertyValue("fill-opacity")) * parseFloat(value); //opacityを掛け合わせる
       if (fillOpacity < 1) {
         fillElement.setAttribute("opacity", fillOpacity+"");
+        isFill = true;
       }
       var strokeOpacity = parseFloat(style.getPropertyValue("stroke-opacity")) * parseFloat(value);
       if (strokeOpacity < 1) {
         strokeElement.setAttribute("opacity", strokeOpacity+"");
+        isStroke = true;
       }
       fillOpacity = strokeOpacity = null;
     } else if (propertyName === "fill") {
@@ -745,6 +754,7 @@
             el.appendChild(evtt._tar);
             tar._fillElement = evtt._tar; //キャッシュを作る
           }
+          isFill = true;
           t = evtt = null;
         }
         tod = null;
@@ -754,6 +764,7 @@
       } else {        
         var fc = fill.rgbColor, num = CSSPrimitiveValue.CSS_NUMBER;
         fillElement.setAttribute("color", "rgb(" +fc.red.getFloatValue(num)+ "," +fc.green.getFloatValue(num)+ "," +fc.blue.getFloatValue(num)+ ")"); 
+        isFill = true;
       }
     } else if (propertyName === "stroke") {
       var stroke = style.getPropertyCSSValue("stroke");
@@ -763,11 +774,13 @@
       } else if (!stroke.uri) {
         var fc = stroke.rgbColor, num = CSSPrimitiveValue.CSS_NUMBER;
         strokeElement.setAttribute("color", "rgb(" +fc.red.getFloatValue(num)+ "," +fc.green.getFloatValue(num)+ "," +fc.blue.getFloatValue(num)+ ")");
+        isStroke = true;
       }
     } else if (propertyName === "stroke-opacity") {
       var strokeOpacity = parseFloat(value) * parseFloat(style.getPropertyValue("opacity")); //opacityを掛け合わせる
       if (strokeOpacity < 1) {
         strokeElement.setAttribute("opacity", strokeOpacity);
+        isStroke = true;
       }
       fc = num = strokeOpacity = null;
     } else if (propertyName === "stroke-width") {
@@ -775,17 +788,21 @@
       sgsw._percent = Math.sqrt((w*w + h*h) / 2);
       var swx = sgsw.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) * Math.sqrt(Math.abs(tar.getScreenCTM()._determinant()));
       strokeElement.setAttribute("weight", swx + "px");
+      isStroke = true;
       sgsw = w = h = null;
     } else if (propertyName === "stroke-miterlimit") {
       strokeElement.setAttribute("miterlimit", value);
+      isStroke = true;
     } else if (propertyName === "stroke-linejoin") {
       strokeElement.setAttribute("joinstyle", value);
+      isStroke = true;
     } else if (propertyName === "stroke-linecap") {
       if (value === "butt") {
         strokeElement.setAttribute("endcap", "flat");
       } else {
         strokeElement.setAttribute("endcap", value);
       }
+      isStroke = true;
     } else if (propertyName === "stroke-dasharray") {
       var tsd = value;
       if (tsd !== "none") {
@@ -800,6 +817,7 @@
           }
         }
         strokeElement.setAttribute("dashstyle", strokedasharray);
+        isStroke = true;
         tsd = strs = null;
       }
     } else if ((propertyName === "cursor") && (value !== "auto") && (value !== "")) {
@@ -809,6 +827,11 @@
     } else if (propertyName === "display") {
       el.style.display = value;
     }
+    if (isFill) {
+      el.appendChild(tar._fillElement);
+    } else if (isStroke) {
+      el.appendChild(tar._strokeElement);
+    }
     el = fill = stroke = tar = value = propertyName = null;
   }
   return s;


Property changes on: branches/06x/org/w3c/dom/css.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/css.js:1864-2067
/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/ufltima/dom/css.js:1621-1855

Modified: branches/06x/org/w3c/dom/events.js
===================================================================
--- branches/06x/org/w3c/dom/events.js	2010-11-01 14:30:38 UTC (rev 2106)
+++ branches/06x/org/w3c/dom/events.js	2010-11-02 12:39:16 UTC (rev 2107)
@@ -216,7 +216,7 @@
  *イベントの雛形となる。プロパティもすべて含めて、必須
  */
 function Event() {
-  /*DOMTimeStamp*/     this.timeStamp = (new Date()).getTime();
+  /*DOMTimeStamp*/     this.timeStamp = +(new Date());
   return this;
 };
 // PhaseType


Property changes on: branches/06x/org/w3c/dom/events.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/events.js:1864-2067
/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/ufltima/dom/events.js:1621-1856

Modified: branches/06x/org/w3c/dom/svg.js
===================================================================
--- branches/06x/org/w3c/dom/svg.js	2010-11-01 14:30:38 UTC (rev 2106)
+++ branches/06x/org/w3c/dom/svg.js	2010-11-02 12:39:16 UTC (rev 2107)
@@ -55,6 +55,7 @@
  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  */
 
+
 //これを頭に付けたら、内部処理用
 var  NAIBU = {};
 //documentを速くするために
@@ -1516,7 +1517,6 @@
       /*responseXMLを使うと、時々、空のデータを返すことがあるため(原因は不明)、
        *ここでは、responseTextを用いる
        */
-      var dew = new Date();
       str = this.xmlhttp.responseText;
       NAIBU.doc.async = false;
       /*下記のプロパティについては、Microsoftのサイトを参照
@@ -1640,7 +1640,6 @@
       }
       s.defaultView._cache = s.defaultView._cache_ele = null;
       s = evt = null;
-      alert((new Date()).getTime() - dew.getTime());
       if (this._next) {
         this._next._init();
       } else {
@@ -1960,38 +1959,48 @@
  *軽量化のために、SVGPathSegの継承をしない。また、{}オブジェクトで代用する予定
  */
 function SVGPathSegClosePath() {
-  this.pathSegType = SVGPathSeg.PATHSEG_CLOSEPATH;
-  this.pathSegTypeAsLetter = "z";
   return this;
 };
+SVGPathSegClosePath.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_CLOSEPATH,
+  pathSegTypeAsLetter : "z"
+};
 function SVGPathSegMovetoAbs() { 
   /*float*/ this.x;
   /*float*/ this.y;
-  this.pathSegType = SVGPathSeg.PATHSEG_MOVETO_ABS;
-  this.pathSegTypeAsLetter = "M";
   return this;
 };
+SVGPathSegMovetoAbs.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_MOVETO_ABS,
+  pathSegTypeAsLetter : "M"
+};
 function SVGPathSegMovetoRel() { 
   /*float*/ this.x;
   /*float*/ this.y;
-  this.pathSegType = SVGPathSeg.PATHSEG_MOVETO_REL;
-  this.pathSegTypeAsLetter = "m";
   return this;
 };
+SVGPathSegMovetoRel.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_MOVETO_REL,
+  pathSegTypeAsLetter : "m"
+};
 function SVGPathSegLinetoAbs() { 
   /*float*/ this.x;
   /*float*/ this.y;
-  this.pathSegType = SVGPathSeg.PATHSEG_LINETO_ABS;
-  this.pathSegTypeAsLetter = "L";
   return this;
 };
+SVGPathSegLinetoAbs.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_LINETO_ABS,
+  pathSegTypeAsLetter : "L"
+};
 function SVGPathSegLinetoRel() { 
   /*float*/ this.x;
   /*float*/ this.y;
-  this.pathSegType = SVGPathSeg.PATHSEG_LINETO_REL;
-  this.pathSegTypeAsLetter = "l";
   return this;
 };
+SVGPathSegLinetoRel.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_LINETO_REL,
+  pathSegTypeAsLetter : "l"
+};
 function SVGPathSegCurvetoCubicAbs() { 
   /*float*/ this.x;
   /*float*/ this.y;
@@ -1999,10 +2008,12 @@
   /*float*/ this.y1;
   /*float*/ this.x2;
   /*float*/ this.y2;
-  this.pathSegType = SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
-  this.pathSegTypeAsLetter = "C";
   return this;
 };
+SVGPathSegCurvetoCubicAbs.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,
+  pathSegTypeAsLetter : "C"
+};
 function SVGPathSegCurvetoCubicRel() { 
   /*float*/ this.x;
   /*float*/ this.y;
@@ -2010,10 +2021,12 @@
   /*float*/ this.y1;
   /*float*/ this.x2;
   /*float*/ this.y2;
-  this.pathSegType = SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
-  this.pathSegTypeAsLetter = "c";
   return this;
 };
+SVGPathSegCurvetoCubicRel.prototype = {
+  pathSegType : SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,
+  pathSegTypeAsLetter : "c"
+};
 function SVGPathSegCurvetoQuadraticAbs() { 
   /*float*/ this.x;
   /*float*/ this.y;
@@ -2039,26 +2052,28 @@
   /*float*/ this.r1;
   /*float*/ this.r2;
   /*float*/ this.angle;
-  /*boolean*/ this.largeArcFlag = true;
-  /*boolean*/ this.sweepFlag = true;
-  this.pathSegType = SVGPathSeg.PATHSEG_ARC_ABS;
-  this.pathSegTypeAsLetter = "A";
   return this;
 };
-
+SVGPathSegArcAbs.prototype = {
+  /*boolean*/ largeArcFlag : true,
+  /*boolean*/ sweepFlag : true,
+  pathSegType : SVGPathSeg.PATHSEG_ARC_ABS,
+  pathSegTypeAsLetter : "A"
+};
 function SVGPathSegArcRel() { 
   /*float*/ this.x;
   /*float*/ this.y;
   /*float*/ this.r1;
   /*float*/ this.r2;
   /*float*/ this.angle;
-  /*boolean*/ this.largeArcFlag = true;
-  /*boolean*/ this.sweepFlag = true;
-  this.pathSegType = SVGPathSeg.PATHSEG_ARC_REL;
-  this.pathSegTypeAsLetter = "a";
   return this;
 };
-
+SVGPathSegArcRel.prototype = {
+  /*boolean*/ largeArcFlag : true,
+  /*boolean*/ sweepFlag : true,
+  pathSegType : SVGPathSeg.PATHSEG_ARC_REL,
+  pathSegTypeAsLetter : "a"
+};
 function SVGPathSegLinetoHorizontalAbs() { 
   /*float*/ this.x;
   this.pathSegType = SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
@@ -2241,7 +2256,7 @@
     el.style.cursor = cursor;
   }
   var vis = style.getPropertyValue("visibility");
-  if (!!!vis._n) { //初期値でないならば
+  if (vis !== "visiblee") { //初期値でないならば
     el.style.visibility = vis;
   }
   var disp = style.getPropertyValue("display");
@@ -2263,7 +2278,6 @@
   this.animatedNormalizedPathSegList = this.normalizedPathSegList;
   /*readonly SVGAnimatedNumber*/ this.pathLength = new SVGAnimatedNumber();
   //以下は、d属性に変更があった場合の処理
-  var ra = /\-/g, rb = /,/g, rc = /([a-yA-Y])/g, rd = /([zZ])/g, re = /,/, sgs = /\S+/g;
   this.addEventListener("DOMAttrModified", function(evt){
     var tar = evt.target;
     if (evt.attrName === "d" && evt.newValue !== ""){
@@ -2276,12 +2290,13 @@
        *JSONにおける表現は以下のとおり
        *D = [["M", 20, 30], ["L", 20 40]]
        */
+      var taco = tar._com, sgs = taco.isSp;
       var dd = evt.newValue
-      .replace(ra, " -")
-      .replace(rb, " ")
-      .replace(rc, ",$1 ")
-      .replace(rd, ",$1 1")
-      .replace(re, "")
+      .replace(taco.isRa, " -")
+      .replace(taco.isRb, " ")
+      .replace(taco.isRc, ",$1 ")
+      .replace(taco.isRd, ",$1 1")
+      .replace(taco.isRe, "")
       .split(",");
       for (var i=0, dli=dd.length;i<dli;++i) {
         D[i] = dd[i].match(sgs);
@@ -2289,23 +2304,24 @@
           D[i][j] = _parseFloat(D[i][j]); //_parseFloatは高速化のためのAlias
         }
       }
-      dd = null;
+      sgs = dd = null;
+      var isZ = taco._isZ, isM = taco._isM, isC = taco._isC, isL = taco._isL;
       for (var i=0, Dli=D.length; i < Dli; ++i) {
         var di = D[i], s;
         for (var j=1, dii=di[0], dili=di.length; j < dili; ++j) {
-          if (dii === "M") {
+          if (isM[dii]) {
             s = tar.createSVGPathSegMovetoAbs(di[j], di[j+1]);
             ++j;
           } else if (dii === "m") {
             s = tar.createSVGPathSegMovetoRel(di[j], di[j+1]);
             ++j;
-          } else if (dii === "L") {
+          } else if (isL[dii]) {
             s = tar.createSVGPathSegLinetoAbs(di[j], di[j+1]);
             ++j;
           } else if (dii === "l") {
             s = tar.createSVGPathSegLinetoRel(di[j], di[j+1]);
             ++j;
-          } else if (dii === "C") {
+          } else if (isC[dii]) {
             s = tar.createSVGPathSegCurvetoCubicAbs(di[j+4], di[j+5], di[j], di[j+1], di[j+2], di[j+3]);
             j += 5;
           } else if (dii === "c") {
@@ -2323,7 +2339,7 @@
           } else if (dii === "a") {
             s = tar.createSVGPathSegArcRel(di[j+5], di[j+6], di[j], di[j+1], di[j+2], di[j+3], di[j+4]);
             j += 6;
-          } else if (dii === "Z" || dii === "z") {
+          } else if (isZ[dii]) {
             s = tar.createSVGPathSegClosePath();
           } else if (dii === "S") {
             s = tar.createSVGPathSegCurvetoCubicSmoothAbs(di[j+2], di[j+3], di[j], di[j+1]);
@@ -2370,7 +2386,7 @@
             cx = ti.x;
             cy = ti.y;
           }
-          if (dii === "M") {
+          if (isM[dii]) {
             if (j !== 0) {
               /*Mコマンドが続いた場合は、2番目以降はLコマンドと解釈する
                *W3C SVG1.1の「8.3.2 The "moveto" commands」を参照
@@ -2396,15 +2412,15 @@
             startx = cx;
             starty = cy;
             tnl.appendItem(tar.createSVGPathSegMovetoAbs(cx, cy));
-          } else if (dii === "L") {
+          } else if (isL[dii]) {
             tnl.appendItem(ti);
           } else if (dii === "l") {
             tnl.appendItem(tar.createSVGPathSegLinetoAbs(cx, cy));
-          } else if (dii === "C") {
+          } else if (isC[dii]) {
             tnl.appendItem(ti);
           } else if (dii === "c") {
             tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, ti.x1+rx, ti.y1+ry, ti.x2+rx, ti.y2+ry));
-          } else if (dii === "z") {
+          } else if (isZ[dii]) {
             cx = startx;
             cy = starty;
             tnl.appendItem(ti);
@@ -2519,7 +2535,7 @@
         }
         ti = dii = ts = null;
       }
-      cx = cy = xn = yn = startx = starty = null;
+      taco = cx = cy = xn = yn = startx = starty = null;
     }
     evt = null;
   }, false);
@@ -2562,19 +2578,20 @@
        */
       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;
       for (var i=0, tli=tlist.numberOfItems;i<tli;++i) {
         var ti = tlist.getItem(i), tps = ti.pathSegTypeAsLetter;
         /*IE6の高速化のために、以下では、x += "";のような文字連結ではなくて、
          *x[data.length] = "";という形をとった
          */
-        if (tps === "z" || tps === "Z") {
+        if (isZ[tps]) {
           dat[dat.length] = " x ";
         } else {
-          if (tps === "M") {
+          if (isM[tps]) {
             dat[dat.length] = "m";
-          } else if (tps === "L") {
+          } else if (isL[tps]) {
             dat[dat.length] = "l";
-          } else if (tps === "C") {
+          } else if (isC[tps]) {
             dat[dat.length] = "c";
             /*CTM(mx)の行列と座標(x, y)の積を算出する。数学における表現は以下のとおり
              *[ma mc me]   [x]
@@ -2606,6 +2623,27 @@
 };
 SVGPathElement.constructor = SVGElement;
 SVGPathElement.prototype = new SVGElement();
+SVGPathElement.prototype._com = {
+  _isZ : {
+    z : 1,
+    Z : 1
+  },
+  _isC : {
+    C : 1
+  },
+  _isL : {
+    L : 1
+  },
+  _isM : {
+    M : 1
+  },
+  isRa : /\-/g,
+  isRb : /,/g,
+  isRc : /([a-yA-Y])/g,
+  isRd : /([zZ])/g,
+  isRe : /,/,
+  isSp : /\S+/g
+};
   /*float*/         SVGPathElement.prototype.getTotalLength = function() {
     var s = 0, nl = this.normalizedPathSegList;
     for (var i=1,nln=nl.numberOfItems,ms=null;i<nln;++i) {
@@ -3749,7 +3787,7 @@
         tar._tar.style.cursor = cursor;
       }
       var vis = style.getPropertyValue("visibility");
-      if (!!!vis._n) {
+      if (vis !== "visiblee") {
         tar._tar.style.visibility = vis;
       }
       var isRect = true;
@@ -4556,7 +4594,7 @@
   this._end = offset + ntc;
 };
 SVGAnimationElement.prototype._eventRegExp = /(mouse|activ|clic)[a-z]+/;
-SVGAnimationElement.prototype._timeRegExp = /[\-\d\.]+(h|min|s|ms)/;
+SVGAnimationElement.prototype._timeRegExp = /[\-\d\.]+(h|min|s|ms)?/;
 SVGAnimationElement.prototype._unit = {
     "h" : 2880000,
     "min" : 48000,
@@ -4572,8 +4610,10 @@
  */
 SVGAnimationElement.prototype._getOffset = function(/*string*/ t) {
   var n = parseFloat(t.match(this._timeRegExp));
-  if (!isNaN(n)) {
+  if (!isNaN(n) && RegExp.$1) {
     var offset = n * this._unit[RegExp.$1]
+  } else if (!isNaN(n)) {
+    var offset = n;
   } else {
     var offset = 0;
   }
@@ -5123,11 +5163,17 @@
 };
 function unsvgtovml() {
   try {
+    if ("stop" in NAIBU) {
+      clearInterval(NAIBU.stop);
+    }
     Element = SVGElement = Attr = NamedNodeMap = CSS2Properties = CSSValue = CSSPrimitiveValue = NAIBU.xmlhttp = Node = Event = NAIBU = stlog = STLog = document = null;
-    Array = ActiveXObject = window = null;
+    Array = ActiveXObject = null;
   } catch(e) {}
 }
-NAIBU.addEvent("load", (function() {
+/*_main関数
+ *一番最初に起動するべき関数 
+ */
+NAIBU._main = (function() {
   stlog = new STLog(true);
   var xmlhttp; //XMLHttpオブジェクトを生成
   try {
@@ -5147,9 +5193,10 @@
     }
   }
   NAIBU.xmlhttp = xmlhttp;
-  NAIBU.doc = new ActiveXObject("MSXML2.DomDocument");
-  var nd = NAIBU.doc;
-  if (!document.namespaces["v"]) {
+  var nd;
+  if (("namespaces" in document) && !document.namespaces["v"]) {
+    NAIBU.doc = new ActiveXObject("MSXML2.DomDocument");
+    nd = NAIBU.doc;
     document.namespaces.add("v","urn:schemas-microsoft-com:vml");
     document.namespaces.add("o","urn:schemas-microsoft-com:office:office");
     var st = document.createStyleSheet();
@@ -5182,7 +5229,7 @@
       } else {
         var base = location.href.replace(/\/[^\/]+?$/,"/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/
         ait = ait.replace(/\shref=(['"a-z]+?):\/\//g, " target='_top' xlink:href=$1://").replace(/\shref=(.)/g, " target='_top' xlink:href=$1"+base);
-        var s = textToSVG(ait,ary[i].getAttribute("width"),ary[i].getAttribute("height"));
+        var s = NAIBU.textToSVG(ait,ary[i].getAttribute("width"),ary[i].getAttribute("height"));
         ary[i].parentNode.insertBefore(s,ary[i]);
       }
       ait = null;
@@ -5218,7 +5265,8 @@
       s = null;
     }
   }
-}) );
+});
+NAIBU.addEvent("load", NAIBU._main);
 NAIBU.utf16 = function ( /*string*/ s)  {
   return unescape(s);
 }


Property changes on: branches/06x/org/w3c/dom/svg.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/06x/061/org/w3c/dom/svg.js:1864-2067
/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/ufltima/dom/svg.js:1621-1856




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