OSDN Git Service

New a object
authordhrname <dhrname@users.sourceforge.jp>
Sun, 27 Mar 2016 13:44:08 +0000 (22:44 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 27 Mar 2016 13:44:08 +0000 (22:44 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index 795c05a..7ac2122 100644 (file)
@@ -1469,7 +1469,12 @@ base("$calcMode").up("$attribute").mix( {
      this.numberOfList = parent.__transformList.length;\r
      parent.__transformList.push( "translate(0)" );\r
    }\r
-} );\r
+  } )\r
+  .up("$motionElement")\r
+  .on("init", function (ele) {\r
+    /*type属性で変更されないように($animateTransformElementのinitメソッドを参照のこと)*/\r
+    this.type = "translate";\r
+  } );\r
 \r
 /*$svgEventオブジェクトは、SVGEvent発火を監視するためのオブジェクト*/\r
 base("$frame").up("$svgEvent").mix( {\r
index fd8cb89..60defc3 100644 (file)
@@ -2687,6 +2687,31 @@ describe("SMIL Animation Spec", function() {
         } );\r
       } );\r
     } );\r
+    describe("A $motionElement object", function() {\r
+      describe("An init method", function() {\r
+        var $animate, ele, frame, p;\r
+        beforeEach( function() {\r
+          $animate = base("$calcMode").$attribute.$setElement.$animateElement.$animateTransformElement.$motionElement.up();\r
+          p = document.createElementNS("http://www.w3.org/2000/svg", "g");\r
+          ele = document.createElementNS("http://www.w3.org/2000/svg", "animateMotion");\r
+          p.appendChild(ele);\r
+          frame = base("$frame");\r
+          frame.timelines.length = 0;\r
+          frame.startTime = Date.now();\r
+          frame.setFrame(0);\r
+        } );\r
+        afterEach( function() {\r
+          $animate.numberOfList = -1;\r
+        } );\r
+        /*境界条件を調べておく (limit value analysis)*/\r
+        it("should be this for the value  (limit value analysis)", function() {\r
+          expect($animate.type).toBe("translate");\r
+          ele.setAttributeNS(null, "type", "scale");\r
+          $animate.init(ele)\r
+          expect($animate.type).toBe("translate");\r
+        } );\r
+      } );\r
+    } );\r
     describe("Event", function() {\r
       var $animate, ele, frame, p;\r
       beforeEach( function() {\r