From c7d48085e07e7a69ecb7801a78b5d54865a7514a Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 24 Jan 2015 22:06:35 +0900 Subject: [PATCH] Add the Spec for an addLine method --- org/w3c/dom/smil.js | 5 +++-- tool/Spec/spec/SvgDomSpec.js | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index ab2f139..dd1c135 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -160,14 +160,15 @@ if(window.requestAnimationFrame && requestAnimationFrame } }, /*addLineメソッド - * タイムラインを追加する*/ + * タイムラインを追加したあと、trueを返す + * ただし、引数objのobj.beginとobj.activeTimeが定まっていない場合はfalseを返す*/ addLine: function( /*Object*/ obj ) { if(!obj || (!obj.begin && (obj.begin !== 0)) || (!obj.activeTime && (obj.activeTime !== 0)) ) { /*どちらのプロパティも未確認の場合、タイムラインは追加されない*/ return false; } - /*objを計算実体(サンク)として適用*/ + /*objを適用*/ this.timelines.push( this.up("$line").of(obj) ); return true; } diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index b881fee..df648d9 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2093,12 +2093,14 @@ describe("SMIL Animation Spec", function() { activeTime: 0 })).toBe(false); + expect(frame.timelines.length).toEqual(1); var timeline = frame.timelines[0]; expect(timeline.begin).toBe(0); expect(timeline.activeTime).toBe(0); }); /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ it("should be this for the value (the invalid partion)", function() { + expect(frame.addLine(12)).toBe(false); }); } ); -- 2.11.0