OSDN Git Service

Add the addBeginList( and addEndList) method to the . object
authordhrname <dhrname@users.sourceforge.jp>
Fri, 14 Oct 2016 13:56:26 +0000 (22:56 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Fri, 14 Oct 2016 13:56:26 +0000 (22:56 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 354cb3d..5d3a102 100644 (file)
@@ -117,6 +117,20 @@ base("$frame").mix ( {
        value: Number.MAX_VALUE\r
     },\r
     \r
+    addBeginList: function (num) {\r
+      return ( this.beginList = {\r
+                  value: num,\r
+                  next: this.beginList\r
+                } );\r
+    },\r
+    \r
+    addEndList: function (num) {\r
+      return ( this.endList = {\r
+                  value: num,\r
+                  next: this.endList\r
+                } );\r
+    },\r
+    \r
     /*引数に渡された時刻リストの中から、現在フレームf以下の、最大値を求めるメソッド\r
      * -1を返したときはリストの中にf以下の値がないことを示す*/\r
     getMaxList: function (f, list) {\r
index 1bfc61e..e2abd8d 100644 (file)
@@ -329,16 +329,25 @@ describe("SMIL Animation Spec", function() {
         expect(frame.currentFrame).toBe(1);\r
         \r
         expect(typeof frame.addEvent).toBe("function");\r
+        expect(typeof frame.addBeginList).toBe("function");\r
+        expect(typeof frame.addEndList).toBe("function");\r
+        \r
+        expect(frame.addBeginList(1).value).toBe(1);\r
+        expect(frame.beginList.next.value).toBe(Number.MAX_VALUE);\r
+        expect(frame.addEndList(1).value).toBe(1);\r
+        expect(frame.endList.next.value).toBe(Number.MAX_VALUE);\r
+        \r
+        expect(frame.addBeginList(1).value).toBe(1);\r
+        expect(frame.beginList.next.value).toBe(1);\r
+        expect(frame.addBeginList(1).value).toBe(1);\r
+        expect(frame.beginList.next.value).toBe(1);\r
 \r
       } );\r
       /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
       it("should be this for the value (the valid partion)", function() {\r
         function appendBegin(num) {\r
           frame.state = frame.WAITING;\r
-          frame.beginList = {\r
-            value: num,\r
-            next: frame.beginList\r
-          };\r
+          frame.addBeginList(num);\r
         };\r
         appendBegin(0);\r
         expect(frame.currentFrame).toBe(0);\r
@@ -361,10 +370,7 @@ describe("SMIL Animation Spec", function() {
         function appendEnd(num) {\r
           frame.state = frame.WAITING;\r
           frame.begin = 0;\r
-          frame.endList = {\r
-              value: num,\r
-              next: frame.endList\r
-          };\r
+          frame.addEndList(num);\r
         };\r
         \r
         appendEnd(3);\r