From faf81efaaf38c0930c834fe58be8db3f302e77a1 Mon Sep 17 00:00:00 2001 From: dhrname Date: Sat, 21 Feb 2015 20:31:34 +0900 Subject: [PATCH] New object --- org/w3c/dom/smil.js | 16 ++++++++++++++-- tool/Spec/spec/SvgDomSpec.js | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 3765d1f..aa9f99e 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -205,6 +205,7 @@ base("$frame").mix ( { /*trim メソッド * 文字列中の空白を除去*/ trim: function(str) { + /*strがString型以外のときは必ずエラーを出す*/ return str.replace(/[\s\n]+/g, ""); }, @@ -437,8 +438,19 @@ base("$frame").mix ( { } } ); } ); -/*$presentvalue オブジェクト +/*$from オブジェクト * 呈示値 (presentation value)の計算をする。値そのものを返すための計算実体*/ -base("$presentvalue").mix( { +base("$from").of( { + /*呈示値が書かれた文字列*/ + string: "", + + /*呈示値の数値の部分だけを抜き出した配列を返す*/ + numList: function() { + return this.string.match(/a/g); + }, + + /*呈示値の文字部分だけを抜き出した配列を返す*/ + strList: function() { + } } ); //#endif // _SMIL_IDL_ diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 8bf0f95..532faaa 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2808,4 +2808,21 @@ describe("SMIL Animation Spec", function() { expect(act.call()).toBeNull(); } ); } ); -} ) + describe("A $activate object", function() { + var from = base("$from"); + beforeEach( function() { + } ); + /*境界条件を調べておく (limit value analysis)*/ + it("should be this for the value (limit value analysis)", function() { + expect(from.string).toBe(""); + expect(from.numList()).toBeNull(); + expect(from.strList()).toBeNull(); + } ); + /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/ + it("should be this for the value (the valid partion)", function() { + } ); + /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ + it("should be this for the value (the invalid partion)", function() { + } ) + } ); +} ); -- 2.11.0