svnno****@sourc*****
svnno****@sourc*****
2011年 1月 21日 (金) 21:18:21 JST
Revision: 2318 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2318 Author: dhrname Date: 2011-01-21 21:18:20 +0900 (Fri, 21 Jan 2011) Log Message: ----------- 0.68 ブランチを統合 Modified Paths: -------------- trunk/sie.js Property Changed: ---------------- trunk/sie.js Modified: trunk/sie.js =================================================================== --- trunk/sie.js 2011-01-21 10:40:17 UTC (rev 2317) +++ trunk/sie.js 2011-01-21 12:18:20 UTC (rev 2318) @@ -1,4 +1,4 @@ -/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence +/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence *公式ページは http://sie.sourceforge.jp/ *利用方法は <script defer="defer" type="text/javascript" src="sie.js"></script> *http://sie.sourceforge.jp/ @@ -1247,26 +1247,28 @@ function MutationEvent(){ Event.call(this); -/*Node*/ this.relatedNode; -/*string*/ this.prevValue; -/*string*/ this.newValue; -/*string*/ this.attrName; -/*unsigned short*/ this.attrChange; return this; }; MutationEvent.prototype = new Event(); MutationEvent.constructor = Event; -/*void*/ MutationEvent.prototype.initMutationEvent = function(/*string*/ typeArg, /*boolean*/ canBubbleArg, +(function() { +/*void*/ this.initMutationEvent = function(/*string*/ typeArg, /*boolean*/ canBubbleArg, /*boolean*/ cancelableArg, /*Node*/ relatedNodeArg, /*string*/ prevValueArg, /*string*/ newValueArg, /*string*/ attrNameArg, /*unsigned short*/ attrChangeArg) { - this.initEvent(typeArg, canBubbleArg, cancelableArg); - this.relatedNode = relatedNodeArg; - this.prevValue = prevValueArg; - this.newValue = newValueArg; - this.attrName = attrNameArg; - this.attrChange = attrChangeArg; - typeArg = canBubbleArg = cancelableArg = relatedNodeArg = prevValueArg = newValueArg = attrNameArg = attrChangeArg = null; -}; + this.initEvent(typeArg, canBubbleArg, cancelableArg); + this.relatedNode = relatedNodeArg; + this.prevValue = prevValueArg; + this.newValue = newValueArg; + this.attrName = attrNameArg; + this.attrChange = attrChangeArg; + typeArg = canBubbleArg = cancelableArg = relatedNodeArg = prevValueArg = newValueArg = attrNameArg = attrChangeArg = null; + }; + /*Node*/ this.relatedNode = null; + /*string*/ this.prevValue = null; + /*string*/ this.newValue = null; + /*string*/ this.attrName = null; + /*unsigned short*/ this.attrChange = 2; +}).apply(MutationEvent.prototype); // attrChangeType /*unsigned short*/ MutationEvent.MODIFICATION = 1; /*unsigned short*/ MutationEvent.ADDITION = 2; @@ -1288,7 +1290,11 @@ /*ここから*/ var evt = this.ownerDocument.createEvent("MutationEvents"); if (!s) { //ノードがなければ - evt.initMutationEvent("DOMAttrModified", true, false, newAttr, null, newAttr.nodeValue, newAttr.nodeName, MutationEvent.ADDITION); + /*initMutationEventメソッドは軽量化のため省略する*/ + evt.initEvent("DOMAttrModified", true, false); + evt.relatedNode = newAttr; + evt.newValue = newAttr.nodeValue; + evt.attrName = newAttr.nodeName; } else { evt.initMutationEvent("DOMAttrModified", true, false, newAttr, s.nodeValue, newAttr.nodeValue, newAttr.nodeName, MutationEvent.MODIFICATION); } @@ -2871,11 +2877,6 @@ *valueInSpecifiedUnitsプロパティはpxに統一する前の数値。valueプロパティはpxに統一した後の数値 */ function SVGLength() { - /*readonly attribute unsigned short*/ this.unitType = SVGLength.SVG_LENGTHTYPE_UNKNOWN; - /*attribute float*/ this.value = 0; //利用単位における値 - /*attribute float*/ this.valueInSpecifiedUnits = SVGLength.SVG_LENGTHTYPE_UNKNOWN; //unitTypeにおける値 - /*attribute DOMString*/ this.valueAsString; - this._percent = 0.01; //単位に%が使われていた場合、このプロパティの数値を1%として使う return this; }; // Length Unit Types @@ -2892,6 +2893,11 @@ /*const unsigned short*/ SVGLength.SVG_LENGTHTYPE_PC = 10; SVGLength.prototype = { + /*readonly attribute unsigned short*/ unitType : SVGLength.SVG_LENGTHTYPE_UNKNOWN, + /*attribute float*/ value : 0, //利用単位における値 + /*attribute float*/ valueInSpecifiedUnits : SVGLength.SVG_LENGTHTYPE_UNKNOWN, //unitTypeにおける値 + /*attribute DOMString*/ valueAsString : "0", + _percent : 0.01, //単位に%が使われていた場合、このプロパティの数値を1%として使う /*newValueSpedifiedUnitsメソッド *新しくunitTypeにおける値を設定する *例:2pxならば、x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 2);となる @@ -2899,6 +2905,8 @@ newValueSpecifiedUnits : function (/*unsigned short*/ unitType, /*float*/ valueInSpecifiedUnits) { var n = 1, _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す if (unitType === SVGLength.SVG_LENGTHTYPE_NUMBER) { + } else if (unitType === SVGLength.SVG_LENGTHTYPE_PX) { + _s = "px"; } else if (unitType === SVGLength.SVG_LENGTHTYPE_PERCENTAGE) { n = this._percent; _s = "%" @@ -2922,11 +2930,13 @@ } else if (unitType === SVGLength.SVG_LENGTHTYPE_PC) { n = 15; _s = "pc"; + } else { + throw new DOMException(DOMException.NOT_SUPPORTED_ERR); } this.unitType = unitType; this.value = valueInSpecifiedUnits * n; this.valueInSpecifiedUnits = valueInSpecifiedUnits; - this.valuAsString = valueInSpecifiedUnits + _s; + this.valueAsString = valueInSpecifiedUnits + _s; n = _s = null; }, /*convertToSpecifiedUnitsメソッド @@ -3336,7 +3346,7 @@ if (tar.localName === "image") { tar._tar.src = uri; } - xmlhttp.open("GET", uri, true); + xmlhttp.open("GET", uri, false); xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState === 4 && xmlhttp.status === 200) { @@ -3352,6 +3362,10 @@ if (tar.localName !== "script" && tar.localName !== "style") { var doc = new ActiveXObject("MSXML2.DomDocument"); str = xmlhttp.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->"); + NAIBU.doc.async = false; + NAIBU.doc.validateOnParse = false; + NAIBU.doc.resolveExternals = false; + NAIBU.doc.preserveWhiteSpace = false; doc.loadXML(str); var ele = doc.documentElement; tar._instance = tar.ownerDocument.importNode(ele, true); @@ -3928,10 +3942,6 @@ *スクロール時にバグが起きるので、0に戻してやる必要がある。 */ screen.updateInterval = 999; - window.onscroll = function () { - screen.updateInterval = 0; - screen.updateInterval = 99; - } var objei = this._tar; if (/&[^;]+;/.test(str)) { /*以下の処理は、実体参照を使ったとき @@ -4133,7 +4143,7 @@ */ /*SVGMatrix*/ multiply : function(/*SVGMatrix*/ secondMatrix ) { var s = new SVGMatrix(), m = secondMatrix; - if (isNaN(m.a) || isNaN(m.b) || isNaN(m.c) || isNaN(m.d) || isNaN(m.e) || isNaN(m.f)) { + if (!isFinite(m.a) || !isFinite(m.b) || !isFinite(m.c) || !isFinite(m.d) || !isFinite(m.e) || !isFinite(m.f)) { throw (new Error("引数の値がNumber型ではありません")); } s.a = this.a * m.a + this.c * m.b; @@ -4591,7 +4601,7 @@ } else { el.appendChild(fillElement); } - fc = fillOpacity = null; + fillElement = fc = num = fillOpacity = null; } else if (fill.uri) { /*以下では、Gradation関連の要素に、イベントを渡すことで、 *この要素の、グラデーション描画を行う @@ -4672,7 +4682,7 @@ } else { el.appendChild(strokeElement); } - tsd = null; + strokeElement = tsd = null; } else { el.stroked = "false"; } @@ -5041,13 +5051,10 @@ *[0 0 1 ] [1] */ - dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10); - dat[dat.length] = _parseInt(mb*ti.x1 + md*ti.y1 + mf, 10); - dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10); - dat[dat.length] = _parseInt(mb*ti.x2 + md*ti.y2 + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x1 + mc*ti.y1 + me, 10)+ " " +_parseInt(mb*ti.x1 + md*ti.y1 + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x2 + mc*ti.y2 + me, 10)+ " " +_parseInt(mb*ti.x2 + md*ti.y2 + mf, 10); } - dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10); - dat[dat.length] = _parseInt(mb*ti.x + md*ti.y + mf, 10); + dat[dat.length] = _parseInt(ma*ti.x + mc*ti.y + me, 10)+ " " +_parseInt(mb*ti.x + md*ti.y + mf, 10); } } var vi = tar.ownerDocument.documentElement; @@ -7152,7 +7159,10 @@ Max : 7000, start : function() { if (NAIBU.Clip.length > 0) { - screen.updateInterval = 42; //24fpsとして描画処理 + window.onscroll = function () { + screen.updateInterval = 0; + screen.updateInterval = 42; //24fpsとして描画処理 + } NAIBU.stop = setInterval( (function() { /* try{*/ var ntc = NAIBU.Time.currentFrame++; @@ -7191,6 +7201,11 @@ }), 1 ); + } else { + window.onscroll = function () { + screen.updateInterval = 0; + window.onscroll = NAIBU.emptyFunction; + } } } }; @@ -7276,7 +7291,7 @@ 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(); + var d = tar.getSimpleDuration() * 0.8, n = tar._valueList.length - 2, tg = tar.getCurrentTime(); if ((n !== -1) && (d !== 0) && (tg <= d)) { var ii = Math.floor((tg*n) / d); } else { @@ -7527,7 +7542,7 @@ } tar._frame = function() { var _tar = tar; - var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 1, tg = _tar.getCurrentTime(); + var d = _tar.getSimpleDuration() * 0.8, n = _tar._valueList.length - 2, tg = _tar.getCurrentTime(); if ((n !== -1) && (d !== 0) && (tg <= d)) { var ii = Math.floor((tg*n) / d); } else { @@ -7681,6 +7696,7 @@ if (evt.eventPhase === Event.BUBBLING_PHASE) { return; //強制終了させる } + evt.target.ownerDocument.documentElement._svgload_limited-- evt.target.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", "embed"); }, false); this.addEventListener("SVGLoad", function(evt){ @@ -8145,4 +8161,4 @@ }; NAIBU.addEvent("unload", unsvgtovml); //IEならばtrue -NAIBU.isMSIE = /*@cc_on!@*/false; \ No newline at end of file +NAIBU.isMSIE = /*@cc_on!@*/false; 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-2242,2247-2253 + /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-2317