From c44fd53551b25c582b81aa6a2958620c032d70ff Mon Sep 17 00:00:00 2001 From: dhrname Date: Tue, 7 Apr 2015 23:25:36 +0900 Subject: [PATCH] Modify the Spec for the object --- org/w3c/dom/smil.js | 6 +++--- tool/Spec/spec/SvgDomSpec.js | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index f138872..079dcc3 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -310,7 +310,7 @@ base("$frame").mix ( { * $begin オブジェクトからの継承*/ } ).up("$activate").of( { - /*単純持続時間のパース去れる前の文字列*/ + /*単純持続時間のパースされる前の文字列*/ dur: "indefinite", /*活動をストップさせるためのオブジェクト*/ @@ -707,7 +707,7 @@ base("$calcMode").up("$attribute").mix( { /*eleの属性の値を、それぞれオブジェクトに割り当て*/ var begin = this.frame.$begin, frame = begin.up().mix( { - string: getAttr("begin"), + string: (getAttr("begin") || "0"), $activate: begin.$activate.up().mix( { dur: getAttr("dur"), end: begin.$end.up().mix( { @@ -726,7 +726,7 @@ base("$calcMode").up("$attribute").mix( { } /*属性を取得するためのインライン関数*/ function getAttr(name) { - return ele.getAttributeNS(null, name); + return (ele.getAttributeNS(null, name) || null); }; getAttr = begin = ele = void 0; } diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 95f155c..c938a9b 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -3315,6 +3315,7 @@ describe("SMIL Animation Spec", function() { beforeEach( function() { attr = base("$calcMode").$attribute.up("width"); base("$frame").timelines.length = 0; + base("$frame").startTime = Date.now(); } ); /*境界条件を調べておく (limit value analysis)*/ it("should be this for the value (limit value analysis)", function() { @@ -3345,6 +3346,15 @@ describe("SMIL Animation Spec", function() { attr.push(s); expect(attr.element).toBe(p); expect(attr.frame.timelines.length).toEqual(num); + var line = attr.frame.timelines[num-1]; + expect(line.string).toBe("0"); + var act = line.$activate; + expect(act.dur).toBeNull(); + expect(act.end).toBeNull(); + expect(act.repeatCount).toBeNull(); + expect(act.repeatDur).toBeNull(); + expect(act.min).toBe("0"); + expect(act.max).toBe("indefinite"); s.removeAttribute(attrName); expect(s.hasAttributeNS(null, attrName)).toBeFalsy(); -- 2.11.0