OSDN Git Service

Modify the Spec
authordhrname <dhrname@users.sourceforge.jp>
Sun, 8 May 2016 12:52:47 +0000 (21:52 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 8 May 2016 12:52:47 +0000 (21:52 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 83674b6..6697bbf 100644 (file)
@@ -462,8 +462,11 @@ base("$from").of( {
   /*呈示値の文字部分だけを抜き出した配列を返す*/\r
   strList: function() {\r
     /*replaceメソッドで1E-10などの対策*/\r
-    return this.string.replace(/\d[eE][\-\+\d]/g, "")\r
+    var list = this.string.replace(/\d[eE][\-\+\d]/g, "")\r
                       .match(/[^\d\-\+\.]+/g);\r
+    return list && list.map( function(x) {\r
+                      return x.trim();\r
+                   } );\r
   },\r
   \r
   from: base("$from").up().mix( {\r
index d11f004..f956c37 100644 (file)
@@ -994,6 +994,9 @@ describe("SMIL Animation Spec", function() {
       expect(from.numList()).toEqual([]);\r
       expect(from.strList()[0]).toBe("a");\r
       \r
+      /*前後の空白を除去する処理をしない。なぜなら、文字列リストの空白は保持するのが望ましいから\r
+       * 文字列リストの空白を除去した例: "M 20 20 M M" -> "M20 20 MM"となってしまう*/\r
+      \r
       from.string = null;\r
       expect( function() {\r
         from.numList();\r