type: "translate",\r
\r
/*additive属性がsumなら真*/\r
- isAdditive: false,\r
+ isSum: false,\r
\r
/*$animateElementオブジェクトのtocallメソッドをオーバライド*/\r
tocall: function (advance) {\r
if (this.numberOfList < 0) {\r
throw new Error("Number of The List Error");\r
}\r
- if (this.isAdditive\r
- || (this.numberOfList === (this.element.__transformList.length - 1) )) {\r
- this.element.__transformList[this.numberOfList] = this.type+ "(" +this.$animateElement.tocall.call(this, advance)+ ")";\r
- }\r
+ this.element.__transformList[this.numberOfList] = this.type+ "(" +this.$animateElement.tocall.call(this, advance)+ ")";\r
var d = this.defaultValue;\r
d = d && (d + " ");\r
- return d + this.element.__transformList.join(" ");\r
+ if (this.isSum) {\r
+ return d + this.element.__transformList.join(" ");\r
+ } else {\r
+ return this.element.__transformList[this.element.__transformList.length-1];\r
+ }\r
}\r
})\r
.on("init", function (ele) {\r
var parent = this.element;\r
this.isDefault = parent.hasAttributeNS(null, "transform");\r
this.defaultValue = parent.getAttributeNS(null, "transform") || "";\r
- this.isAdditive = (parent.getAttributeNS(null, "additive") === "sum");\r
+ this.isSum = (this.getAttr("additive", "replace") === "sum");\r
if (!parent.__transformList) {\r
parent.__transformList = [];\r
}\r
expect($animate.numberOfList).toBe(0);\r
expect(p.__transformList).toEqual(["translate(0)"]);\r
expect($animate.type).toBe("scale");\r
+ \r
+ expect($animate.isSum).toBeFalsy();\r
+ ele.setAttributeNS(null, "additive", "sum");\r
+ $animate.init(ele);\r
+ expect($animate.isSum).toBeTruthy();\r
+ ele.setAttributeNS(null, "additive", "replace");\r
+ $animate.init(ele);\r
+ expect($animate.isSum).toBeFalsy();\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion )", function() {\r
\r
ele.setAttributeNS(null, "additive", "sum");\r
ele.parentNode.appendChild(ele.cloneNode(true));\r
+ ele.parentNode.__transformList = [];\r
$animate.numberOfList = -1;\r
$animate.init(ele.parentNode.lastChild);\r
- expect($animate.numberOfList).toBe(1);\r
- expect($animate.tocall(0)).toBe("scale(1.0) scale(0.0)");\r
- expect($animate.tocall(1)).toBe("scale(1.0) scale(1.0)");\r
+ expect($animate.numberOfList).toBe(0);\r
+ expect($animate.tocall(0)).toBe("matrix(0 0 0 0 0 0) scale(0.0)");\r
+ expect($animate.tocall(1)).toBe("matrix(0 0 0 0 0 0) scale(1.0)");\r
\r
ele.parentNode.appendChild(ele.cloneNode(true));\r
$animate.up("$a").numberOfList = -1;\r
+ ele.parentNode.__transformList = [];\r
ele.parentNode.setAttribute("transform", "matrix(0 0 0 0 0 0)");\r
$animate.$a.init(ele.parentNode.lastChild);\r
- expect($animate.$a.numberOfList).toBe(2);\r
+ expect($animate.$a.numberOfList).toBe(0);\r
expect($animate.$a.isDefault).toBeTruthy();\r
expect($animate.$a.defaultValue).toBe("matrix(0 0 0 0 0 0)");\r
- expect($animate.$a.tocall(0)).toBe("matrix(0 0 0 0 0 0) scale(1.0) scale(1.0) scale(0.0)");\r
- expect($animate.$a.tocall(1)).toBe("matrix(0 0 0 0 0 0) scale(1.0) scale(1.0) scale(1.0)");\r
+ expect($animate.$a.tocall(0)).toBe("matrix(0 0 0 0 0 0) scale(0.0)");\r
+ expect($animate.$a.tocall(1)).toBe("matrix(0 0 0 0 0 0) scale(1.0)");\r
$animate.defaultValue = $animate.$a.defaultValue;\r
- expect($animate.tocall(0.1)).toBe("matrix(0 0 0 0 0 0) scale(1.0) scale(0.1) scale(1.0)");\r
+ expect($animate.tocall(0.1)).toBe("matrix(0 0 0 0 0 0) scale(0.1)");\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion )", function() {\r