From: dhrname Date: Fri, 8 May 2015 13:05:16 +0000 (+0900) Subject: Change the first argument of the setValues method X-Git-Tag: version22~199 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5f767813c30acb8266e9c8ccfb536097fec9abda;p=sie%2Fsie.git Change the first argument of the setValues method --- diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 7d879eb..402dd1d 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -756,6 +756,7 @@ base("$calcMode").up("$attribute").mix( { } ) } ), sto = s.to; + values = values && values.split(";"); /*from属性はオプションなので、条件には付け加えない*/ if (values && values.length) { /*values属性が指定された場合、他の属性は無視される @@ -794,9 +795,7 @@ base("$calcMode").up("$attribute").mix( { * 引数の要素のkeyTimes属性やkeySplines属性を処理するためのメソッド * 必要な他の属性処理はsetValuesメソッドに任せている*/ setKey: function(ele) { - var values = getAttr("values"); - values = values && values.split(";"); - var to = this.setValues(values, + var to = this.setValues(getAttr("values"), getAttr("from"), getAttr("to"), getAttr("by") ), @@ -820,7 +819,7 @@ base("$calcMode").up("$attribute").mix( { return ele.getAttributeNS(null, name); }; - line = values = ele = keyTimes = keys = void 0; + ele = keyTimes = keys = void 0; return to; } } ); diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 0ba3865..2532a03 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -3446,12 +3446,12 @@ describe("SMIL Animation Spec", function() { it("should be this for the value (limit value analysis)", function() { expect(attr.$from).not.toBeUndefined(); expect(attr.setValues()).toBeNull(); - expect(attr.setValues([])).toBeNull(); + expect(attr.setValues("")).toBeNull(); - expect(attr.setValues(["0", "1"])[0].to.string).toBe("1"); - expect(attr.setValues(["0", "1"])[0].to.from.string).toBe("0"); - expect(attr.setValues(["0", "1"], "0", "1", "1")[0].to.from.string).toBe("0"); - expect(attr.setValues(["0", "1"], null, "1", "0")[0].to.from.string).toBe("0"); + expect(attr.setValues("0;1")[0].to.string).toBe("1"); + expect(attr.setValues("0;1")[0].to.from.string).toBe("0"); + expect(attr.setValues("0;1", "0", "1", "1")[0].to.from.string).toBe("0"); + expect(attr.setValues("0;1", null, "1", "0")[0].to.from.string).toBe("0"); /*from-to アニメーション*/ expect(attr.setValues(null, "0", "1").to.string).toBe("1"); @@ -3479,23 +3479,23 @@ describe("SMIL Animation Spec", function() { /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/ it("should be this for the value (the valid partion on a spline mode )", function() { attr.$from.degit = 1; - var setv = attr.setValues(["0", "1"])[0].call(); + var setv = attr.setValues("0;1")[0].call(); expect(setv(0.5)).toBe("0.5"); expect(setv(1)).toBe("1.0"); - setv = attr.setValues(["0", "1", "2"])[0].call(); + setv = attr.setValues(" 0;1; 2 ")[0].call(); expect(setv(0.5)).toBe("0.5"); expect(setv(1)).toBe("1.0"); - setv = attr.setValues(["0", "1", "2"])[1].call(); + setv = attr.setValues("0;1;2")[1].call(); expect(setv(0.4)).toBe("1.4"); expect(setv(1)).toBe("2.0"); attr.$from.degit = 2; - setv = attr.setValues(["1", "1", "1", "1", "1", "15.1"])[4].call(); + setv = attr.setValues("1;1;1;1 ;1;15.1")[4].call(); expect(setv(0.5)).toBe("8.05"); expect(setv(1)).toBe("15.10"); - var v = attr.setValues(["1", "1", "2", "1", "1", "15.1"]); + var v = attr.setValues("1;1;2;1;1;15.1"); setv = v[4].mix( { keyTime: 0.1 } ).call(); @@ -3515,7 +3515,7 @@ describe("SMIL Animation Spec", function() { /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ it("should be this for the value (the invalid partion on a spline mode )", function() { attr.$from.degit = 1; - expect(attr.setValues([])).toBeNull(); + expect(attr.setValues("")).toBeNull(); expect(attr.setValues(null, null, null, null)).toBeNull(); } ); } );