OSDN Git Service

Support the from attribute
authordhrname <dhrname@users.sourceforge.jp>
Sun, 19 Apr 2015 13:32:00 +0000 (22:32 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 19 Apr 2015 13:32:00 +0000 (22:32 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 0129c8b..a6df45b 100644 (file)
@@ -743,17 +743,18 @@ base("$calcMode").up("$attribute").mix( {
                  from: base("$from").up()\r
                } )\r
              } );\r
+     /*from属性はオプションなので、条件には付け加えない*/\r
      if (values && values.length) {\r
        /*values属性が指定された場合、他の属性は無視される\r
         * W3C仕様 SMIL アニメーション 3.2.2. アニメーション関数の値*/\r
        s.to.string = values[1];\r
        s.to.from.string = values[0];\r
-     } else if (from && to) {\r
+     } else if (to) {\r
        s.to.string = to;\r
-       s.to.from.string = from;\r
-     } else if (from && by) {\r
+       s.to.from.string = from || "0";\r
+     } else if (by) {\r
        s.to.string = by;\r
-       s.to.from.string = from;\r
+       s.to.from.string = from || "0";\r
        var toNumList = s.to.call(),\r
            fromNumList = s.to.from;\r
        for (var i=0;i<toNumList.length;++i) {\r
index 68a0128..1f78c4b 100644 (file)
@@ -3455,8 +3455,15 @@ describe("SMIL Animation Spec", function() {
         \r
         /*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.from[0]).toEqual(1);\r
         expect(attr.setValues(null, "1", null, "1").to.numList[0]).toEqual(2);\r
+        \r
+        /*fromなしto アニメーション*/\r
+        expect(attr.setValues(null, null, "1").to.string).toBe("1");\r
+        expect(attr.setValues(null, null, "1").to.from.string).toBe("0");\r
+        var aset = attr.setValues(null, null, "1").to;\r
+        aset.call();\r
+        expect(aset.from[0]).toEqual(0);\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