From a15cefc104612d9d16ab77b68f16955055316e0d Mon Sep 17 00:00:00 2001 From: dhrname Date: Sun, 30 Aug 2015 23:14:18 +0900 Subject: [PATCH] Modify the problem about an event method of the object --- org/w3c/dom/smil.js | 6 +++++- tool/Spec/spec/SvgDomSpec.js | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index ee80b36..5389e93 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -249,6 +249,10 @@ base("$frame").mix ( { * idがない場合や、イベントがない場合は空文字列を該当のプロパティに入れる*/ event: function(str) { str = str || ""; + if (/[\+\-]/.test(str)) { + /*数値がある場合は切り取っておく*/ + str = str.slice(0, str.search(/[\+\-]/)); + } if (str.indexOf(".") > -1) { /*ドットが見つかった場合、IDとイベントに分けておく*/ var ide = str.split("."); @@ -443,7 +447,7 @@ base("$frame").mix ( { /*強制的に終了させる*/ this.removeLine(this.$begin); } - this.begin += this.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); + this.begin += this.$frame.currentFrame - Math.floor( (Date.now() - evt.timeStamp) * this.fpms ); var s = this.$begin.$activate; s.end = this.begin; this.$begin.activeTime = s.call(); diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 88bc902..e13a928 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2315,6 +2315,13 @@ describe("SMIL Animation Spec", function() { evt = begin.event("event"); expect(evt.id).toBe(""); expect(evt.event).toBe("event"); + + evt = begin.event("event+0s"); + expect(evt.id).toBe(""); + expect(evt.event).toBe("event"); + evt = begin.event("event-0s"); + expect(evt.id).toBe(""); + expect(evt.event).toBe("event"); } ); /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ it("should be this for the value (the invalid partion)", function() { -- 2.11.0