svnno****@sourc*****
svnno****@sourc*****
2011年 4月 8日 (金) 20:49:00 JST
Revision: 2572
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2572
Author: dhrname
Date: 2011-04-08 20:49:00 +0900 (Fri, 08 Apr 2011)
Log Message:
-----------
SVGAngleのデフォルトのプロパティを修正して、newValueSpecifiedUnitsメソッドも修正
Modified Paths:
--------------
branches/07x/075/org/w3c/dom/svg.js
Modified: branches/07x/075/org/w3c/dom/svg.js
===================================================================
--- branches/07x/075/org/w3c/dom/svg.js 2011-04-07 11:50:07 UTC (rev 2571)
+++ branches/07x/075/org/w3c/dom/svg.js 2011-04-08 11:49:00 UTC (rev 2572)
@@ -639,20 +639,21 @@
return this;
};
function SVGAngle() {
- /*readonly attribute unsigned short*/ this.unitType = 0;
- /*attribute float*/ this.value = 0;
- // raises DOMException on setting
- /*attribute float*/ this.valueInSpecifiedUnits;
- // raises DOMException on setting
- /*attribute DOMString*/ this.valueAsString;
- // raises DOMException on setting
return this;
};
SVGAngle.prototype = {
+ /*readonly attribute unsigned short*/ unitType : 0,
+ /*attribute float*/ value : 0,
+ // raises DOMException on setting
+ /*attribute float*/ valueInSpecifiedUnits : 0,
+ // raises DOMException on setting
+ /*attribute DOMString*/ valueAsString : "0",
+ // raises DOMException on setting
/*void*/ newValueSpecifiedUnits : function (/*in unsigned short*/ unitType, /*in float*/ valueInSpecifiedUnits ) {
var n = 1,
- _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す
- if (unitType === SVGAngle.SVG_ANGLETYPE_DEG) {
+ _s = ""; //nは各単位から度への変換数値。_sは単位の文字列を表す
+ if (unitType === SVGAngle.SVG_ANGLETYPE_UNSPECIFIED) {
+ } else if (unitType === SVGAngle.SVG_ANGLETYPE_DEG) {
_s = "deg"
} else if (unitType === SVGAngle.SVG_ANGLETYPE_RAD) {
n = Math.PI / 180;
@@ -660,6 +661,8 @@
} else if (unitType === SVGAngle.SVG_ANGLETYPE_GRAD) {
n = 9 / 10;
_s = "grad";
+ } else {
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR);
}
this.unitType = unitType;
this.value = valueInSpecifiedUnits * n;