svnno****@sourc*****
svnno****@sourc*****
2010年 11月 18日 (木) 20:06:38 JST
Revision: 2156 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2156 Author: dhrname Date: 2010-11-18 20:06:38 +0900 (Thu, 18 Nov 2010) Log Message: ----------- 0.63 Modified Paths: -------------- trunk/org/w3c/core.js trunk/org/w3c/dom/svg.js Property Changed: ---------------- trunk/org/ trunk/org/w3c/ trunk/org/w3c/core.js trunk/org/w3c/dom/css.js trunk/org/w3c/dom/events.js trunk/org/w3c/dom/svg.js Property changes on: trunk/org ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org:1864-2067 /branches/06x/062/org:2071-2106 /branches/06x/org:1861-2112 + /branches/06x/061/org:1864-2067 /branches/06x/062/org:2071-2106 /branches/06x/org:1861-2155 Property changes on: trunk/org/w3c ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c:1864-2067 /branches/06x/062/org/w3c:2071-2106 /branches/06x/org/w3c:1861-2112 /branches/ufltima:1621-1788 + /branches/06x/061/org/w3c:1864-2067 /branches/06x/062/org/w3c:2071-2106 /branches/06x/063/org/w3c:2110-2146 /branches/06x/org/w3c:1861-2155 /branches/ufltima:1621-1788 Modified: trunk/org/w3c/core.js =================================================================== --- trunk/org/w3c/core.js 2010-11-18 11:03:55 UTC (rev 2155) +++ trunk/org/w3c/core.js 2010-11-18 11:06:38 UTC (rev 2156) @@ -326,25 +326,11 @@ *ノードのコピーを作る。引数は、子ノードのコピーも作るかどうか。コピー機能。 */ /*Node*/ cloneNode : function( /*boolean*/ deep) { - var s; - switch (this.nodeType) { - case Node.ELEMENT_NODE: - s = new Element(); - s.tagName = this.tagName; - s.attributes._copyNode(this.attributes,false); //NamedNodeMapのコピーを行う - break; - case Node.DOCUMENT_NODE: - s = new Document(); - break; - default: + if ("ownerDocument" in this) { + var s = this.ownerDocument.importNode(this, deep); + } else { s = new Node(); - break; } - s.parentNode = null; - s.nodeType = this.nodeType; s.nodeValue = this.nodeValue; s.nodeName = this.nodeName; s.namespaceURI = this.namespaceURI; s.localName = this.localName; s.prefix = this.prefix; - if (deep) { - s.childNodes._copyNode(this.childNodes,true); - } return s; }, /*normalizeメソッド Property changes on: trunk/org/w3c/core.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c/core.js:1864-2067 /branches/06x/062/org/w3c/core.js:2071-2106 /branches/06x/org/w3c/core.js:1861-2112 /branches/ufltima/core.js:1621-1854 + /branches/06x/061/org/w3c/core.js:1864-2067 /branches/06x/062/org/w3c/core.js:2071-2106 /branches/06x/063/org/w3c/core.js:2110-2146 /branches/06x/org/w3c/core.js:1861-2155 /branches/ufltima/core.js:1621-1854 Property changes on: trunk/org/w3c/dom/css.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c/dom/css.js:1864-2067 /branches/06x/062/org/w3c/dom/css.js:2071-2106 /branches/06x/org/w3c/dom/css.js:1861-2112 /branches/ufltima/dom/css.js:1621-1855 + /branches/06x/061/org/w3c/dom/css.js:1864-2067 /branches/06x/062/org/w3c/dom/css.js:2071-2106 /branches/06x/063/org/w3c/dom/css.js:2110-2146 /branches/06x/org/w3c/dom/css.js:1861-2155 /branches/ufltima/dom/css.js:1621-1855 Property changes on: trunk/org/w3c/dom/events.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c/dom/events.js:1864-2067 /branches/06x/062/org/w3c/dom/events.js:2071-2106 /branches/06x/org/w3c/dom/events.js:1861-2112 /branches/ufltima/dom/events.js:1621-1856 + /branches/06x/061/org/w3c/dom/events.js:1864-2067 /branches/06x/062/org/w3c/dom/events.js:2071-2106 /branches/06x/063/org/w3c/dom/events.js:2110-2146 /branches/06x/org/w3c/dom/events.js:1861-2155 /branches/ufltima/dom/events.js:1621-1856 Modified: trunk/org/w3c/dom/svg.js =================================================================== --- trunk/org/w3c/dom/svg.js 2010-11-18 11:03:55 UTC (rev 2155) +++ trunk/org/w3c/dom/svg.js 2010-11-18 11:06:38 UTC (rev 2156) @@ -309,8 +309,8 @@ /*interface SVGLocatable*/ /*SVGRect*/ SVGElement.prototype.getBBox = function(){ var s = new SVGRect(); - var data = this._tar.path.value, vi = this.ownerDocument.documentElement; - var el = vi.width.baseVal.value, et = vi.height.baseVal.value, er = 0, eb = 0; + var data = this._tar.path.value, vi = this.ownerDocument.documentElement.viewport; + var el = vi.width, et = vi.height, er = 0, eb = 0; /*要素の境界領域を求める(四隅の座標を求める) *etは境界領域の上からビューポート(例えばsvg要素)の上端までの距離であり、ebは境界領域の下からビューポートの下端までの距離 *elは境界領域の左からビューポートの左端までの距離であり、erは境界領域の右からビューポートの右端までの距離 @@ -325,8 +325,8 @@ nx = ny = null; } data = degis = null; - s.x = et; - s.y = el; + s.x = el; + s.y = et; s.width = er - el; s.height = eb - et; el = et = er = eb = vi = null; @@ -979,6 +979,8 @@ ev.initEvent("SVGLoad", false, false); tar.dispatchEvent(ev); ev = null; + /*IEのメモリリーク対策として、空関数を入力*/ + xmlhttp.onreadystatechange = NAIBU.emptyFunction; } } } @@ -1565,9 +1567,10 @@ } str = attr = null; var sdt = tar._tar, sp = document.createElement("div"), dcp = document.createElement("v:group"); - dcp.style.width = tar.width.baseVal.value+ "px"; - dcp.style.height = tar.height.baseVal.value+ "px"; - dcp.coordsize = tar.width.baseVal.value+ " " +tar.height.baseVal.value; + var view = tar.viewport; + dcp.style.width = view.width+ "px"; + dcp.style.height = view.height+ "px"; + dcp.coordsize = view.width+ " " +view.height; sp.appendChild(dcp); objei.parentNode.insertBefore(sp, objei); dcp.appendChild(sdt) @@ -1640,6 +1643,8 @@ } s.defaultView._cache = s.defaultView._cache_ele = null; s = evt = null; + /*IEのメモリリーク対策として、空関数を入力*/ + this.xmlhttp.onreadystatechange = NAIBU.emptyFunction; if (this._next) { this._next._init(); } else { @@ -1653,6 +1658,8 @@ return (this._document); } }; +/*空関数(IEのメモリリーク対策)*/ +NAIBU.emptyFunction = function() {}; /*SVGStyleElement *style要素をあらわすオブジェクト @@ -1679,8 +1686,8 @@ }; SVGPoint.prototype.matrixTransform = function(/*SVGMatrix*/ matrix ) { /*整数にしているのは、VMLの設計上、小数点を扱えないときがあるため*/ - var x = parseInt(matrix.a * this.x + matrix.c * this.y + matrix.e, 10); - var y = parseInt(matrix.b * this.x + matrix.d * this.y + matrix.f, 10); + var x = parseInt(matrix.a * this.x + matrix.c * this.y + matrix.e); + var y = parseInt(matrix.b * this.x + matrix.d * this.y + matrix.f); if ((-1 < x) && (x < 1)) {x=1;} if ((-1 < y) && (y < 1)) {y=1;} var s = new SVGPoint(); @@ -2286,6 +2293,10 @@ *SVG1.1 「8.3.9 The grammar for path data」の項目にある最後の文章を参照 */ var tnl = tar.normalizedPathSegList, tlist = tar.pathSegList, D = [], _parseFloat = parseFloat; + if (tnl.numberOfItems > 0) { + tnl.clear(); + tlist.clear(); + } /*d属性の値を正規表現を用いて、二次元配列Dに変換している。もし、d属性の値が"M 20 30 L20 40"ならば、 *JSONにおける表現は以下のとおり *D = [["M", 20, 30], ["L", 20 40]] @@ -2372,7 +2383,7 @@ *変換をする処理。相対座標を絶対座標に変換して、M、L、Cコマンドに正規化していく */ var cx = 0, cy = 0; //現在セグメントの終了点の絶対座標を示す (相対座標を絶対座標に変換するときに使用) - var xn = 0, yn = 0; //T,tコマンドで仮想的な座標を算出するのに用いる + var xn = 0, yn = 0; //T,tコマンドで仮想的な座標を算出するのに用いる。第一コントロール点 var startx = 0, starty = 0; //M,mコマンドにおける始点座標(Z,zコマンドで用いる) for (var j=0, tli=tlist.numberOfItems;j<tli;++j) { var ti = tlist.getItem(j), ts = ti.pathSegType, dii = ti.pathSegTypeAsLetter; @@ -2502,11 +2513,14 @@ if (tg.pathSegTypeAsLetter === "C") { var x1 = 2*tg.x - tg.x2; var y1 = 2*tg.y - tg.y2; - } else { - var x1 = ti.x2, y1 = ti.y2; + } else { //前のコマンドがCでなければ、現在の座標を第1コントロール点に用いる + var x1 = rx, y1 = ry; } - tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2, ti.y2)); + } else { + var x1 = rx, y1 = ry; } + tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2, ti.y2)); + x1 = y1 = null; } else if (dii === "s") { if (j !== 0) { var tg = tnl.getItem(tnl.numberOfItems-1); @@ -2514,23 +2528,33 @@ var x1 = 2*tg.x - tg.x2; var y1 = 2*tg.y - tg.y2; } else { - var x1 = ti.x2, y1 = ti.y2; + var x1 = rx, y1 = ry; } - tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry)); + } else { + var x1 = rx, y1 = ry; } + tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry)); + x1 = y1 = null; } else if (dii === "T" || dii === "t") { if (j !== 0) { var tg = tlist.getItem(j-1); if ("QqTt".indexOf(tg.pathSegTypeAsLetter) > -1) { - tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3)); - xn = 2*cx - xn; - yn = 2*cy - yn; + } else { + xn = rx, yn = ry; } + } else { + xn = rx, yn = ry; } + tnl.appendItem(tar.createSVGPathSegCurvetoCubicAbs(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3)); + xn = 2*cx - xn; + yn = 2*cy - yn; + xx1 = yy1 = null; } else if (dii === "H" || dii === "h") { tnl.appendItem(tar.createSVGPathSegLinetoAbs(cx, ry)); + cy = ry; //勝手にti.yが0としているため } else if (dii === "V" || dii === "v") { tnl.appendItem(tar.createSVGPathSegLinetoAbs(rx, cy)); + cx = rx; } } ti = dii = ts = null; @@ -2850,7 +2874,7 @@ }; /*SVGPathSegLinetoVerticalAbs*/ SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(/*float*/ y ) { var s = new SVGPathSegLinetoVerticalAbs(); - s.x = 0; //DOMでは指定されていないが、変換処理が楽なので用いる + s.x = 0; s.y = y; return s; }; @@ -3389,6 +3413,7 @@ /*Textノードにdiv要素を格納したリストをプロパティとして蓄えておく*/ tar._tars = []; var data = tar.data.replace(/^\s+/, "").replace(/\s+$/, ""); + tar.data = data; for (var i=0, tdli=data.length;i<tdli;++i) { var d = document.createElement("div"), dstyle = d.style; dstyle.position = "absolute"; @@ -4066,7 +4091,7 @@ SVGLinearGradientElement.prototype = new SVGGradientElement(); function SVGRadialGradientElement() { - SVGGradientElement.apply(this, arguments); + SVGGradientElement.apply(this); /*readonly SVGAnimatedLength*/ this.cx = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.cy = new SVGAnimatedLength(); /*readonly SVGAnimatedLength*/ this.r = new SVGAnimatedLength(); @@ -4089,8 +4114,8 @@ var r = grad.r.baseVal.value, rx, ry; rx = ry = r; var tarrect = tar.getBBox(); - var vi = tar.ownerDocument.documentElement; - var el = vi.width.baseVal.value, et = vi.height.baseVal.value, er = 0, eb = 0; + var vi = tar.ownerDocument.documentElement.viewport; + var el = vi.width, et = vi.height, er = 0, eb = 0; var units = grad.getAttributeNS(null, "gradientUnits"); if (!units || units === "objectBoundingBox") { //%の場合は小数点に変換(10% -> 0.1) @@ -4104,7 +4129,7 @@ if (gt) { grad.setAttributeNS(null, "transform", gt); } - matrix = tar.getScreenCTM().multiply(grad.getCTM()); + var matrix = tar.getScreenCTM().multiply(grad.getCTM()); el = cx - rx; et = cy - ry; er = cx + rx; eb = cy + ry; var rrx = rx * 0.55228, rry = ry * 0.55228; var list = ["m", cx,et, "c", cx-rrx,et, el,cy-rry, el,cy, el,cy+rry, cx-rrx,eb, cx,eb, cx+rrx,eb, er,cy+rry, er,cy, er,cy-rry, cx+rrx,et, cx,et, "x e"]; @@ -4128,7 +4153,7 @@ var background = document.createElement("div"), bstyle = background.style; bstyle.position = "absolute"; bstyle.display = "inline-block"; - var w = vi.width.baseVal.value, h = vi.height.baseVal.value; + var w = vi.width, h = vi.height; bstyle.textAlign = "left"; bstyle.top = "0px"; bstyle.left = "0px"; bstyle.width = w+ "px"; bstyle.height = h+ "px"; outline.appendChild(background); bstyle.filter = "progid:DXImageTransform.Microsoft.Compositor"; @@ -4141,7 +4166,7 @@ background.filters[0].play(); tar._tar.parentNode.insertBefore(background, tar._tar); tar._tar.filled = "false"; - ellipse = circle = data = list = gt = cx = cy = r = w = h = null; + ellipse = outline = background = bstyle = circle = data = list = gt = cx = cy = r = w = h = matrix = null; } else if (!ele.parentNode){ tar._tar.appendChild(ele); } @@ -4282,14 +4307,23 @@ this._tar = document.createElement("a"); /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString(); this.addEventListener("DOMAttrModified", function(evt){ + var tar = evt.target; + if (evt.eventPhase === Event.BUBBLING_PHASE) { + return; //強制終了させる + } if (evt.attrName === "target") { - evt.target.target.baseVal = evt.newValue; + tar.target.baseVal = evt.newValue; + } else if (evt.attrName === "xlink:title") { + tar._tar.setAttribute("title", evt.newValue); } evt = null; }, false); this.addEventListener("DOMNodeInserted", function(evt){ var tar = evt.target; if (evt.eventPhase === Event.BUBBLING_PHASE) { + if ((tar.parentNode === evt.currentTarget) && (tar.nodeType === Node.TEXT_NODE)) { //直接Textノードが指定されれば + evt.currentTarget._tar.appendChild(document.createTextNode(tar.data)); + } return; //強制終了させる } if (tar.nextSibling) { @@ -4456,7 +4490,7 @@ this._begin = null; this._end = null; this._from = this._to = this._values = this._by = null; - this._keyTimes = null; + this._keyTimes = [0, 1]; this.addEventListener("beginEvent", function(evt) { var tar = evt.target; if (!tar.isRepeat) { @@ -4497,7 +4531,11 @@ } else if (name === "by") { tar._by = evt.newValue; } else if (name === "keyTimes") { - tar._keyTimes = evt.newValue.split(";"); + var s = evt.newValue.split(";"); + for (var i=0;i<s.length;++i) { + tar._keyTimes[i] = parseFloat(s[i]); + } + s = null; } evt = null; }, false); @@ -4521,7 +4559,7 @@ tar._values = [null, tar._to]; } else if (tar._by) { tar._values = ["0", tar._by]; - } else { + } else if (!tar.hasChildNodes() && !tar.hasAttributeNS(null, "path")) { //SVGAnimateMotionElementに留意 /*アニメーションの効果が出ないように調整する *SMILアニメーションの仕様を参照 * @@ -4647,6 +4685,10 @@ throw new DOMException(DOMException.INVALID_STATE_ERR); } }; +/*getCurrentTimeメソッド + *現在の時間コンテナ内での時刻であり、 + *決して現在時刻ではない。要素のbeginイベントの発火したときが0sである。 + */ /*float*/ SVGAnimationElement.prototype.getCurrentTime = function(){ return (this._currentFrame * 125 / 0.8); }; @@ -4694,6 +4736,7 @@ } if (!!nci._frame) { nci._frame(); + nci._currentFrame++; } } nci = null; @@ -4702,7 +4745,7 @@ stlog.add(e, 4157); }*/ }), - 125 + 64 ); } } @@ -4715,11 +4758,133 @@ *くわしくはNAIBU.Time.start関数のコードを参照 */ NAIBU.Clip[NAIBU.Clip.length] = this; + /*_valueListプロパティは、 + *機械が理解できる形で保管されているvalueの値の配列リスト + */ + this._valueList = []; + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === Event.BUBBLING_PHASE) { + return; //強制終了させる + } + var tar = evt.target; + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target, attrName = tar.getAttributeNS(null, "attributeName"),ttr = tar.targetElement, tta = ttr[attrName]; + /*tar.valuesのリスト: ex. ["12px", "13px"]を、次のように機械に理解できるよう変換して、tar._valueListに格納 + *[(new SVGPoint()), (new SVGPoint())] + *この_valueListプロパティはアニメの際に使うので、_valuesプロパティはアニメ中に使わない + */ + var vi = ttr.cloneNode(false); + if (!tar._values[0]) { + tar._values[0] = ttr.getAttributeNS(null, attrName) || ttr.style.getPropertyValue(attrName); + } + if (!!tta) { + ttr[attrName].animVal = vi[attrName].baseVal; + for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) { + var vir = ttr.cloneNode(false); //仮の要素 + delete vir._tar; + vir.setAttributeNS(null, attrName, tav[i]); + tar._valueList[tar._valueList.length] = vir[attrName].baseVal; + } + } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば + for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) { + tar._valueList[i] = parseFloat(tav[i]); + } + } else if ("animatedPoints" in ttr) { + ttr.animatedPoints = vi.points; + for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) { + var vir = ttr.cloneNode(false); + delete vir._tar; + vir.setAttributeNS(null, "points", tav[i]); + tar._valueList[tar._valueList.length] = vir.points; + } + } else if ("normalizedPathSegList" in ttr) { + ttr.animatedNormalizedPathSegList = vi.normalizedPathSegList; + for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) { + var vir = ttr.cloneNode(false); + delete vir._tar; + vir.setAttributeNS(null, "d", tav[i]); + tar._valueList[tar._valueList.length] = vir.normalizedPathSegList; + } + } else { + vi = null; + return; + } + if ((tar._keyTimes[1] === 1) && (tar._valueList.length > 2)) { + for (var i=0,n=0,tvli=tar._valueList.length-1;i<tvli;++i) { + n += 1 / tvli; + tar._keyTimes[i+1] = n; + } + } + evt = tta = vir = vi = null; + }, false); + }, false); this.addEventListener("beginEvent", function(evt) { var tar = evt.target; + var attrName = tar.getAttributeNS(null, "attributeName"), newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName); + var ttr = tar.targetElement, tta = ttr[attrName]; + tar._frame = function() { + var d = tar.getSimpleDuration() * 0.8, n = tar._valueList.length - 1, tg = tar.getCurrentTime(); + if ((n !== -1) && (d !== 0) && (tg <= d)) { + var ii = Math.floor((tg*n) / d); + } else { + return; + } + /*setAttrbute(NS)メソッドはDOM属性を書き換えるため利用しない。 + * + * 参照:アニメーションサンドイッチモデル + * >アニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。 + *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel + */ + var evt = tar.ownerDocument.createEvent("MutationEvents"); + evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); + if (!!tta) { + var base = tta.baseVal, tanim = tta.animVal; + var v1 = tar._valueList[ii].value, v2 = tar._valueList[ii+1].value; + /*vを求める公式に関しては、SMIL2.0 Animation Moduleの単純アニメーション関数の項を参照 + * 3.4.2 Specifying the simple animation function f(t) + *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction + */ + var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / d; + console.log(tg); + tanim.newValueSpecifiedUnits(tanim.unitType, v); + tta.baseVal = tanim; + tanim = null; + ttr.dispatchEvent(evt); + /*変化値はanimValプロパティに収納しておき、 + *変化する前の、元の値はbaseValプロパティに再び収納しておく + */ + tta.animVal = tta.baseVal; + tta.baseVal = base; + } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば + var base = null; + var v1 = tar._valueList[ii], v2 = tar._valueList[ii+1]; + var v = v1 + (v2-v1) * (tg-tar._keyTimes[ii]*d) / d; + ttr.dispatchEvent(evt); + } else if ("animatedPoints" in ttr) { + var base = ttr.points; + ttr.points = ttr.animatedPoints; + ttr.dispatchEvent(evt); + tta.animatedPoints = tta.points; + tta.points = base; + } else if ("normalizedPathSegList" in ttr) { + var base = ttr.normalizedPathSegList; + ttr.normalizedPathSegList = ttr.animatedNormalizedPathSegList; + ttr.dispatchEvent(evt); + tta.animatedNormalizedPathSegList = tta.normalizedPathSegList; + tta.normalizedPathSegList = base; + } + evt = v1 = v2 = v = null; + }; + evt = vir = null; }, false); this.addEventListener("endEvent", function(evt) { - var tar = evt.target; + var tar = evt.target, fill = tar.getAttributeNS(null, "fill"); + if (!fill || (fill === "remove")) { + var evt = tar.ownerDocument.createEvent("MutationEvents"); + evt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); + tar.targetElement.dispatchEvent(evt); + evt = null; + } }, false); this.addEventListener("repeatEvent", function(evt) { var tar = evt.target; @@ -4823,17 +4988,22 @@ tar._frame = function() { var _tar = tar, tpn = _tar._path; if (!!tpn) { - var st = (tpn.getTotalLength() / _tar.getSimpleDuration()) * _tar.getCurrentTime() / 125 * 0.8; + var tgsd = _tar.getSimpleDuration(); + if (tgsd === 0) { + tgsd = null; + return; + } + var st = (tpn.getTotalLength() / tgsd) * _tar.getCurrentTime() / 125 * 0.8; var p = tpn.getPointAtLength(st), trans = _tar.targetElement.transform; p = p.matrixTransform(_tar.targetElement.getScreenCTM()) - trans.animVal.getItem(trans.numberOfItmes-1).setTranslate(p.x, p.y); + trans.animVal.getItem(trans.animVal.numberOfItems-1).setTranslate(p.x, p.y); var base = trans.baseVal; trans.baseVal = trans.animVal; var evtt = _tar.ownerDocument.createEvent("MutationEvents"); evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); _tar.targetElement.dispatchEvent(evtt); trans.baseVal = base; - evtt = base = trans = null; + evtt = base = trans = st = tgsd = p = null; } } evt = trans = null; @@ -4877,7 +5047,12 @@ } tar._frame = function() { var _tar = tar, to = new SVGColor(), from = new SVGColor(); - var n = _tar._values.length - 1, t = _tar.getCurrentTime(), d = _tar.getSimpleDuration(), i = Math.floor((t*n) / d); + var d = _tar.getSimpleDuration(); + if (d === 0) { + d = null; + return; + } + var n = _tar._values.length - 1, t = _tar.getCurrentTime(), i = Math.floor((t*n) / d); to.setRGBColor(_tar._values[i+1]); from.setRGBColor(_tar._values[i]); if (!!!_tar._keyTimes) { @@ -5174,7 +5349,7 @@ *一番最初に起動するべき関数 */ NAIBU._main = (function() { - stlog = new STLog(false); + stlog = new STLog(true); var xmlhttp; //XMLHttpオブジェクトを生成 try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); Property changes on: trunk/org/w3c/dom/svg.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c/dom/svg.js:1864-2067 /branches/06x/062/org/w3c/dom/svg.js:2071-2106 /branches/06x/org/w3c/dom/svg.js:1861-2112 /branches/ufltima/dom/svg.js:1621-1856 + /branches/06x/061/org/w3c/dom/svg.js:1864-2067 /branches/06x/062/org/w3c/dom/svg.js:2071-2106 /branches/06x/063/org/w3c/dom/svg.js:2110-2146 /branches/06x/org/w3c/dom/svg.js:1861-2155 /branches/ufltima/dom/svg.js:1621-1856