[Sie-announce] SIEコード [2811] SVGPathElementのprototypeプロパティを整理

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 7月 3日 (日) 23:10:13 JST


Revision: 2811
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2811
Author:   dhrname
Date:     2011-07-03 23:10:13 +0900 (Sun, 03 Jul 2011)

Log Message:
-----------
SVGPathElementのprototypeプロパティを整理

Modified Paths:
--------------
    branches/08x/081/org/w3c/dom/svg.js

Modified: branches/08x/081/org/w3c/dom/svg.js
===================================================================
--- branches/08x/081/org/w3c/dom/svg.js	2011-07-02 15:45:52 UTC (rev 2810)
+++ branches/08x/081/org/w3c/dom/svg.js	2011-07-03 14:10:13 UTC (rev 2811)
@@ -2655,7 +2655,8 @@
 };
 SVGPathElement.constructor = SVGElement;
 SVGPathElement.prototype = new SVGElement();
-SVGPathElement.prototype._attrModi = function(evt){
+(function(_sproto) {
+_sproto._attrModi = function(evt){
   var tar = evt.target;
   if (evt.attrName === "d" && evt.newValue !== ""){
     /* d属性の値が空の場合は、描画を行わないようにする
@@ -2948,7 +2949,7 @@
   }
   evt = tar = taco = cx = cy = xn = yn = startx = starty = tnl = tlist = ti = dii = ts = isZ = isM = isL = isC = s = null;
 };
-SVGPathElement.prototype._nodeInsert = function(evt){
+_sproto._nodeInsert = function(evt){
   var tar = evt.target;
   if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) {
     return; //強制終了させる
@@ -2979,7 +2980,7 @@
   tar.addEventListener("DOMNodeInsertedIntoDocument", tar._nodeInsertInto, false);
   evt = tar = null;
 };
-SVGPathElement.prototype._nodeInsertInto = function(evt){
+_sproto._nodeInsertInto = function(evt){
   /*以下の処理は、normalizedpathSegListとCTMに基づいて、
    *SVGのd属性をVMLに変換していく処理である。
    */
@@ -3024,7 +3025,7 @@
   delete tar._currentStyle;
   evt = tar = dat = t = tx = ty = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isC = i = tli = tps = ti = cname = tt = null;
 };
-SVGPathElement.prototype._com = {
+_sproto._com = {
   _nameCom : {
     z : " x ",
     Z : " x ",
@@ -3052,7 +3053,7 @@
   isRe : /,/,
   isSp : /\S+/g
 };
-  /*float*/         SVGPathElement.prototype.getTotalLength = function() {
+  /*float*/         _sproto.getTotalLength = function() {
     var s = 0,
         nl = this.normalizedPathSegList;
     for (var i=1,nln=nl.numberOfItems,ms=null;i<nln;++i) {
@@ -3083,7 +3084,7 @@
     this.pathLength.baseVal = s;
     return s;
   };
-  /*SVGPoint*/      SVGPathElement.prototype.getPointAtLength = function(/*float*/ distance ) {
+  /*SVGPoint*/      _sproto.getPointAtLength = function(/*float*/ distance ) {
     var segn = this.getPathSegAtLength(distance),
         x = 0,
         y = 0,
@@ -3131,7 +3132,7 @@
     }
     return s;
   };
-  /*unsigned long*/ SVGPathElement.prototype.getPathSegAtLength = function(/*float*/ distance ) {
+  /*unsigned long*/ _sproto.getPathSegAtLength = function(/*float*/ distance ) {
     var nl = this.normalizedPathSegList; //仕様ではpathSegList
     for (var i=0,nln=nl.numberOfItems,ms=null;i<nln;++i) {
       var seg = nl.getItem(i);
@@ -3163,35 +3164,35 @@
      */
     return (nl.numberOfItems - 1);
   };
-  /*SVGPathSegClosePath*/    SVGPathElement.prototype.createSVGPathSegClosePath = function() {
+  /*SVGPathSegClosePath*/    _sproto.createSVGPathSegClosePath = function() {
     var _SVGPathSegClosePath = SVGPathSegClosePath;
     return (new _SVGPathSegClosePath());
   };
-  /*SVGPathSegMovetoAbs*/    SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegMovetoAbs*/    _sproto.createSVGPathSegMovetoAbs = function(/*float*/ x, /*float*/ y ) {
     var _SVGPathSegMovetoAbs = SVGPathSegMovetoAbs, s = new _SVGPathSegMovetoAbs();
     s.x = x;
     s.y = y;
     return s;
   };
-  /*SVGPathSegMovetoRel*/    SVGPathElement.prototype.createSVGPathSegMovetoRel = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegMovetoRel*/    _sproto.createSVGPathSegMovetoRel = function(/*float*/ x, /*float*/ y ) {
     var s = new SVGPathSegMovetoRel();
     s.x = x;
     s.y = y;
     return s;
   };
-  /*SVGPathSegLinetoAbs*/    SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegLinetoAbs*/    _sproto.createSVGPathSegLinetoAbs = function(/*float*/ x, /*float*/ y ) {
     var s = new SVGPathSegLinetoAbs();
     s.x = x;
     s.y = y;
     return s;
   };
-  /*SVGPathSegLinetoRel*/    SVGPathElement.prototype.createSVGPathSegLinetoRel = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegLinetoRel*/    _sproto.createSVGPathSegLinetoRel = function(/*float*/ x, /*float*/ y ) {
     var s = new SVGPathSegLinetoRel();
     s.x = x;
     s.y = y;
     return s;
   };
-  /*SVGPathSegCurvetoCubicAbs*/    SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) {
+  /*SVGPathSegCurvetoCubicAbs*/    _sproto.createSVGPathSegCurvetoCubicAbs = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) {
     var _SVGPathSegCurvetoCubicAbs = SVGPathSegCurvetoCubicAbs, s = new _SVGPathSegCurvetoCubicAbs();
     s.x = x;
     s.y = y;
@@ -3201,7 +3202,7 @@
     s.y2 = y2;
     return s;
   };
-  /*SVGPathSegCurvetoCubicRel*/    SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) {
+  /*SVGPathSegCurvetoCubicRel*/    _sproto.createSVGPathSegCurvetoCubicRel = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1, /*float*/ x2, /*float*/ y2 ) {
     var s = new SVGPathSegCurvetoCubicRel();
     s.x = x;
     s.y = y;
@@ -3211,7 +3212,7 @@
     s.y2 = y2;
     return s;
   };
-  /*SVGPathSegCurvetoQuadraticAbs*/    SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {
+  /*SVGPathSegCurvetoQuadraticAbs*/    _sproto.createSVGPathSegCurvetoQuadraticAbs = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {
     var s = new SVGPathSegCurvetoQuadraticAbs();
     s.x = x;
     s.y = y;
@@ -3219,7 +3220,7 @@
     s.y1 = y1;
     return s;
   };
-  /*SVGPathSegCurvetoQuadraticRel*/    SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {
+  /*SVGPathSegCurvetoQuadraticRel*/    _sproto.createSVGPathSegCurvetoQuadraticRel = function(/*float*/ x, /*float*/ y, /*float*/ x1, /*float*/ y1 ) {
     var s = new SVGPathSegCurvetoQuadraticRel();
     s.x = x;
     s.y = y;
@@ -3227,7 +3228,7 @@
     s.y1 = y1;
     return s;
   };
-  /*SVGPathSegArcAbs*/    SVGPathElement.prototype.createSVGPathSegArcAbs = function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {
+  /*SVGPathSegArcAbs*/    _sproto.createSVGPathSegArcAbs = function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {
     var s = new SVGPathSegArcAbs();
     s.x = x;
     s.y = y;
@@ -3238,7 +3239,7 @@
     s.sweepFlag = sweepFlag;
     return s;
   };
-  /*SVGPathSegArcRel*/    SVGPathElement.prototype.createSVGPathSegArcRel = function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {
+  /*SVGPathSegArcRel*/    _sproto.createSVGPathSegArcRel = function(/*float*/ x, /*float*/ y, /*float*/ r1, /*float*/ r2, /*float*/ angle, /*boolean*/ largeArcFlag, /*boolean*/ sweepFlag ) {
     var s = new SVGPathSegArcRel();
     s.x = x;
     s.y = y;
@@ -3249,31 +3250,31 @@
     s.sweepFlag = sweepFlag;
     return s;
   };
-  /*SVGPathSegLinetoHorizontalAbs*/    SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(/*float*/ x ) {
+  /*SVGPathSegLinetoHorizontalAbs*/    _sproto.createSVGPathSegLinetoHorizontalAbs = function(/*float*/ x ) {
     var s = new SVGPathSegLinetoHorizontalAbs();
     s.x = x;
     s.y = 0; //DOMでは指定されていないが、変換処理が楽なので用いる
     return s;
   };
-  /*SVGPathSegLinetoHorizontalRel*/    SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(/*float*/ x ) {
+  /*SVGPathSegLinetoHorizontalRel*/    _sproto.createSVGPathSegLinetoHorizontalRel = function(/*float*/ x ) {
     var s = new SVGPathSegLinetoHorizontalRel();
     s.x = x;
     s.y = 0;
     return s;
   };
-  /*SVGPathSegLinetoVerticalAbs*/    SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(/*float*/ y ) {
+  /*SVGPathSegLinetoVerticalAbs*/    _sproto.createSVGPathSegLinetoVerticalAbs = function(/*float*/ y ) {
     var s = new SVGPathSegLinetoVerticalAbs();
     s.x = 0;
     s.y = y;
     return s;
   };
-  /*SVGPathSegLinetoVerticalRel*/    SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(/*float*/ y ) {
+  /*SVGPathSegLinetoVerticalRel*/    _sproto.createSVGPathSegLinetoVerticalRel = function(/*float*/ y ) {
     var s = new SVGPathSegLinetoVerticalRel();
     s.x = 0;
     s.y = y;
     return s;
   };
-  /*SVGPathSegCurvetoCubicSmoothAbs*/    SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {
+  /*SVGPathSegCurvetoCubicSmoothAbs*/    _sproto.createSVGPathSegCurvetoCubicSmoothAbs = function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {
     var s = new SVGPathSegCurvetoCubicSmoothAbs();
     s.x = x;
     s.y = y;
@@ -3281,7 +3282,7 @@
     s.y2 = y2;
     return s;
   };
-  /*SVGPathSegCurvetoCubicSmoothRel*/    SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {
+  /*SVGPathSegCurvetoCubicSmoothRel*/    _sproto.createSVGPathSegCurvetoCubicSmoothRel = function(/*float*/ x, /*float*/ y, /*float*/ x2, /*float*/ y2 ) {
     var s = new SVGPathSegCurvetoCubicSmoothRel();
     s.x = x;
     s.y = y;
@@ -3289,18 +3290,19 @@
     s.y2 = y2;
     return s;
   };
-  /*SVGPathSegCurvetoQuadraticSmoothAbs*/    SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegCurvetoQuadraticSmoothAbs*/    _sproto.createSVGPathSegCurvetoQuadraticSmoothAbs = function(/*float*/ x, /*float*/ y ) {
     var s = new SVGPathSegCurvetoQuadraticSmoothAbs();
     s.x = x;
     s.y = y;
     return s;
   };
-  /*SVGPathSegCurvetoQuadraticSmoothRel*/    SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(/*float*/ x, /*float*/ y ) {
+  /*SVGPathSegCurvetoQuadraticSmoothRel*/    _sproto.createSVGPathSegCurvetoQuadraticSmoothRel = function(/*float*/ x, /*float*/ y ) {
     var s = new SVGPathSegCurvetoQuadraticSmoothRel();
     s.x = x;
     s.y = y;
     return s;
   };
+})(SVGPathElement.prototype)
   NAIBU.SVGPathElement = SVGPathElement; //IE8では、SVGPathElementはローカル変数
 })(document, parseInt, Math);
 




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