svnno****@sourc*****
svnno****@sourc*****
2011年 10月 15日 (土) 22:43:08 JST
Revision: 3008 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=3008 Author: dhrname Date: 2011-10-15 22:43:07 +0900 (Sat, 15 Oct 2011) Log Message: ----------- SVGAnimatedLengthなどの名前のエイリアスを変数で作成することで軽量化 Modified Paths: -------------- branches/08x/087/org/w3c/dom/svg.js Modified: branches/08x/087/org/w3c/dom/svg.js =================================================================== --- branches/08x/087/org/w3c/dom/svg.js 2011-10-14 13:28:39 UTC (rev 3007) +++ branches/08x/087/org/w3c/dom/svg.js 2011-10-15 13:43:07 UTC (rev 3008) @@ -1161,10 +1161,12 @@ *それぞれ、svg要素の同名属性に対応。たとえば、xならば、x属性に対応している *1000というのは、W3Cで触れていないため、独自の初期値を採用 */ - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + var slen = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new slen(); + /*readonly SVGAnimatedLength*/ this.y = new slen(); + /*readonly SVGAnimatedLength*/ this.width = new slen(); + /*readonly SVGAnimatedLength*/ this.height = new slen(); + slen = void 0; /*DOMString*/ this.contentScriptType = "application/ecmascript"; //古い仕様では、text/ecmascript /*DOMString*/ this.contentStyleType = "text/css"; /*readonly SVGRect*/ this.viewport = this.createSVGRect(); @@ -1533,10 +1535,12 @@ function SVGUseElement() { SVGGElement.apply(this, arguments); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); //use要素のx属性に対応(以下、同様) - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + var slen = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new slen(); //use要素のx属性に対応(以下、同様) + /*readonly SVGAnimatedLength*/ this.y = new slen(); + /*readonly SVGAnimatedLength*/ this.width = new slen(); + /*readonly SVGAnimatedLength*/ this.height = new slen(); + slen = void 0; /*readonly SVGElementInstance*/ this.instanceRoot = new SVGElementInstance(); //参照先インスタンスのルート /*readonly SVGElementInstance*/ this.animatedInstanceRoot = new SVGElementInstance();//アニメの最中のインスタンス。静止中は通常 this.addEventListener("DOMNodeInserted", function(evt){ @@ -1595,12 +1599,13 @@ function SVGImageElement(_doc) { SVGElement.apply(this, arguments); this._tar = _doc.createElement("v:image"); - _doc = void 0; //以下は、与えられた属性の値に対応する - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + var slen = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new slen(); + /*readonly SVGAnimatedLength*/ this.y = new slen(); + /*readonly SVGAnimatedLength*/ this.width = new slen(); + /*readonly SVGAnimatedLength*/ this.height = new slen(); + _doc = slen = void 0; /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = new SVGAnimatedPreserveAspectRatio(); this.addEventListener("DOMNodeInserted", function(evt){ if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { @@ -2662,9 +2667,11 @@ SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); //interface SVGAnimatedPathData - /*readonly SVGPathSegList*/ this.pathSegList = new SVGPathSegList(); + var sp = SVGPathSegList; + /*readonly SVGPathSegList*/ this.pathSegList = new sp(); this.animatedPathSegList = this.pathSegList; - /*readonly SVGPathSegList*/ this.normalizedPathSegList = new SVGPathSegList(); + /*readonly SVGPathSegList*/ this.normalizedPathSegList = new sp(); + sp = _doc = void 0; this.animatedNormalizedPathSegList = this.normalizedPathSegList; /*readonly SVGAnimatedNumber*/ this.pathLength = new SVGAnimatedNumber(); //以下は、d属性に変更があった場合の処理 @@ -3332,13 +3339,14 @@ function SVGRectElement(_doc) { SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); - _doc = void 0; - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.rx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.ry = new SVGAnimatedLength(); + var slen = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new slen(); + /*readonly SVGAnimatedLength*/ this.y = new slen(); + /*readonly SVGAnimatedLength*/ this.width = new slen(); + /*readonly SVGAnimatedLength*/ this.height = new slen(); + /*readonly SVGAnimatedLength*/ this.rx = new slen(); + /*readonly SVGAnimatedLength*/ this.ry = new slen(); + _doc = slen = void 0; this.addEventListener("DOMNodeInserted", function(evt){ if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { return; //強制終了させる @@ -3452,9 +3460,11 @@ function SVGCircleElement(_doc) { SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); - /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.r = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.cx = new sl(); + /*readonly SVGAnimatedLength*/ this.cy = new sl(); + /*readonly SVGAnimatedLength*/ this.r = new sl(); + _doc = sl = void 0; this.addEventListener("DOMNodeInserted", function(evt){ var tar = evt.target; if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { @@ -3531,11 +3541,12 @@ function SVGEllipseElement(_doc) { SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); - _doc = void 0; - /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.rx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.ry = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.cx = new sl(); + /*readonly SVGAnimatedLength*/ this.cy = new sl(); + /*readonly SVGAnimatedLength*/ this.rx = new sl(); + /*readonly SVGAnimatedLength*/ this.ry = new sl(); + _doc = sl = void 0; this.addEventListener("DOMNodeInserted", function(evt){ var tar = evt.target; if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { @@ -3613,11 +3624,12 @@ function SVGLineElement(_doc) { SVGElement.apply(this); this._tar = _doc.createElement("v:shape"); - _doc = void 0; - /*readonly SVGAnimatedLength*/ this.x1 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y1 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.x2 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y2 = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x1 = new sl(); + /*readonly SVGAnimatedLength*/ this.y1 = new sl(); + /*readonly SVGAnimatedLength*/ this.x2 = new sl(); + /*readonly SVGAnimatedLength*/ this.y2 = new sl(); + _doc = sl = void 0; this.addEventListener("DOMNodeInserted", function(evt){ var tar = evt.target; if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { @@ -4122,10 +4134,12 @@ function SVGTextPositioningElement(_doc) { SVGTextContentElement.apply(this, arguments); - /*readonly SVGAnimatedLengthList*/ this.x = new SVGAnimatedLengthList(); - /*readonly SVGAnimatedLengthList*/ this.y = new SVGAnimatedLengthList(); - /*readonly SVGAnimatedLengthList*/ this.dx = new SVGAnimatedLengthList(); - /*readonly SVGAnimatedLengthList*/ this.dy = new SVGAnimatedLengthList(); + var sl = SVGAnimatedLengthList; + /*readonly SVGAnimatedLengthList*/ this.x = new sl(); + /*readonly SVGAnimatedLengthList*/ this.y = new sl(); + /*readonly SVGAnimatedLengthList*/ this.dx = new sl(); + /*readonly SVGAnimatedLengthList*/ this.dy = new sl(); + _doc = sl = void 0; /*readonly SVGAnimatedNumberList*/ this.rotate = new SVGAnimatedNumberList(); this.addEventListener("DOMAttrModified", function(evt){ var tar = evt.target, name = evt.attrName, tod = tar.ownerDocument.documentElement; @@ -4472,12 +4486,14 @@ })(SVGPaint); function SVGMarkerElement(){ - SVGElement.apply(this, arguments); - /*readonly SVGAnimatedLength*/ this.refX = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.refY = new SVGAnimatedLength(); + SVGElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.refX = new sl(); + /*readonly SVGAnimatedLength*/ this.refY = new sl(); /*readonly SVGAnimatedEnumeration*/ this.markerUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedLength*/ this.markerWidth = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.markerHeight = new SVGAnimatedLength(); + /*readonly SVGAnimatedLength*/ this.markerWidth = new sl(); + /*readonly SVGAnimatedLength*/ this.markerHeight = new sl(); + sl = void 0; /*readonly SVGAnimatedEnumeration*/ this.orientType = new SVGAnimatedEnumeration(); /*readonly SVGAnimatedAngle*/ this.orientAngle = new SVGAnimatedAngle(); //SVGFitToViewBoxのインターフェースを用いる @@ -4596,11 +4612,13 @@ /*unsigned short*/ SVGGradientElement.SVG_SPREADMETHOD_REPEAT = 3; function SVGLinearGradientElement() { - SVGGradientElement.apply(this, arguments); - /*readonly SVGAnimatedLength*/ this.x1 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y1 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.x2 = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y2 = new SVGAnimatedLength(); + SVGGradientElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x1 = new sl(); + /*readonly SVGAnimatedLength*/ this.y1 = new sl(); + /*readonly SVGAnimatedLength*/ this.x2 = new sl(); + /*readonly SVGAnimatedLength*/ this.y2 = new sl(); + sl = void 0; this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { var grad = evt.target, ele = evt._tar, angle = 270; if (!!!ele) { //まだ、path要素などが設定されていない場合 @@ -4627,11 +4645,13 @@ function SVGRadialGradientElement(_doc) { SVGGradientElement.apply(this); - /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.r = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.fx = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.fy = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.cx = new sl(); + /*readonly SVGAnimatedLength*/ this.cy = new sl(); + /*readonly SVGAnimatedLength*/ this.r = new sl(); + /*readonly SVGAnimatedLength*/ this.fx = new sl(); + /*readonly SVGAnimatedLength*/ this.fy = new sl(); + sl = void 0; this.cx.baseVal.value = this.cy.baseVal.value = this.r.baseVal.value = 0.5; this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { var grad = evt.target, ele = evt._tar, tar = evt._ttar; //eleはv:fill要素。tarはターゲットとになる要素 @@ -4730,14 +4750,16 @@ SVGStopElement.prototype = new SVGElement(); function SVGPatternElement() { - SVGElement.apply(this, arguments); + SVGElement.apply(this); + var sl = SVGAnimatedLength; /*readonly SVGAnimatedEnumeration*/ this.patternUnits = new SVGAnimatedEnumeration(); /*readonly SVGAnimatedEnumeration*/ this.patternContentUnits = new SVGAnimatedEnumeration(); /*readonly SVGAnimatedTransformList*/ this.patternTransform = new SVGAnimatedTransformList(); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new al(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; SVGURIReference.apply(this, arguments); //SVGFitToViewBoxのインターフェースを用いる /*readonly SVGAnimatedRect*/ this.viewBox = new SVGAnimatedRect(); @@ -4757,26 +4779,30 @@ SVGClipPathElement.prototype = new SVGElement(); function SVGMaskElement() { - SVGElement.apply(this, arguments); + SVGElement.apply(this); + var sl = SVGAnimatedLength; /*readonly SVGAnimatedEnumeration*/ this.maskUnits = new SVGAnimatedEnumeration(); /*readonly SVGAnimatedEnumeration*/ this.maskContentUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; return this; }; SVGMaskElement.constructor = SVGElement; SVGMaskElement.prototype = new SVGElement(); function SVGFilterElement() { - SVGElement.apply(this, arguments); + SVGElement.apply(this); + var sl = SVGAnimatedLength; /*readonly SVGAnimatedEnumeration*/ this.filterUnits = new SVGAnimatedEnumeration(); /*readonly SVGAnimatedEnumeration*/ this.primitiveUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; /*readonly SVGAnimatedInteger*/ this.filterResX = new SVGAnimatedInteger(); /*readonly SVGAnimatedInteger*/ this.filterResY = new SVGAnimatedInteger(); SVGURIReference.apply(this, arguments); @@ -4789,11 +4815,13 @@ function SVGFilterPrimitiveStandardAttributes(ele) { SVGStylable.apply(this, arguments); this._tar = ele; - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); - /*readonly SVGAnimatedString*/ this.result = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + /*readonly SVGAnimatedString*/ this.result = new sl(); + sl = void 0; }; SVGFilterPrimitiveStandardAttributes.constructor = SVGStylable; SVGFilterPrimitiveStandardAttributes.prototype = new SVGStylable(); @@ -5985,10 +6013,12 @@ SVGTransformable, events::EventTarget*/ { SVGElement.apply(this); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.width = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.height = new SVGAnimatedLength(); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; return this; }; SVGForeignObjectElement.constructor = SVGElement;