From d8032238ff797fad035905dba70b5ec0d4db551a Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 26 Sep 2015 23:04:07 +0900 Subject: [PATCH] Add a rank property to the object --- org/w3c/dom/smil.js | 5 ++++- tool/Spec/spec/SvgDomSpec.js | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index f2acaa9..d79d8b9 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -181,6 +181,8 @@ base("$frame").mix ( { this.removeLine(obj); } this.timelines.push( obj ); + /*ランクをソートしておくことで、タイムラインを実行する順序を決める + * 主に、begin用のタイムラインの前に、end用のタイムラインが実行されるのを防ぐのが目的*/ this.timelines.sort( function (a, b) { return a.rank - b.rank; } ) @@ -1046,7 +1048,8 @@ base("$calcMode").up("$attribute").mix( { base("$frame").addLine( { setFrame: this._setEndFrame.bind(this), begin: 1, - activeTime: 1 + activeTime: 1, + rank: Number.MAX_VAULE //最低ランクにすることで、一番最後にタイムラインを実行させる } ); } diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 5f1a887..6728cf5 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -4206,6 +4206,10 @@ describe("SMIL Animation Spec", function() { ele.setAttributeNS(null, "from", "rgb(0,0,0)"); ele.setAttributeNS(null, "to", "rgb(10,10,1)"); $animate.init(ele); + p.addEventListener("mousedown", function(evt) { + frame.setFrame(20); + expect(evt.target.getAttributeNS(null, "fill") || null).toBeNull(); + }, false ); expect(p.getAttributeNS(null, "fill") || null).toBeNull(); evt = ele.ownerDocument.createEvent("MouseEvents"); evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele); -- 2.11.0