From ddc01489854ce1debaf4861e574f92f6318b3e3f Mon Sep 17 00:00:00 2001 From: dhrname Date: Thu, 16 Apr 2015 21:40:02 +0900 Subject: [PATCH] Support the setValues method --- org/w3c/dom/smil.js | 19 ++++++++++++++++++- tool/Spec/spec/SvgDomSpec.js | 5 +++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index e9a99fa..e541770 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -732,6 +732,23 @@ base("$calcMode").up("$attribute").mix( { return (ele.getAttributeNS(null, name) || null); }; getAttr = begin = ele = void 0; - } + }, + + /*setValuesメソッド + * values属性やfrom属性やto属性を処理するためのメソッド + * valuesは配列、それ以外の引数は文字列*/ + setValues: function(values, from, to, by) { + if (!values) { + return null; + } + var s = this.up(); + if (values.length) { + s.to.string = values[0]; + s.to.from.string = values[1]; + } else { + return null; + } + return s; + } } ); //#endif // _SMIL_IDL_ diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 727029b..5bb9d9c 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -3442,6 +3442,11 @@ describe("SMIL Animation Spec", function() { } ); /*境界条件を調べておく (limit value analysis)*/ it("should be this for the value (limit value analysis)", function() { + expect(attr.setValues()).toBeNull(); + expect(attr.setValues([])).toBeNull(); + + expect(attr.setValues(["0", "1"]).to.string).toBe("0"); + expect(attr.setValues(["0", "1"]).to.from.string).toBe("1"); } ); /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/ it("should be this for the value (the valid partion on a spline mode )", function() { -- 2.11.0