OSDN Git Service

Change the first argument of the setValues method
authordhrname <dhrname@users.sourceforge.jp>
Fri, 8 May 2015 13:05:16 +0000 (22:05 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Fri, 8 May 2015 13:05:16 +0000 (22:05 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 7d879eb..402dd1d 100644 (file)
@@ -756,6 +756,7 @@ base("$calcMode").up("$attribute").mix( {
                } )\r
              } ),\r
          sto = s.to;\r
+     values = values && values.split(";");\r
      /*from属性はオプションなので、条件には付け加えない*/\r
      if (values && values.length) {\r
        /*values属性が指定された場合、他の属性は無視される\r
@@ -794,9 +795,7 @@ base("$calcMode").up("$attribute").mix( {
     * 引数の要素のkeyTimes属性やkeySplines属性を処理するためのメソッド\r
     * 必要な他の属性処理はsetValuesメソッドに任せている*/\r
    setKey: function(ele) {\r
-     var values = getAttr("values");\r
-     values = values && values.split(";");\r
-     var to = this.setValues(values,\r
+     var to = this.setValues(getAttr("values"),\r
           getAttr("from"),\r
           getAttr("to"),\r
           getAttr("by") ),\r
@@ -820,7 +819,7 @@ base("$calcMode").up("$attribute").mix( {
        return ele.getAttributeNS(null, name);\r
      };\r
      \r
-     line = values = ele = keyTimes = keys = void 0;\r
+     ele = keyTimes = keys = void 0;\r
      return to;\r
    }\r
 } );\r
index 0ba3865..2532a03 100644 (file)
@@ -3446,12 +3446,12 @@ describe("SMIL Animation Spec", function() {
       it("should be this for the value  (limit value analysis)", function() {\r
         expect(attr.$from).not.toBeUndefined();\r
         expect(attr.setValues()).toBeNull();\r
-        expect(attr.setValues([])).toBeNull();\r
+        expect(attr.setValues("")).toBeNull();\r
 \r
-        expect(attr.setValues(["0", "1"])[0].to.string).toBe("1");\r
-        expect(attr.setValues(["0", "1"])[0].to.from.string).toBe("0");\r
-        expect(attr.setValues(["0", "1"], "0", "1", "1")[0].to.from.string).toBe("0");\r
-        expect(attr.setValues(["0", "1"], null, "1", "0")[0].to.from.string).toBe("0"); \r
+        expect(attr.setValues("0;1")[0].to.string).toBe("1");\r
+        expect(attr.setValues("0;1")[0].to.from.string).toBe("0");\r
+        expect(attr.setValues("0;1", "0", "1", "1")[0].to.from.string).toBe("0");\r
+        expect(attr.setValues("0;1", null, "1", "0")[0].to.from.string).toBe("0"); \r
                \r
         /*from-to アニメーション*/\r
         expect(attr.setValues(null, "0", "1").to.string).toBe("1");\r
@@ -3479,23 +3479,23 @@ describe("SMIL Animation Spec", function() {
       /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
       it("should be this for the value (the valid partion on a spline mode )", function() {\r
         attr.$from.degit = 1;\r
-        var setv = attr.setValues(["0", "1"])[0].call();\r
+        var setv = attr.setValues("0;1")[0].call();\r
         expect(setv(0.5)).toBe("0.5");\r
         expect(setv(1)).toBe("1.0");\r
         \r
-        setv = attr.setValues(["0", "1", "2"])[0].call();\r
+        setv = attr.setValues(" 0;1; 2 ")[0].call();\r
         expect(setv(0.5)).toBe("0.5");\r
         expect(setv(1)).toBe("1.0");\r
-        setv = attr.setValues(["0", "1", "2"])[1].call();\r
+        setv = attr.setValues("0;1;2")[1].call();\r
         expect(setv(0.4)).toBe("1.4");\r
         expect(setv(1)).toBe("2.0");\r
         \r
         attr.$from.degit = 2;\r
-        setv = attr.setValues(["1", "1", "1", "1", "1", "15.1"])[4].call();\r
+        setv = attr.setValues("1;1;1;1 ;1;15.1")[4].call();\r
         expect(setv(0.5)).toBe("8.05");\r
         expect(setv(1)).toBe("15.10");\r
         \r
-        var v = attr.setValues(["1", "1", "2", "1", "1", "15.1"]);\r
+        var v = attr.setValues("1;1;2;1;1;15.1");\r
         setv = v[4].mix( {\r
          keyTime: 0.1\r
         } ).call();\r
@@ -3515,7 +3515,7 @@ describe("SMIL Animation Spec", function() {
       /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
       it("should be this for the value (the invalid partion on a spline mode )", function() {\r
         attr.$from.degit = 1;\r
-        expect(attr.setValues([])).toBeNull();\r
+        expect(attr.setValues("")).toBeNull();\r
         expect(attr.setValues(null, null, null, null)).toBeNull();\r
       } );\r
     } );\r