OSDN Git Service

Modify the Spec for the timeline property
authordhrname <dhrname@users.sourceforge.jp>
Sun, 4 Oct 2015 13:48:53 +0000 (22:48 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 4 Oct 2015 13:48:53 +0000 (22:48 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 43fb522..0237da2 100644 (file)
@@ -1013,10 +1013,11 @@ base("$calcMode").up("$attribute").mix( {
   /*アニメが終了した際の後処理\r
    * 終了した後は、ひたすらtrueを値として返す*/\r
   _setEndFrame: function(frame) {\r
-              if (( frame < (this.begin + this.activeTime) ) || this.isEnd) {\r
+              var line = this.timeline;\r
+              if (( frame < (line.begin + line.activeTime) ) || this.isEnd) {\r
                 /*アニメーションが終了間近でなければ凍結の処理をしない*/\r
                 return true;\r
-              } else if (!isNaN(this.begin + this.activeTime)) {\r
+              } else if (!isNaN(line.begin + line.activeTime)) {\r
                 /*イベントが設定されていないか、解決済みである場合*/\r
                 this.isEnd = true;\r
                 /*removeの場合、アニメーションを凍結せずに、もとに戻す*/\r
@@ -1042,6 +1043,7 @@ base("$calcMode").up("$attribute").mix( {
     }\r
     var thisele = this.element;\r
     if (line && thisele) {\r
+      this.timeline = line;\r
       this._ele = thisele;\r
       if (this.attrName.indexOf("xlink") > -1) {\r
         this.attrNameSpace = "http://www.w3.org/1999/xlink";\r
index 1e4d039..34d2836 100644 (file)
@@ -3770,11 +3770,13 @@ describe("SMIL Animation Spec", function() {
         expect($set.isDefault).toBeFalsy();\r
         expect($set.attrNameSpace).toBeNull();\r
         $set.init();\r
+        expect($set.timeline).toBe(frame.$begin);\r
         $set.init(ele);\r
         expect($set.to).toBe("");\r
         expect($set.attrName).toBe("");\r
         expect($set.isDefault).toBeFalsy();\r
         expect($set.attrNameSpace).toBeNull();\r
+        expect($set.timeline).toBe(frame.$begin);\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
@@ -3842,6 +3844,7 @@ describe("SMIL Animation Spec", function() {
         ele.setAttributeNS(null, "attributeName", "fill");\r
         ele.setAttributeNS(null, "to", "red");\r
         $set.init(ele);\r
+        expect($set.timeline).not.toBe(frame.$begin);\r
         frame.setFrame(0);\r
         expect(ele.parentNode.getAttributeNS(null, "fill")).toBe("red");\r
       } );\r