OSDN Git Service

Add the init method to the . object
authordhrname <dhrname@users.sourceforge.jp>
Sun, 30 Oct 2016 12:56:32 +0000 (21:56 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 30 Oct 2016 12:56:32 +0000 (21:56 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index bcbae4e..371f62d 100644 (file)
@@ -165,6 +165,13 @@ base("$frame").mix ( {
     /*終了処理をした後の待機状態を示す定数*/\r
     POSTWAITING: 4,\r
     \r
+    /*初期化用メソッド*/\r
+    init: function() {\r
+      this.state = this.WAITING;\r
+      this.begin = 0;\r
+      return this;\r
+    },\r
+    \r
     /*引数で指定されたフレーム数に応じて、stateプロパティを更新するメソッド*/\r
     updateState: function( /*number*/ f) {\r
       if (f === void 0) {\r
@@ -1103,7 +1110,7 @@ base("$calcMode").up("$attribute").mix( {
                     max: this.getAttr("max", "indefinite")\r
                   } )\r
                 } ).updateList().parse();\r
-    $frame.addLine(frame.$list);\r
+    $frame.addLine(frame.$list.init());\r
     /*beginElementメソッドを追加*/\r
     function eleMethod (obj, eventName) {\r
       return (obj.string !== "indefinite") ? function(){}\r
index 15e3d05..b3198ff 100644 (file)
@@ -205,6 +205,13 @@ describe("SMIL Animation Spec", function() {
         \r
       expect(frame.getMaxList(0, frame.beginList)).toBe(-1);\r
       expect(frame.getMaxList(0, frame.endList)).toBe(-1);\r
+      \r
+      frame.begin = 12;\r
+      frame.init();\r
+      expect(frame.state).toBe(frame.WAITING);\r
+      expect(frame.begin).toBe(0);\r
+      expect(frame.init()).toBe(frame);\r
+\r
     } );\r
     /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
     it("should be this for the value (the valid partion)", function() {\r