From 823be4276d9acdd7726ed356f46f33e7d686dbc4 Mon Sep 17 00:00:00 2001 From: dhrname Date: Tue, 26 Apr 2016 23:24:02 +0900 Subject: [PATCH] Add the isPlaying property to the __transformList --- org/w3c/dom/smil.js | 6 ++++-- tool/Spec/spec/SvgDomSpec.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 41647cc..7ac2556 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -1546,8 +1546,10 @@ base("$calcMode").up("$attribute").mix( { if (this.numberOfList < 0) { throw new Error("Number of The List Error"); } - var list = this.element.__transformList; - list[this.numberOfList].value = this.type+ "(" +this.$animateElement.tocall.call(this, advance)+ ")"; + var list = this.element.__transformList, + currentList = list[this.numberOfList]; + currentList.value = this.type+ "(" +this.$animateElement.tocall.call(this, advance)+ ")"; + currentList.isPlaying = true; var d = this.defaultValue; d = d && (d + " "); /*他のanimateTransform要素がadditive属性の値にreplaceをすでに設定していた場合、 diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 4a770db..2b3b3b6 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2778,16 +2778,20 @@ describe("SMIL Animation Spec", function() { expect($animate.type).toBe("translate"); expect(p.__transformList).toEqual([ {isPlaying: false, value: "translate(0)"} ]); + $animate.tocall(0); + expect(p.__transformList[0].isPlaying).toBeTruthy(); ele.parentNode.appendChild(ele.cloneNode(true)); $animate.numberOfList = -1; $animate.init(ele.parentNode.lastChild); expect($animate.numberOfList).toBe(1); - expect(p.__transformList).toEqual([ {isPlaying: false, - value: "translate(0)"}, - {isPlaying: false, - value: "translate(0)"} ]); + expect(p.__transformList[0].isPlaying).toBeTruthy(); + expect(p.__transformList[1].isPlaying).toBeFalsy(); + expect($animate.type).toBe("translate"); + $animate.tocall(0); + expect(p.__transformList[0].isPlaying).toBeTruthy(); + expect(p.__transformList[1].isPlaying).toBeTruthy(); delete p.__transformList; ele.setAttributeNS(null, "type", "scale"); -- 2.11.0