OSDN Git Service

Edit the Spec for the
authordhrname <dhrname@users.sourceforge.jp>
Mon, 17 Oct 2016 12:21:29 +0000 (21:21 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Mon, 17 Oct 2016 12:21:29 +0000 (21:21 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index db84e43..b4982ad 100644 (file)
@@ -1305,7 +1305,7 @@ base("$calcMode").up("$attribute").mix( {
   to: "",\r
   \r
   /*initメソッドで使われるアニメーション関数*/\r
-  _setFrame: function () {\r
+  _setFrame: function ($list) {\r
     this.setAttribute(this.to);\r
   },\r
   \r
@@ -1313,7 +1313,7 @@ base("$calcMode").up("$attribute").mix( {
   timeline: base("$frame").$begin,\r
   \r
   /*アニメが終了した際の後処理*/\r
-  _setEndFrame: function (frame) {\r
+  _setEndFrame: function ($list) {\r
     /*removeの場合、アニメーションを凍結せずに、もとに戻す*/\r
     if (this.fill === "remove") {\r
       this.removeAttribute();\r
@@ -1339,7 +1339,7 @@ base("$calcMode").up("$attribute").mix( {
       line.$list.addEvent("end", this._setEndFrame.bind(this));\r
       base("$frame").addLine(line.$list);\r
       /*アニメーションが再起動する可能性もあるため、$listのstateプロパティはここで初期化*/\r
-      line.$list.state = this.$list.WAITING;\r
+      line.$list.state = line.$list.WAITING;\r
     }\r
     line = thisele = void 0;\r
   }\r
@@ -1373,7 +1373,8 @@ base("$calcMode").up("$attribute").mix( {
     return "";\r
   },\r
   \r
-  _setFrame: function(currentTime) {\r
+  _setFrame: function($list) {\r
+    var currentTime = $list.currentFrame;\r
     /*durationは単純継続時間\r
      *advanceは継続時間内での、進捗率\r
      *  仕様を参照 http://www.w3.org/TR/smil-animation/#AnimFuncValues\r
@@ -1392,11 +1393,9 @@ base("$calcMode").up("$attribute").mix( {
   },\r
   \r
   /*_setEndFrameメソッドは、終了処理と凍結作業をするときに、falseを返す*/\r
-  _setEndFrame: function(frame) {\r
+  _setEndFrame: function($list) {\r
+    var frame = $list.currentFrame;\r
     /*上書きされたメソッドを呼び出してアニメーションの凍結作業をする*/\r
-    if (!this.checkEnd(frame)) {\r
-      return;\r
-    }\r
     if (this.fill === "freeze") {\r
       var line = this.timeline,\r
           duration = line.simpleDuration;\r
@@ -1775,7 +1774,7 @@ base("$calcMode").up("$attribute").mix( {
    \r
    _setEndFrame: function(currentFrame) {\r
      var list = this.element.__transformList;\r
-     if (!this.checkEnd(currentFrame) || (this.fill !== "remove") || !list) {\r
+     if ((this.fill !== "remove") || !list) {\r
        return;\r
      }\r
      if (!this.isSum) {\r
index 6b2404b..1a9afd2 100644 (file)
@@ -2234,48 +2234,6 @@ describe("SMIL Animation Spec", function() {
         expect($set.element).toBeNull();\r
       } );\r
     } );\r
-    describe("An checkEnd method", function() {\r
-      var $set, ele, frame;\r
-      beforeEach( function() {\r
-        $set = base("$calcMode").$attribute.$setElement.up();\r
-        var p = document.createElementNS("http://www.w3.org/2000/svg", "g");\r
-        ele = document.createElementNS("http://www.w3.org/2000/svg", "set");\r
-        p.appendChild(ele);\r
-        frame = base("$frame");\r
-      } );\r
-      /*境界条件を調べておく (limit value analysis)*/\r
-      it("should be this for the value  (limit value analysis)", function() {\r
-        expect($set.checkEnd()).toBeFalsy();\r
-        $set.init(ele);\r
-        frame.setFrame(0);\r
-        frame.$endFrame.setFrame(0);\r
-        expect($set.checkEnd()).toBeFalsy();\r
-      } );\r
-      /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
-      it("should be this for the value (the valid partion)", function() {\r
-        ele.setAttributeNS(null, "dur", "1s");\r
-        ele.setAttributeNS(null, "attributeName", "fill");\r
-        ele.setAttributeNS(null, "to", "red");\r
-        $set.init(ele);\r
-        expect($set.checkEnd(0)).toBeFalsy();\r
-        expect($set.checkEnd(24)).toBeFalsy();\r
-        $set.state = "playing";\r
-        expect($set.checkEnd(25)).toBeTruthy();\r
-        expect($set.state).toBe("idling");\r
-        expect($set.checkEnd(26)).toBeFalsy();\r
-      } );\r
-      /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
-      it("should be this for the value (the invalid partion)", function() {\r
-        $set.timeline.isResolved = false;\r
-        expect($set.checkEnd(0)).toBeFalsy();\r
-        $set.timeline.activeTime = null;\r
-        expect($set.checkEnd(0)).toBeFalsy();\r
-        $set.timeline = null;\r
-        expect(function() {\r
-          $set.checkEnd(0);\r
-        } ).toThrow();\r
-      } );\r
-    } );\r
     \r
       describe("An init method", function() {\r
       var $set, ele, frame;\r
@@ -2368,7 +2326,6 @@ describe("SMIL Animation Spec", function() {
       /*境界条件を調べておく (limit value analysis)*/\r
       it("should be this for the value  (limit value analysis)", function() {\r
         expect($set.isEnd).toBeFalsy();\r
-        expect($set.state).toBe("idling");\r
         ele.setAttributeNS(null, "dur", "1s");\r
         ele.setAttributeNS(null, "attributeName", "fill");\r
         ele.setAttributeNS(null, "to", "red");\r
@@ -2379,12 +2336,10 @@ describe("SMIL Animation Spec", function() {
         frame.setFrame(0);\r
         frame.$endFrame.setFrame(0);\r
         expect(ele.parentNode.getAttributeNS(null, "fill")).toBe("red");\r
-        expect($set.state).toBe("playing");\r
         \r
         frame.setFrame(24);\r
         frame.$endFrame.setFrame(24);\r
         expect(ele.parentNode.hasAttributeNS(null, "fill")).toBeFalsy();\r
-        expect($set.state).toBe("idling");\r
       } );\r
       /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
       it("should be this for the value (the valid partion)", function() {\r
@@ -3460,12 +3415,9 @@ describe("SMIL Animation Spec", function() {
         $animate.init(ele);\r
         $animate.isCSS = false;\r
         expect(p.getAttributeNS(null, "fill") || null).toBeNull();\r
-        expect($animate.state).toBe("idling");\r
         evt = ele.ownerDocument.createEvent("MouseEvents");\r
         evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
-        expect($animate.state).toBe("idling");\r
         p.dispatchEvent(evt);\r
-        expect($animate.state).toBe("idling");\r
         expect(p.getAttributeNS(null, "fill") || null).toBeNull();\r
         \r
         evt = ele.ownerDocument.createEvent("MouseEvents");\r
@@ -3473,14 +3425,11 @@ describe("SMIL Animation Spec", function() {
         frame.setFrame(frame.currentFrame);\r
         frame.$endFrame.setFrame(frame.currentFrame);\r
         expect($animate.isEnd).toBeFalsy();\r
-        expect($animate.state).toBe("idling");\r
         p.dispatchEvent(evt);\r
         frame.setFrame(frame.currentFrame + 1);\r
         frame.$endFrame.setFrame(frame.currentFrame + 1);\r
-        expect($animate.state).toBe("playing");\r
         frame.setFrame(frame.currentFrame + 24);\r
         frame.$endFrame.setFrame(frame.currentFrame + 24);\r
-        expect($animate.state).toBe("idling");\r
         expect(evt.target.getAttributeNS(null, "fill") || null).toBe("rgb(10, 10, 1)");\r
       } );\r
     } );\r