OSDN Git Service

New object for SMIL Animation
authordhrname <dhrname@users.sourceforge.jp>
Wed, 21 Jan 2015 14:21:25 +0000 (23:21 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Wed, 21 Jan 2015 14:21:25 +0000 (23:21 +0900)
document/ufltimatest.html
org/w3c/dom/smil.js
org/w3c/dom/svg.js
tool/Spec/spec/SvgDomSpec.js

index 554a0f5..f4282ec 100644 (file)
@@ -22,7 +22,6 @@
  <li><a href="help.html">ヘルプ</a></li>\r
 </ol>\r
 <object data="svg_sample/zeimusu_sakura_.svg" type="image/svg+xml" width="1000" height="1000"></object>\r
-<object data="svg_sample/funcprotosample.svg" type="image/svg+xml" width="500" height="500"></object>\r
 <img src="svg_sample/zeimusu_sakura_.svg" width="1000" height="1000"></img>\r
 <p><object data="svg_sample/sie-logo.svg" type="image/svg+xml" width="120%" height="120%"></object></p>\r
 <p><img src="svg_sample/sie-logo.svg" width="120%" height="120%"></img></p>\r
@@ -60,4 +59,4 @@
  *\r
  * ***** END LICENSE BLOCK ***** */-->\r
     </body>\r
-</html>
\ No newline at end of file
+</html>\r
index ee0351a..83648dd 100644 (file)
@@ -126,4 +126,41 @@ base("$event").up("TimeEvents").mix( {
     this.detail = detailArg;\r
   }\r
 } );\r
-//#endif // _SMIL_IDL_
\ No newline at end of file
+\r
+if(window.requestAnimationFrame && requestAnimationFrame\r
+    && !document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Animation", "1.1")) {\r
+  /*IE11などSMILアニメーションに対応していないブラウザ用*/\r
+  \r
+  /*$frame オブジェクト\r
+   * 全体のフレームの管理を行う\r
+   */\r
+  base("$frame").mix ( {\r
+    /*フレームレート。1ミリ秒何フレームか。計算を省略するためミリ秒使用*/\r
+    fpms: 0.024,\r
+    /*タイムラインのリスト (時間区間の設定ができる)*/\r
+    timelines: [],\r
+    /*setFrame メソッド\r
+     * フレーム数を数値num まで進めるか、戻す*/\r
+    setFrame: function( /*number*/ num) {\r
+      var timelines = this.timelines; // タイムラインのリスト\r
+      for (var i=0;i<timelines.length;++i) {\r
+        timelines[i].setFrame(num);\r
+      }\r
+    },\r
+    /*addLineメソッド\r
+     * タイムラインを追加する*/\r
+    addLine: function( /*number*/ begin, /*number*/ activateDuration ) {\r
+      if((begin === null) || (activateDuration === null)) {\r
+        /*どちらの引数も未確認の場合、タイムラインは追加されない*/\r
+        return false;\r
+      }\r
+      this.timelines.push( this.up("$line").mix( {\r
+          begin:      begin,\r
+          activetime: activateDuration\r
+        } )\r
+      );\r
+      return true;\r
+    }\r
+  } );\r
+}\r
+//#endif // _SMIL_IDL_\r
index b69d5bf..87bd753 100644 (file)
@@ -6676,4 +6676,4 @@ NAIBU.textToSVG = function ( /*string*/ source, /*float*/ w, /*float*/ h) {
 };\r
 NAIBU.addEvent("unload", unsvgtovml);\r
 //IEならばtrue\r
-NAIBU.isMSIE = /*@cc_on!@*/false;
\ No newline at end of file
+NAIBU.isMSIE = /*@cc_on!@*/false;\r
index dcabeec..564440f 100644 (file)
@@ -2048,13 +2048,24 @@ describe("SVG Spec in JavaScript", function() {
   });\r
 });\r
 describe("SMIL Animation Spec", function() {\r
-  /*境界条件を調べておく (limit value analysis, when it calls a insertBefore method)*/\r
-  it("should be this for the value, when it calls a hasAttributeNS method (limit value analysis)", function() {\r
-  });\r
-  /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
-  it("should be this for the value, when it calls a hasAttributeNS method (the valid partion)", function() {\r
-  });\r
-  /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
-  it("should be this for the value, when it calls a hasAttributeNS method (the invalid partion)", function() {\r
-  });\r
+  describe("$frame object", function() {\r
+    var frame = base("$frame");\r
+    /*境界条件を調べておく (limit value analysis)*/\r
+    it("should be this for the value  (limit value analysis)", function() {\r
+      expect(typeof frame.setFrame).toBe("function");\r
+      expect(frame.timelines.length).toEqual(0);\r
+      frame.setFrame();\r
+      expect(frame.addLine(null)).toBe(false);\r
+      expect(frame.addLine(0, 0)).toBe(true);\r
+    });\r
+    /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
+    it("should be this for the value (the valid partion)", function() {\r
+      expect(frame.addLine(null, null)).toBe(false);\r
+      expect(frame.addLine(0, null)).toBe(false);\r
+    });\r
+    /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
+    it("should be this for the value (the invalid partion)", function() {\r
+    });\r
+  } );\r
+  \r
 } )\r