From: dhrname Date: Wed, 23 Sep 2015 13:53:23 +0000 (+0900) Subject: Add a rank property to the object X-Git-Tag: version22~77 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b3d79825bd463d8b11d5b999260f06c6e67fa410;p=sie%2Fsie.git Add a rank property to the object --- diff --git a/document/index.en.html b/document/index.en.html index d6e13db..2f499a7 100644 --- a/document/index.en.html +++ b/document/index.en.html @@ -16,7 +16,7 @@
  • Getting involved
  • SIE - SVG JavaScript library

    -

    Download SIE 19

    +

    Download SIE 20

    sie20.zip (ZIP 498.8 KB)

    Requirements

    Internet Explorer8+, Mozilla Firefox10+, Opera10.0+, Safari3.0+ or Google Chrome3.0+

    diff --git a/document/index.html b/document/index.html index cbc437f..5d70fb6 100644 --- a/document/index.html +++ b/document/index.html @@ -16,7 +16,7 @@

    SIE - SVG形式の画像を表示できるJavaScriptライブラリ

    -

    SIE 19 を無料ダウンロード

    +

    SIE 20 を無料ダウンロード

    sie20.zip (ZIP形式 498.8 KB)

    あらかじめ、圧縮ファイル(ZIP形式)をダウンロードしてから、解凍してください。sie.jsを手に入れることができます。

    動作環境

    diff --git a/org/w3c/dom/smil.js b/org/w3c/dom/smil.js index 560f2ef..f2acaa9 100644 --- a/org/w3c/dom/smil.js +++ b/org/w3c/dom/smil.js @@ -151,6 +151,9 @@ base("$frame").mix ( { /*現在のフレーム数*/ currentFrame: 0, + + /*タイムラインの優先度*/ + rank: 0, /*setFrame メソッド * フレーム数を数値num まで進めるか、戻す*/ @@ -178,6 +181,9 @@ base("$frame").mix ( { this.removeLine(obj); } this.timelines.push( obj ); + this.timelines.sort( function (a, b) { + return a.rank - b.rank; + } ) return true; }, diff --git a/tool/Spec/spec/SvgDomSpec.js b/tool/Spec/spec/SvgDomSpec.js index 162ed37..5f1a887 100644 --- a/tool/Spec/spec/SvgDomSpec.js +++ b/tool/Spec/spec/SvgDomSpec.js @@ -2056,8 +2056,9 @@ describe("SMIL Animation Spec", function() { /*境界条件を調べておく (limit value analysis)*/ it("should be this for the value (limit value analysis)", function() { expect(typeof frame.setFrame).toBe("function"); - expect(frame.timelines.length).toEqual(0); + expect(frame.timelines.length).toBe(0); expect(frame.startTime).toBeGreaterThan(-1); + expect(frame.rank).toBe(0); frame.setFrame(); frame.setFrame(0); /*負の値も許される*/ @@ -2135,6 +2136,20 @@ describe("SMIL Animation Spec", function() { timelines: [] } )); expect(frame.timelines).not.toBe(frame.$1.timelines); + + frame.timelines.length = 0; + frame.addLine( { + begin: 1, + activeTime: 1, + rank:2 + } ); + frame.addLine( { + begin: 1, + activeTime: 1, + rank:1 + } ); + expect(frame.timelines[0].rank).toBe(1); + expect(frame.timelines[1].rank).toBe(2); }); /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/ it("should be this for the value (the invalid partion)", function() { @@ -4167,7 +4182,7 @@ describe("SMIL Animation Spec", function() { describe("Event", function() { var $animate, ele, frame, p; beforeEach( function() { - $aniamte = base("$calcMode").$attribute.$setElement.$animateElement.up(); + $animate = base("$calcMode").$attribute.$setElement.$animateElement.up(); p = document.createElementNS("http://www.w3.org/2000/svg", "g"); ele = document.createElementNS("http://www.w3.org/2000/svg", "animate"); p.appendChild(ele); @@ -4181,20 +4196,24 @@ describe("SMIL Animation Spec", function() { expect(evt.target).toBe(ele); } ); var evt = ele.ownerDocument.createEvent("MouseEvents"); - evt.initMouseEvent("beginEvent",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele); + evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele); ele.dispatchEvent(evt); ele.setAttributeNS(null, "begin", "mousedown"); ele.setAttributeNS(null, "dur", "1s"); ele.setAttributeNS(null, "attributeName", "fill"); - ele.setAttributeNS(null, "fill", "remove"); + ele.setAttributeNS(null, "fill", "freeze"); ele.setAttributeNS(null, "from", "rgb(0,0,0)"); ele.setAttributeNS(null, "to", "rgb(10,10,1)"); + $animate.init(ele); expect(p.getAttributeNS(null, "fill") || null).toBeNull(); - evt.initMouseEvent("beginEvent",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele); + evt = ele.ownerDocument.createEvent("MouseEvents"); + evt.initMouseEvent("beginEvent",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, ele); p.dispatchEvent(evt); expect(p.getAttributeNS(null, "fill") || null).toBeNull(); - evt.initMouseEvent("mousedown",true, true, ele.ownerDocument, 0, 0, 0, 0, 0, false, false, false, false,0, ele); + evt = ele.ownerDocument.createEvent("MouseEvents"); + evt.initMouseEvent("mousedown",true, true, window, 0, 0, 0, 0, 0, false, false, false, false,0, p); + frame.setFrame(0); p.dispatchEvent(evt); } ); } );