OSDN Git Service

Modify the updateState method
authordhrname <dhrname@users.sourceforge.jp>
Sun, 6 Nov 2016 14:10:34 +0000 (23:10 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 6 Nov 2016 14:10:34 +0000 (23:10 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 44d853e..c7636e4 100644 (file)
@@ -193,7 +193,7 @@ base("$frame").mix ( {
           post = /*this.POSTWAITING*/ 4;\r
       /*beginListプロパティと、endListプロパティの中で、\r
        * 現在フレーム数 f より大きい数値は、更新できる条件と無関係なので、除外しておく\r
-       * ã\81¾ã\81\9f、f以下の値の中から、最大値を探して、\r
+       * ã\81 ã\81\8bã\82\89、f以下の値の中から、最大値を探して、\r
        * それをbeginプロパティの値cacheBeginと比較する*/\r
       var startTime = this.getMaxList(f, this.beginList),\r
           endTime = this.getMaxList(f, this.endList),\r
@@ -212,8 +212,8 @@ base("$frame").mix ( {
         if (endTime >= cacheBegin) {\r
           /*終了時刻にもう到達したときは、直接BEGINNING状態からENDING状態へ移行*/\r
           this.state = end;\r
-          /*現時点を終了時刻とみなす*/\r
-          this.end = f;\r
+          /*endTimeを終了時刻とみなす*/\r
+          (endTime > 0) && (this.end = endTime);\r
           /*activeTimeプロパティは、begin属性とend属性が反映されていないため、\r
            * beginEndプロパティに別に設定しておく*/\r
           this.beginEnd = 0;\r
@@ -221,7 +221,11 @@ base("$frame").mix ( {
           this.state = play;\r
         }\r
       } else if (state === play) {\r
-        if ( (endTime >= cacheBegin) || (startTime > cacheBegin) ) {\r
+        /*activeTimeプロパティを比較して、変数endTimeを書き換える*/\r
+        var act = cacheBegin + this.activeTime;\r
+        endTime = (endTime > act) ? act\r
+                                  : endTime;\r
+        if ( (f >= act) || (endTime >= cacheBegin) || (startTime > cacheBegin) ) {\r
           /*終了時刻に到達したか、再び開始イベントが発火されたとき*/\r
           this.state = end;\r
           if (endTime > 0) {\r
@@ -229,7 +233,7 @@ base("$frame").mix ( {
             this.end = endTime;\r
             /*activeTimeプロパティは、begin属性とend属性が反映されていないため、\r
              * beginEndプロパティに別に設定しておく*/\r
-            this.beginEnd = endTime - startTime;\r
+            this.beginEnd = endTime - cacheBegin;\r
           }\r
         }\r
       } else if (state === end) {\r
index 8e3a6f4..f866a41 100644 (file)
@@ -2409,7 +2409,9 @@ describe("SMIL Animation Spec", function() {
           f(25, "M20.0 24.1 L20.0 30.0");\r
           f(47, "M20.0 26.3 L20.0 30.0");\r
           f(48, "M20.0 26.4 L20.0 30.0");\r
+          console.log($animate.timeline.$list);\r
           f(49, "M20.0 26.4 L20.0 30.0");\r
+          console.log($animate.timeline.$list);\r
           f(50, "M20.0 26.4 L20.0 30.0");\r
           \r
           frame.timelines.length = 0;\r