OSDN Git Service

Fix a bug #36226
authordhrname <dhrname@users.sourceforge.jp>
Sat, 2 Apr 2016 14:18:37 +0000 (23:18 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sat, 2 Apr 2016 14:18:37 +0000 (23:18 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 964daec..70b6954 100644 (file)
@@ -1400,6 +1400,11 @@ base("$calcMode").up("$attribute").mix( {
       return s;\r
     } )\r
      .filter( function(s) {\r
+       if (!this.timeline.isResolved) {\r
+         /*begin属性などにイベントを設定していた(未解決の)場合、後のs(0.1)がうまく作動せず、\r
+          * 例外を出してしまうため、ここで返しておく*/\r
+         return true;\r
+       }\r
        /*splineモードで、かつ、円周率を返す関数の場合は配列からはねておく*/\r
        return (this.mode !== "spline")\r
                || (s(0.1) !== Math.PI);\r
index 997f6aa..ece5223 100644 (file)
@@ -1426,6 +1426,9 @@ describe("SMIL Animation Spec", function() {
       calc.keyTime = null;\r
       expect(calc.call()(1)).toBe(calc.string);\r
       \r
+      calc.keyTime = void 0;\r
+      expect(calc.call()(1)).toBe(calc.string);\r
+      \r
       calc.keyTime = 1/0;\r
       expect(calc.call()(1)).toBe(calc.string);\r
 \r
@@ -1792,6 +1795,12 @@ describe("SMIL Animation Spec", function() {
         expect(attr.setKey(s)[0].keySplines[1]).toBe(0.1);\r
         expect(attr.setKey(s)[0].keySplines[2]).toBe(0.3);\r
         expect(attr.setKey(s)[0].keySplines[3]).toBe(0.4);\r
+        \r
+        s.setAttributeNS(null, "keySplines", "0 0.1 0.3 0.4");\r
+        expect(attr.setKey(s)[0].keySplines[0]).toBe(0);\r
+        expect(attr.setKey(s)[0].keySplines[1]).toBe(0.1);\r
+        expect(attr.setKey(s)[0].keySplines[2]).toBe(0.3);\r
+        expect(attr.setKey(s)[0].keySplines[3]).toBe(0.4);\r
       } );\r
       /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
       it("should be this for the value (the valid partion on a spline mode )", function() {\r
@@ -1821,6 +1830,11 @@ describe("SMIL Animation Spec", function() {
         f(0, 0,0.1,0.3,1);\r
         f(1, 0.1,0.4,0.5,0.7);\r
         f(2, 0.2,0.2,0.1,1);\r
+        \r
+        s.setAttributeNS(null, "keySplines", " 0 .1 .333,1; .1 .4  .5 .7; .2   .2  .1    1 ;");\r
+        f(0, 0,0.1,0.333,1);\r
+        f(1, 0.1,0.4,0.5,0.7);\r
+        f(2, 0.2,0.2,0.1,1);\r
         function f (i, a, b, c, d) {\r
           var splines = attr.setKey(s)[i].keySplines;\r
           expect(splines[0]).toBe(a);\r