svnno****@sourc*****
svnno****@sourc*****
2011年 6月 8日 (水) 22:49:15 JST
Revision: 2749 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2749 Author: dhrname Date: 2011-06-08 22:49:15 +0900 (Wed, 08 Jun 2011) Log Message: ----------- 0.79 branchesを統合 Modified Paths: -------------- trunk/sie.js Property Changed: ---------------- trunk/sie.js Modified: trunk/sie.js =================================================================== --- trunk/sie.js 2011-06-08 12:09:18 UTC (rev 2748) +++ trunk/sie.js 2011-06-08 13:49:15 UTC (rev 2749) @@ -7311,7 +7311,7 @@ var ntc = this.ownerDocument.documentElement.getCurrentTime(); this._end = offset + ntc; }; -SVGAnimationElement.prototype._eventRegExp = /(mouse|activ|clic)[a-z]+/; +SVGAnimationElement.prototype._eventRegExp = /(mouse|activ|clic|begi|en)[a-z]+/; SVGAnimationElement.prototype._timeRegExp = /[\-\d\.]+(h|min|s|ms)?/; SVGAnimationElement.prototype._unit = { "h" : 2880000, @@ -7319,7 +7319,8 @@ "s" : 800, "ms" : 0.8 }; -/*どれだけズレの時間があるかを計測するメソッド +/*_getOffsetメソッド + * どれだけズレの時間があるかを計測するメソッド *tに数値が使われていないときは0を返す *これはSMILアニメーションモジュールの以下の記述にあるように、値のデフォルトが0であることに起因する *http://www.w3.org/TR/2001/REC-smil20-20010807/smil-timing.html#Timing-Ex:0DurDiscreteMedia @@ -7338,10 +7339,13 @@ n = t = null; return offset; }; +/*_eventSyncメソッド + *イベントがある場合とない場合とで、別々の処理に分けるメソッド + */ SVGAnimationElement.prototype._eventSync = function(/*string*/ t, /*function*/ f, /*string*/ methodName) { var offset = this._getOffset(t); this._begin = NAIBU.Time.Max; - if ( /(mouse|activ|click)/.test(t) ) { //イベントがある場合 + if ( /(mouse|activ|click|begin|end)/.test(t) ) { //イベントがある場合 var tar; if ( /([^;]+)\.\D/.test(t) ) { tar = this.ownerDocument.getElementById(RegExp.$1); @@ -7477,7 +7481,7 @@ */ var vi = ttr.cloneNode(false); if (!tar._values[0]) { //to属性か、by属性が設定されている場合 - var ttrs = ttr.ownerDocument.defaultView.getCoumputedStyle(ttr, ""); + var ttrs = ttr.ownerDocument.defaultView.getComputedStyle(ttr, ""); tar._values[0] = ttr.getAttributeNS(null, attrName) || ttrs.getPropertyValue(attrName); if (!tar._values[1] && tar._values[2]) { //by属性のみが設定されている場合 var v2 = parseFloat(tar._values[0]) + parseFloat(tar._values[2]), tanni = tar._values[0].match(/\D+/) || [""]; @@ -7636,9 +7640,14 @@ this.addEventListener("beginEvent", function(evt) { var tar = evt.target; if (tar.targetElement) { - var attrName = tar.getAttributeNS(null, "attributeName"), newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName); - var tta = tar.targetElement[attrName]; - if (!!tta) { + var attrName = tar.getAttributeNS(null, "attributeName"), + newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName), + tta = tar.targetElement[attrName]; + if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば + var style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); + style.setProperty(attrName, tar.getAttributeNS(null, "to"), null); + style = null; + } else if (!!tta) { var base = tta.baseVal; if (base instanceof SVGLength) { tta.baseVal = tar.ownerDocument.documentElement.createSVGLength(); @@ -7660,16 +7669,13 @@ */ tta.animVal = tta.baseVal; tta.baseVal = base; - } else { - var style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); - style.setProperty(attrName, tar.getAttributeNS(null, "to"), null); - style = null; } } evt = tar = attrName = null; }, false); this.addEventListener("endEvent", function(evt) { - var tar = evt.target, fill = tar.getAttributeNS(null, "fill"); + var tar = evt.target, + fill = tar.getAttributeNS(null, "fill"); if (!fill || (fill === "remove")) { var attrName = tar.getAttributeNS(null, "attributeName"), style = tar.ownerDocument.defaultView.getComputedStyle(tar.targetElement, ""); tar.targetElement.style.setProperty(attrName, style.getPropertyValue(attrName), null); @@ -7695,7 +7701,8 @@ if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { return; } - var tar = evt.target, name = evt.attrName; + var tar = evt.target, + name = evt.attrName; if (name === "path") { var d = tar.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "path"); d.setAttributeNS(null, "d", evt.newValue); @@ -7715,7 +7722,7 @@ trans.animVal.appendItem(tar.ownerDocument.documentElement.createSVGTransform()); tar._frame = function() { var _tar = tar, tpn = _tar._path; - if (!!tpn) { + if (!!tpn) { //path属性が指定されていた場合、tpnは属性値となる var tgsd = _tar.getSimpleDuration(); if (tgsd === 0) { tgsd = null; @@ -7732,6 +7739,7 @@ _tar.targetElement.dispatchEvent(evtt); trans.baseVal = base; evtt = base = trans = st = tgsd = p = null; + } else { } } evt = trans = null; Property changes on: trunk/sie.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/04x/040/sie.js:812-829 /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 /branches/04x/047/sie.js:1131-1164 /branches/04x/048/sie.js:1166-1180 /branches/04x/sie.js:830-1181 /branches/05x/050/sie.js:1183-1201 /branches/05x/051/sie.js:1207-1323 /branches/05x/052/sie.js:1325-1352 /branches/05x/053/sie.js:1354-1400 /branches/05x/054/sie.js:1403-1422 /branches/05x/055/sie.js:1424-1454 /branches/05x/056/sie.js:1456-1491 /branches/05x/057/sie.js:1496-1523 /branches/05x/058/sie.js:1526-1590 /branches/05x/sie.js:1183-1594 /branches/06x/060/sie.js:1603-1850 /branches/06x/sie.js:1599-2355 /branches/07x/sie.js:2357-2730 + /branches/04x/040/sie.js:812-829 /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 /branches/04x/047/sie.js:1131-1164 /branches/04x/048/sie.js:1166-1180 /branches/04x/sie.js:830-1181 /branches/05x/050/sie.js:1183-1201 /branches/05x/051/sie.js:1207-1323 /branches/05x/052/sie.js:1325-1352 /branches/05x/053/sie.js:1354-1400 /branches/05x/054/sie.js:1403-1422 /branches/05x/055/sie.js:1424-1454 /branches/05x/056/sie.js:1456-1491 /branches/05x/057/sie.js:1496-1523 /branches/05x/058/sie.js:1526-1590 /branches/05x/sie.js:1183-1594 /branches/06x/060/sie.js:1603-1850 /branches/06x/sie.js:1599-2355 /branches/07x/sie.js:2357-2748