OSDN Git Service

Modify the Spec for the setValues method
authordhrname <dhrname@users.sourceforge.jp>
Sat, 18 Apr 2015 13:39:33 +0000 (22:39 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sat, 18 Apr 2015 13:39:33 +0000 (22:39 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 42a6199..0129c8b 100644 (file)
@@ -739,7 +739,7 @@ base("$calcMode").up("$attribute").mix( {
    * valuesは配列、それ以外の引数は文字列*/\r
    setValues: function(values, from, to, by) {\r
      var s = this.up().mix( {\r
-               to: base("$from").$to.up().mix( {\r
+               to: base("$from").up().mix( {\r
                  from: base("$from").up()\r
                } )\r
              } );\r
@@ -754,6 +754,12 @@ base("$calcMode").up("$attribute").mix( {
      } else if (from && by) {\r
        s.to.string = by;\r
        s.to.from.string = from;\r
+       var toNumList = s.to.call(),\r
+           fromNumList = s.to.from;\r
+       for (var i=0;i<toNumList.length;++i) {\r
+         /*初期値と差分を足していく*/\r
+         toNumList[i] += fromNumList[i];\r
+       }\r
      } else {\r
        return null;\r
      }\r
index ae412e3..68a0128 100644 (file)
@@ -2929,13 +2929,14 @@ describe("SMIL Animation Spec", function() {
     var from = base("$from");\r
      beforeEach( function() {\r
        from = base("$from").up();\r
+       from.up("$to");\r
        from.string = "";\r
      } );\r
     /*境界条件を調べておく (limit value analysis)*/\r
     it("should be this for the value  (limit value analysis)", function() {\r
       expect(from.$to instanceof from.constructor).toBeTruthy();\r
-      expect(from.call()).toBe(from.numList);\r
-      expect(from.$to.call()).toBe(from.$to.numList);\r
+      expect(from.up().call()).toBe(from.$1.numList);\r
+      expect(from.$to.up().call()).toBe(from.$to.$1.numList);\r
     } );\r
     /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
     it("should be this for the value (the valid partion)", function() {\r
@@ -3455,6 +3456,7 @@ describe("SMIL Animation Spec", function() {
         /*from-by アニメーション*/\r
         expect(attr.setValues(null, "1", null, "1").to.string).toBe("1");\r
         expect(attr.setValues(null, "1", null, "1").to.from.string).toBe("1");\r
+        expect(attr.setValues(null, "1", null, "1").to.numList[0]).toEqual(2);\r
       } );\r
       /*同値分割をして、有効同値クラスを調べておく (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