OSDN Git Service

Add a rank property to the object
authordhrname <dhrname@users.sourceforge.jp>
Wed, 23 Sep 2015 13:53:23 +0000 (22:53 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Wed, 23 Sep 2015 13:53:23 +0000 (22:53 +0900)
document/index.en.html
document/index.html
org/w3c/dom/smil.js
tool/Spec/spec/SvgDomSpec.js

index d6e13db..2f499a7 100644 (file)
@@ -16,7 +16,7 @@
  <li><a href="http://en.osdn.jp/projects/sie/">Getting involved</a></li>\r
 </ol>\r
 <h1>SIE - SVG JavaScript library</h1>\r
-<h2 class="title">Download SIE 19</h2>\r
+<h2 class="title">Download SIE 20</h2>\r
 <p><a href="https://osdn.jp/projects/sie/downloads/63818/sie20.zip/">sie20.zip</a> (ZIP 498.8 KB)</p>\r
 <h3>Requirements</h3>\r
 <p>Internet Explorer8+, Mozilla Firefox10+, Opera10.0+, Safari3.0+ or Google Chrome3.0+</p>\r
index cbc437f..5d70fb6 100644 (file)
@@ -16,7 +16,7 @@
 </ol>\r
 <p><object data="sie-logo.svg" type="image/svg+xml" width="100%" height="90"></object></p>\r
 <h1>SIE - SVG形式の画像を表示できるJavaScriptライブラリ</h1>\r
-<h2 class="title">SIE 19 を無料ダウンロード</h2>\r
+<h2 class="title">SIE 20 を無料ダウンロード</h2>\r
 <p><a href="https://osdn.jp/projects/sie/downloads/63818/sie20.zip/">sie20.zip</a> (ZIP形式 498.8 KB)</p>\r
 <p>あらかじめ、圧縮ファイル(ZIP形式)をダウンロードしてから、解凍してください。sie.jsを手に入れることができます。</p>\r
 <h3>動作環境</h3>\r
index 560f2ef..f2acaa9 100644 (file)
@@ -151,6 +151,9 @@ base("$frame").mix ( {
   \r
   /*現在のフレーム数*/\r
   currentFrame: 0,\r
+  \r
+  /*タイムラインの優先度*/\r
+  rank: 0,  \r
 \r
   /*setFrame メソッド\r
    * フレーム数を数値num まで進めるか、戻す*/\r
@@ -178,6 +181,9 @@ base("$frame").mix ( {
       this.removeLine(obj);\r
     }\r
     this.timelines.push( obj );\r
+    this.timelines.sort( function (a, b) {\r
+      return a.rank - b.rank;\r
+    } )\r
     return true;\r
   },\r
   \r
index 162ed37..5f1a887 100644 (file)
@@ -2056,8 +2056,9 @@ describe("SMIL Animation Spec", function() {
     /*境界条件を調べておく (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
+      expect(frame.timelines.length).toBe(0);\r
       expect(frame.startTime).toBeGreaterThan(-1);\r
+      expect(frame.rank).toBe(0);\r
       frame.setFrame();\r
       frame.setFrame(0);\r
       /*負の値も許される*/\r
@@ -2135,6 +2136,20 @@ describe("SMIL Animation Spec", function() {
         timelines: [] \r
         } ));\r
       expect(frame.timelines).not.toBe(frame.$1.timelines);\r
+      \r
+      frame.timelines.length = 0;\r
+      frame.addLine( {\r
+        begin: 1,\r
+        activeTime: 1,\r
+        rank:2\r
+      } );\r
+      frame.addLine( {\r
+        begin: 1,\r
+        activeTime: 1,\r
+        rank:1\r
+      } );\r
+      expect(frame.timelines[0].rank).toBe(1);\r
+      expect(frame.timelines[1].rank).toBe(2);\r
     });\r
     /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
     it("should be this for the value (the invalid partion)", function() {\r
@@ -4167,7 +4182,7 @@ describe("SMIL Animation Spec", function() {
     describe("Event", function() {\r
       var $animate, ele, frame, p;\r
       beforeEach( function() {\r
-        $aniamte = base("$calcMode").$attribute.$setElement.$animateElement.up();\r
+        $animate = base("$calcMode").$attribute.$setElement.$animateElement.up();\r
         p = document.createElementNS("http://www.w3.org/2000/svg", "g");\r
         ele = document.createElementNS("http://www.w3.org/2000/svg", "animate");\r
         p.appendChild(ele);\r
@@ -4181,20 +4196,24 @@ describe("SMIL Animation Spec", function() {
           expect(evt.target).toBe(ele);\r
         } );\r
         var evt = ele.ownerDocument.createEvent("MouseEvents");\r
-        evt.initMouseEvent("beginEvent",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
+        evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
         ele.dispatchEvent(evt);\r
         \r
         ele.setAttributeNS(null, "begin", "mousedown");\r
         ele.setAttributeNS(null, "dur", "1s");\r
         ele.setAttributeNS(null, "attributeName", "fill");\r
-        ele.setAttributeNS(null, "fill", "remove");\r
+        ele.setAttributeNS(null, "fill", "freeze");\r
         ele.setAttributeNS(null, "from", "rgb(0,0,0)");\r
         ele.setAttributeNS(null, "to", "rgb(10,10,1)");\r
+        $animate.init(ele);\r
         expect(p.getAttributeNS(null, "fill") || null).toBeNull();\r
-        evt.initMouseEvent("beginEvent",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
+        evt = ele.ownerDocument.createEvent("MouseEvents");\r
+        evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
         p.dispatchEvent(evt);\r
         expect(p.getAttributeNS(null, "fill") || null).toBeNull();\r
-        evt.initMouseEvent("mousedown",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele);\r
+        evt = ele.ownerDocument.createEvent("MouseEvents");\r
+        evt.initMouseEvent("mousedown",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, p);\r
+        frame.setFrame(0);\r
         p.dispatchEvent(evt);\r
       } );\r
     } );\r