svnno****@sourc*****
svnno****@sourc*****
2010年 10月 18日 (月) 23:15:10 JST
Revision: 2064
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2064
Author: dhrname
Date: 2010-10-18 23:15:10 +0900 (Mon, 18 Oct 2010)
Log Message:
-----------
SMILアニメーションの修正
Modified Paths:
--------------
branches/06x/061/org/w3c/dom/smil.js
branches/06x/061/org/w3c/dom/svg.js
Modified: branches/06x/061/org/w3c/dom/smil.js
===================================================================
--- branches/06x/061/org/w3c/dom/smil.js 2010-10-18 11:44:23 UTC (rev 2063)
+++ branches/06x/061/org/w3c/dom/smil.js 2010-10-18 14:15:10 UTC (rev 2064)
@@ -66,13 +66,16 @@
{
typedef dom::DOMString DOMString;
*/
+/*ElementTimeControlはSVGAnimationElementに統合させる。
+ *というのは、多重継承が難しいため
+ */
function ElementTimeControl(ele) {
this._tar = ele;
/*_beginと_endプロパティはミリ秒数を収納する。リピート時に書き換えられることがある。
*_beginはアニメ開始時の秒数。_endはアニメ終了時の秒数。
*なお、文書読み込み終了時(アニメ開始時刻)の秒数を0とする。
*/
- this._begin = null;
+ this._begin = 0;
this._end = null;
return this;
};
Modified: branches/06x/061/org/w3c/dom/svg.js
===================================================================
--- branches/06x/061/org/w3c/dom/svg.js 2010-10-18 11:44:23 UTC (rev 2063)
+++ branches/06x/061/org/w3c/dom/svg.js 2010-10-18 14:15:10 UTC (rev 2064)
@@ -4410,16 +4410,12 @@
*dur属性の数値を収納しておく。属性がなければnullのまま
*/
this._simpleDuration = null;
- //別モジュールであるsmil::ElementTimeControlを参照のこと
- var s = new ElementTimeControl(this);
- /*以下は関数のコピー
- *これによって、ElementTimeControlの多重継承を模擬する
+ /*_beginと_endプロパティはミリ秒数を収納する。リピート時に書き換えられることがある。
+ *_beginはアニメ開始時の秒数。_endはアニメ終了時の秒数。
+ *なお、文書読み込み終了時(アニメ開始時刻)の秒数を0とする。
*/
- this.beginElement = s.beginElement;
- this.endElement = s.endElement;
- this.beginElementAt = s.beginElementAt;
- this.endElementAt = s.endElementAt;
this._begin = 0;
+ this._end = null;
this._from = this._to = this._values = this._by = null;
this._keyTimes = null;
this.addEventListener("beginEvent", function(evt) {
@@ -4539,6 +4535,27 @@
};
SVGAnimationElement.constructor = SVGElement;
SVGAnimationElement.prototype = new SVGElement();
+/*以下のメソッド(beginElementなど)については、
+ *別モジュールであるsmil::ElementTimeControl(smil.js)を参照のこと
+ */
+/*void*/ SVGAnimationElement.prototype.beginElement = function() {
+ var ttd = this.ownerDocument, evt = ttd.createEvent("TimeEvents");
+ evt.initTimeEvent("beginEvent", ttd.defaultView, 0);
+ this.dispatchEvent(evt);
+};
+/*void*/ SVGAnimationElement.prototype.endElement = function() {
+ var ttd = this.ownerDocument, evt = ttd.createEvent("TimeEvents");
+ evt.initTimeEvent("endEvent", ttd.defaultView, 0);
+ this.dispatchEvent(evt);
+};
+/*void*/ SVGAnimationElement.prototype.beginElementAt = function(/*float*/ offset) {
+ var ntc = this.ownerDocument.documentElement.getCurrentTime();
+ this._begin = offset + ntc;
+};
+/*void*/ SVGAnimationElement.prototype.endElementAt = function(/*float*/ offset) {
+ var ntc = this.ownerDocument.documentElement.getCurrentTime();
+ this._end = offset + ntc;
+};
SVGAnimationElement.prototype._eventRegExp = /(mouse|activ|clic)[a-z]+/;
SVGAnimationElement.prototype._timeRegExp = /[\-\d\.]+(h|min|s|ms)/;
SVGAnimationElement.prototype._unit = {
@@ -4579,7 +4596,7 @@
}
f(this, offset, tar, t);
} else if (!offset && (t !== "undefined") && (offset !== 0)) {
- this._begin = null;
+ this._begin = 0;
} else {
this[methodName](offset);
}