From eee554c5f5f6e52a20e3aa4c8f04e676cfbec875 Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 3 Oct 2015 22:24:39 +0900 Subject: [PATCH] Modify a _setEndFrame method --- org/w3c/dom/smil.js | 10 ++++++---- tool/Spec/spec/SvgDomSpec.js | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index b3bbda7..9892ef2 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -992,7 +992,7 @@ base("$calcMode").up("$attribute").mix( { if (!obj) { return null; } - /*activeTimeとbeginとsimpleDurプロパティは_setEndFrame関数内で使うため、コピーしておく*/ + /*以下のプロパティは_setEndFrame関数内で使うため、コピーしておく*/ this.activeTime = obj.activeTime; this.begin = obj.begin; this.simpleDuration = obj.simpleDuration; @@ -1010,8 +1010,10 @@ base("$calcMode").up("$attribute").mix( { /*アニメが終了した際の後処理 * 終了した後は、ひたすらtrueを値として返す*/ _setEndFrame: function(frame) { - if ( ( frame < (this.begin + this.activeTime) ) || this.isEnd) { - /*アニメーションが終了間近でなければ凍結の処理をしない*/ + if (isNaN(this.begin + this.activeTime) + || ( frame < (this.begin + this.activeTime) ) || this.isEnd) { + /*イベントが設定されており、未解決である場合、あるいは、 + * アニメーションが終了間近でなければ凍結の処理をしない*/ return true; } else { this.isEnd = true; @@ -1066,7 +1068,7 @@ base("$calcMode").up("$attribute").mix( { { setFrame: this._setEndFrame.bind(this), begin: 1, activeTime: 1, - rank: Number.MAX_VAULE //最低ランクにすることで、一番最後にタイムラインを実行させる + rank: Number.MAX_VALUE //最低ランクにすることで、一番最後にタイムラインを実行させる } ); } diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 8c35333..13feaf9 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -4247,6 +4247,7 @@ describe("SMIL Animation Spec", function() { expect(evt.target.getAttributeNS(null, "fill") || null).toBe("rgb(10, 10, 1)"); }, false ); frame.setFrame(0); + expect($animate.isEnd).toBeFalsy(); p.dispatchEvent(evt); } ); } ); -- 2.11.0