From 9f13a5d3863ef7739651153ed05f800f4aa17ead Mon Sep 17 00:00:00 2001 From: dhrname Date: Sun, 8 May 2016 21:52:47 +0900 Subject: [PATCH] Modify the Spec --- org/w3c/dom/smil.js | 5 ++++- tool/Spec/spec/SvgDomSpec.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 83674b6..6697bbf 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -462,8 +462,11 @@ base("$from").of( { /*呈示値の文字部分だけを抜き出した配列を返す*/ strList: function() { /*replaceメソッドで1E-10などの対策*/ - return this.string.replace(/\d[eE][\-\+\d]/g, "") + var list = this.string.replace(/\d[eE][\-\+\d]/g, "") .match(/[^\d\-\+\.]+/g); + return list && list.map( function(x) { + return x.trim(); + } ); }, from: base("$from").up().mix( { diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index d11f004..f956c37 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -994,6 +994,9 @@ describe("SMIL Animation Spec", function() { expect(from.numList()).toEqual([]); expect(from.strList()[0]).toBe("a"); + /*前後の空白を除去する処理をしない。なぜなら、文字列リストの空白は保持するのが望ましいから + * 文字列リストの空白を除去した例: "M 20 20 M M" -> "M20 20 MM"となってしまう*/ + from.string = null; expect( function() { from.numList(); -- 2.11.0