OSDN Git Service

Support the setValues method
authordhrname <dhrname@users.sourceforge.jp>
Thu, 16 Apr 2015 12:40:02 +0000 (21:40 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Thu, 16 Apr 2015 12:40:02 +0000 (21:40 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index e9a99fa..e541770 100644 (file)
@@ -732,6 +732,23 @@ base("$calcMode").up("$attribute").mix( {
       return (ele.getAttributeNS(null, name) || null);\r
     };\r
     getAttr = begin = ele = void 0;\r
-  }\r
+  },\r
+  \r
+  /*setValuesメソッド\r
+   * values属性やfrom属性やto属性を処理するためのメソッド\r
+   * valuesは配列、それ以外の引数は文字列*/\r
+   setValues: function(values, from, to, by) {\r
+     if (!values) {\r
+       return null;\r
+     }\r
+     var s = this.up();\r
+     if (values.length) {\r
+       s.to.string = values[0];\r
+       s.to.from.string = values[1];\r
+     } else {\r
+       return null;\r
+     }\r
+     return s;\r
+   }\r
 } );\r
 //#endif // _SMIL_IDL_\r
index 727029b..5bb9d9c 100644 (file)
@@ -3442,6 +3442,11 @@ describe("SMIL Animation Spec", function() {
       } );\r
       /*境界条件を調べておく (limit value analysis)*/\r
       it("should be this for the value  (limit value analysis)", function() {\r
+        expect(attr.setValues()).toBeNull();\r
+        expect(attr.setValues([])).toBeNull();\r
+\r
+        expect(attr.setValues(["0", "1"]).to.string).toBe("0");\r
+        expect(attr.setValues(["0", "1"]).to.from.string).toBe("1");\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