OSDN Git Service

Add an end property to the . object
authordhrname <dhrname@users.sourceforge.jp>
Thu, 3 Nov 2016 13:09:28 +0000 (22:09 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Thu, 3 Nov 2016 13:09:28 +0000 (22:09 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index be124a7..98a3e81 100644 (file)
@@ -105,13 +105,16 @@ base("$frame").mix ( {
   }\r
 } ).mix( function($frame) {\r
   $frame.up("$list").mix( {\r
-    /*開始時刻リスト (後述のupdateStateメソッドで使う)*/\r
+    /*終了時刻(単位フレーム数)のキャッシュとして使う*/\r
+    end: 0,\r
+    \r
+    /*開始時刻(単位フレーム数)リスト (後述のupdateStateメソッドで使う)*/\r
     beginList: { \r
       next: null,\r
       value: Number.MAX_VALUE\r
     },\r
     \r
-    /*終了時刻リスト (後述のupdateStateメソッドで使う)*/\r
+    /*終了時刻(単位フレーム数)リスト (後述のupdateStateメソッドで使う)*/\r
     endList: {\r
        next: null,\r
        value: Number.MAX_VALUE\r
@@ -204,6 +207,8 @@ base("$frame").mix ( {
         if (endTime >= cacheBegin) {\r
           /*終了時刻にもう到達したときは、直接BEGINNING状態からENDING状態へ移行*/\r
           this.state = end;\r
+          /*現時点を終了時刻とみなす*/\r
+          this.end = f;\r
         } else {\r
           this.state = play;\r
         }\r
@@ -211,6 +216,8 @@ base("$frame").mix ( {
         if ( (endTime >= cacheBegin) || (startTime > cacheBegin) ) {\r
           /*終了時刻に到達したか、再び開始イベントが発火されたとき*/\r
           this.state = end;\r
+          /*現時点を終了時刻とみなす*/\r
+          this.end = f;\r
         }\r
       } else if (state === end) {\r
         if (endTime >= cacheBegin) {\r
@@ -1049,7 +1056,8 @@ base("$calcMode").up("$attribute").mix( {
         evt.initMouseEvent("beginEvent" ,true, true, window, detail, 0, 0, 0, 0, false, false, false, false, 0, target);\r
         target.dispatchEvent(evt);\r
         /*repeatイベントのために、_repeatListプロパティを初期化する*/\r
-        var list = this._repeatList = [];\r
+        var list = this._repeatList = [],\r
+            simpleDuration = this.timeline.simpleDuration;\r
       }.bind(this) );\r
     $list.addEvent("end", function() {\r
         var target = this._ele;\r
index 4415779..edd03ce 100644 (file)
@@ -166,6 +166,7 @@ describe("SMIL Animation Spec", function() {
       expect(frame.ENDING).toBe(3);\r
       expect(frame.POSTWAITING).toBe(4);\r
       expect(frame.state).toBe(frame.WAITING);\r
+      expect(frame.end).toBe(0);\r
       \r
       expect(frame.beginList).toEqual({\r
               next: null,\r
@@ -267,6 +268,7 @@ describe("SMIL Animation Spec", function() {
       expect(frame.updateState(0).state).toBe(frame.PLAYING);\r
       expect(frame.begin).toBe(0);\r
       expect(frame.updateState(1).state).toBe(frame.ENDING);\r
+      expect(frame.end).toBe(1);\r
       expect(frame.updateState(1).state).toBe(frame.BEGINNING);\r
       expect(frame.begin).toBe(1);\r
       expect(frame.updateState(1).state).toBe(frame.PLAYING);\r
@@ -288,6 +290,7 @@ describe("SMIL Animation Spec", function() {
       expect(frame.state).toBe(frame.PLAYING);\r
       expect(frame.updateState(3).state).toBe(frame.ENDING);\r
       expect(frame.state).toBe(frame.ENDING);\r
+      expect(frame.end).toBe(3);\r
       expect(frame.updateState(4).state).toBe(frame.POSTWAITING);\r
       expect(frame.state).toBe(frame.POSTWAITING);\r
       \r
@@ -299,6 +302,7 @@ describe("SMIL Animation Spec", function() {
       expect(frame.state).toBe(frame.PLAYING);\r
       expect(frame.updateState(3).state).toBe(frame.ENDING);\r
       expect(frame.state).toBe(frame.ENDING);\r
+      expect(frame.end).toBe(3);\r
       expect(frame.updateState(4).state).toBe(frame.POSTWAITING);\r
       expect(frame.state).toBe(frame.POSTWAITING);\r
       expect(frame.updateState(4).state).toBe(frame.POSTWAITING);\r
@@ -307,6 +311,7 @@ describe("SMIL Animation Spec", function() {
       appendEnd(1);\r
       expect(frame.updateState(1).state).toBe(frame.BEGINNING);\r
       expect(frame.updateState(1).state).toBe(frame.ENDING);\r
+      expect(frame.end).toBe(1);\r
       expect(frame.updateState(1).state).toBe(frame.POSTWAITING);\r
     } );\r
     /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r