svnno****@sourc*****
svnno****@sourc*****
2011年 1月 7日 (金) 22:15:32 JST
Revision: 2283 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2283 Author: dhrname Date: 2011-01-07 22:15:32 +0900 (Fri, 07 Jan 2011) Log Message: ----------- 0.67統合 Modified Paths: -------------- branches/06x/org/w3c/dom/css.js branches/06x/org/w3c/dom/events.js branches/06x/org/w3c/dom/svg.js Property Changed: ---------------- branches/06x/org/ branches/06x/org/w3c/ branches/06x/org/w3c/core.js branches/06x/org/w3c/dom/css.js branches/06x/org/w3c/dom/events.js branches/06x/org/w3c/dom/svg.js Property changes on: branches/06x/org ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org:1864-2067 /branches/06x/062/org:2071-2106 /branches/06x/063/org:2110-2146 /branches/06x/064/org:2149-2177 /branches/06x/065/org:2179-2209 /branches/06x/066/org:2211-2236 + /branches/06x/061/org:1864-2067 /branches/06x/062/org:2071-2106 /branches/06x/063/org:2110-2146 /branches/06x/064/org:2149-2177 /branches/06x/065/org:2179-2209 /branches/06x/066/org:2211-2236 /branches/06x/067/org:2257-2282 Property changes on: branches/06x/org/w3c ___________________________________________________________________ Modified: svn:mergeinfo - /branches/06x/061/org/w3c:1864-2067 /branches/06x/062/org/w3c:2071-2106 /branches/06x/063/org/w3c:2110-2146 /branches/06x/064/org/w3c:2149-2177 /branches/06x/065/org/w3c:2179-2209 /branches/06x/066/org/w3c:2211-2236 /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/064/org/w3c:2149-2177 /branches/06x/065/org/w3c:2179-2209 /branches/06x/066/org/w3c:2211-2236 /branches/06x/067/org/w3c:2257-2282 /branches/ufltima:1621-1788 Property changes on: branches/06x/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/063/org/w3c/core.js:2110-2146 /branches/06x/064/org/w3c/core.js:2149-2177 /branches/06x/065/org/w3c/core.js:2179-2209 /branches/06x/066/org/w3c/core.js:2211-2244 /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/064/org/w3c/core.js:2149-2177 /branches/06x/065/org/w3c/core.js:2179-2209 /branches/06x/066/org/w3c/core.js:2211-2244 /branches/06x/067/org/w3c/core.js:2257-2282 /branches/ufltima/core.js:1621-1854 Modified: branches/06x/org/w3c/dom/css.js =================================================================== --- branches/06x/org/w3c/dom/css.js 2011-01-07 13:10:31 UTC (rev 2282) +++ branches/06x/org/w3c/dom/css.js 2011-01-07 13:15:32 UTC (rev 2283) @@ -185,7 +185,7 @@ */ function CSSStyleDeclaration() { this._list = []; //内部のリスト - this._list._fontSize = this._list._opacity = null; + this._def = this._list._fontSize = this._list._opacity = null; return this; }; CSSStyleDeclaration.prototype = { @@ -208,6 +208,7 @@ *CSSValueオブジェクトを返す。このメソッドは判別に用いているので、削除不可。 */ /*CSSValue*/ getPropertyCSSValue : function( /*string*/ propertyName) { + var prop = propertyName; propertyName += ":"; if (propertyName === ":") { //どんなデータ型でも、文字列に変換する機能をJavaScriptが持つことに注意 return null; @@ -216,11 +217,15 @@ var ti = this._list[i], tc = ti.cssText; if (tc.indexOf(propertyName) > -1) { //プロパティ名に合致するCSSValueオブジェクトが見つかった場合 ti._empercents = this._list._fontSize; - propertyName = null; + tc = prop = propertyName = null; return ti; } } - propertyName = null; + if (this._def) { + tc = propertyName = null; + return (this._def[prop]); + } + prop = propertyName = null; return null; }, /*removePropertyメソッド @@ -641,8 +646,6 @@ /*interface ViewCSS : views::AbstractView {*/ Document.prototype.defaultView = new ViewCSS(); function ViewCSS(){ - this._cache = null; - this._cache_ele = null; return this; }; /*CSSStyleDeclaration*/ ViewCSS.prototype.getComputedStyle = function( /*Element*/ elt, /*string*/ pseudoElt) { @@ -657,18 +660,20 @@ if (pelt) { var p = this.getComputedStyle(pelt, pseudoElt)._list; } else { - var p = this._defaultCSS; //デフォルト値の設定 + var p = {length:0, _opacity:1, _fontSize:12}; } var q = s._list; if (!!elt.style) { - for (var i=0,eli=elt.style._list.length;i<eli;++i) { - q[q.length] = elt.style._list[i]; + var estl = elt.style._list, easl = elt._attributeStyle._list, csi = CSSValue.CSS_INHERIT; + for (var i=0,eli=estl.length;i<eli;++i) { + q[q.length] = estl[i]; } - for (var i=0,eli=elt._attributeStyle._list.length;i<eli;++i) { - q[q.length] = elt._attributeStyle._list[i]; //プレゼンテーション属性を結びつける + for (var i=0,eli=easl.length;i<eli;++i) { + q[q.length] = easl[i]; //プレゼンテーション属性を結びつける } + estl = easl = null; for (var i=0,qli=q.length;i<qli;++i) { - if (q[i].cssValueType === CSSValue.CSS_INHERIT) { + if (q[i].cssValueType === csi) { q.splice(i, 1); --qli; } @@ -677,6 +682,7 @@ for (var i=0,pli=p.length;i<pli;++i) { q[q.length] = p[i]; } + s._def = this._defaultCSS; //デフォルト値の設定 s._list = q; if (!!elt.style) { var eso = elt.style._list._opacity || elt._attributeStyle._list._opacity; Property changes on: branches/06x/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/063/org/w3c/dom/css.js:2110-2146 /branches/06x/064/org/w3c/dom/css.js:2149-2177 /branches/06x/065/org/w3c/dom/css.js:2179-2209 /branches/06x/066/org/w3c/dom/css.js:2211-2236 /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/064/org/w3c/dom/css.js:2149-2177 /branches/06x/065/org/w3c/dom/css.js:2179-2209 /branches/06x/066/org/w3c/dom/css.js:2211-2236 /branches/06x/067/org/w3c/dom/css.js:2257-2282 /branches/ufltima/dom/css.js:1621-1855 Modified: branches/06x/org/w3c/dom/events.js =================================================================== --- branches/06x/org/w3c/dom/events.js 2011-01-07 13:10:31 UTC (rev 2282) +++ branches/06x/org/w3c/dom/events.js 2011-01-07 13:15:32 UTC (rev 2283) @@ -181,7 +181,7 @@ } } var ed = evt._default - evt = te = s = d = tce = n = sli = slii = dn = null; + evt = te = s = d = tce = n = sli = slii = dn = i = null; return ed; }; @@ -191,27 +191,24 @@ this._listener = listener; return this; }; + EventListener.prototype = { /*void*/ handleEvent : function( /*Event*/ evt) { -// try { + try { var ph = evt.eventPhase, cap = this._cap; - if (ph === Event.CAPTURING_PHASE) { //イベントフェーズが捕獲段階であることを示し + if (ph === /*Event.CAPTURING_PHASE*/ 1) { //イベントフェーズが捕獲段階であることを示し cap = cap ? false : true; //このオブジェクト(EventListenr)が捕獲フェーズを指定するならば、リスナーを作動させる。指定しなければ、作動しない。 } if (!cap && (evt.type === this._type)) { this._listener(evt); } evt = ph = cap = null; -/* } catch (e) { - var evtt = evt.target.ownerDocument.createEvent("SVGEvents"); - evtt.target = evt.target; - evtt.initEvent("SVGError", true, false); - evt.target.dispatchEvent(evtt); - stlog.add(e, 200); - evtt = null; - };*/ + } catch (e) { + + } } }; + /*Eventクラス *イベントの雛形となる。プロパティもすべて含めて、必須 */ @@ -244,7 +241,6 @@ this.type = eventTypeArg; this.bubbles = canBubbleArg; this.cancelable = cancelableArg; - this.eventPhase = Event.CAPTURING_PHASE; //初期化 } }; /*Documentノードに直接結びつける @@ -334,6 +330,7 @@ this.newValue = newValueArg; this.attrName = attrNameArg; this.attrChange = attrChangeArg; + typeArg = canBubbleArg = cancelableArg = relatedNodeArg = prevValueArg = newValueArg = attrNameArg = attrChangeArg = null; }; // attrChangeType /*unsigned short*/ MutationEvent.MODIFICATION = 1; Property changes on: branches/06x/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/063/org/w3c/dom/events.js:2110-2146 /branches/06x/064/org/w3c/dom/events.js:2149-2177 /branches/06x/065/org/w3c/dom/events.js:2179-2209 /branches/06x/066/org/w3c/dom/events.js:2211-2244 /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/064/org/w3c/dom/events.js:2149-2177 /branches/06x/065/org/w3c/dom/events.js:2179-2209 /branches/06x/066/org/w3c/dom/events.js:2211-2244 /branches/06x/067/org/w3c/dom/events.js:2257-2282 /branches/ufltima/dom/events.js:1621-1856 Modified: branches/06x/org/w3c/dom/svg.js =================================================================== --- branches/06x/org/w3c/dom/svg.js 2011-01-07 13:10:31 UTC (rev 2282) +++ branches/06x/org/w3c/dom/svg.js 2011-01-07 13:15:32 UTC (rev 2283) @@ -980,7 +980,7 @@ } else { tar._text = xmlhttp.responseText; } - } else { + } else if (!!tar._tar) { tar._tar.src = uri; } var ev = tar.ownerDocument.createEvent("SVGEvents"); @@ -1540,6 +1540,7 @@ */ NAIBU.doc.validateOnParse = false; NAIBU.doc.resolveExternals = false; + NAIBU.doc.preserveWhiteSpace = true; NAIBU.doc.loadXML(str); /*IE6-8のみで使えるupdateIntervalは、 *描画間隔の調整が可能。デフォルトは0。 @@ -1667,7 +1668,8 @@ } } s.defaultView._cache = s.defaultView._cache_ele = null; - s = evt = null; + s = evt = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = w = h = sw = sh = null; + trstyle = tpstyle = backrs = viewWidth = viewHeight = text = bfl = bft = bl = bt = backdown = backright = null; /*IEのメモリリーク対策として、空関数を入力*/ this.xmlhttp.onreadystatechange = NAIBU.emptyFunction; alert(+(new Date()) - dsd.getTime()) @@ -2675,7 +2677,7 @@ tar._tar.coordsize = w + " " + h; NAIBU._setPaint(tar, matrix); delete tar._cacheMatrix, tar._currentStyle; - evt = tar = dat = w = h = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isM = isL = isC = null; + evt = tar = dat = w = h = matrix = tlist = x = y = _parseInt = ma = mb = mc = md = me = mf = vi = isZ = isM = isL = isC = i = tli = tps = ti = null; }, false); evt = tar = null; }, false); @@ -3451,6 +3453,10 @@ /*Bubblingフェーズの時にはもう、div要素をDOMツリーに挿入しておく必要があるため、 *あらかじめ、Capturingフェーズで処理しておく */ + if ((evt.eventPhase === Event.CAPTURING_PHASE) && (tar.localName === "a") && (tar.namespaceURI === "http://www.w3.org/2000/svg") && tar.firstChild) { + /*a要素の場合はtarをすりかえておく*/ + tar = tar.firstChild; + } if ((evt.eventPhase === Event.CAPTURING_PHASE) && (tar.nodeType === Node.TEXT_NODE) && !!!tar._tars) { /*Textノードにdiv要素を格納したリストをプロパティとして蓄えておく*/ tar._tars = []; @@ -3622,6 +3628,10 @@ ++n; } chars += tli; + if (ti.parentNode && (ti.parentNode.localName === "a")) { //a要素が親である場合は、tiを親に戻しておく + ti = ti.parentNode; + } + ti = ti.nextSibling; } else if ((ti.localName === "tspan") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { /*現在のテキスト位置(x,y)の分だけ、tspan要素をずらしておく。 *さらに、現在のテキスト位置を更新する @@ -3643,8 +3653,13 @@ n += tg; chars += tg; p = tg = null; + ti = ti.nextSibling; + } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { + /*a要素のテキストノードも処理する*/ + ti = ti.firstChild; + } else { + ti = ti.nextSibling; } - ti = ti.nextSibling; } tar._isYokogaki = isYokogaki //getEndPositionOfCharメソッドなどで使う tar = ti = tp = ptx = pty = tx = ty = chars = style = x = y = isYokogaki = null; @@ -3798,12 +3813,12 @@ var n = parseFloat(style.getPropertyValue("font-size")) * Math.sqrt(Math.abs(tar.getScreenCTM()._determinant())); ttp.style.fontSize = n + "px"; ttp.style.fontFamily = style.getPropertyValue("font-family"); - var tod = tar.ownerDocument.documentElement; + var tod = tar.ownerDocument.documentElement, ttpc = ttp; //ttpcはttpのキャッシュ var tlen = tar.getComputedTextLength(), anchor = style.getPropertyValue("text-anchor"); /*ここでの変数jは前回ノードまでの総文字数*/ for (var i=0, j=0, tli=tar.getNumberOfChars();i<tli;++i) { if (ti) { - if (!!ti._tars) { + if (!!ti._tars && (ti._tars.length !== 0)) { var ij = (i > j) ? i - j : j - i var sty = ti._tars[ij].style, p = tar.getStartPositionOfChar(i); sty.position = "absolute"; @@ -3830,8 +3845,12 @@ sty = p = null; } if (ti.nodeName === "#text") { - if ((ti.data.length+j) <= i+1) { + if ((ti.data.length+j) <= i+1) { //テキストノード内の文字をすべて処理し終えれば j = j + ti.data.length; + if (ti.parentNode.localName === "a") { + ti = ti.parentNode; + ttp = ttpc; + } ti = ti.nextSibling; } } else if (!!ti.getNumberOfChars) { @@ -3839,6 +3858,10 @@ j = j + ti.getNumberOfChars(); ti = ti.nextSibling; } + } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { + ttp = ti._tar; + ti = ti.firstChild; + --i; } } } @@ -3878,7 +3901,7 @@ ttp.appendChild(backr); } delete tar._cacheMatrix, tar._currentStyle; - isRect = evt = tar = style = null; + isRect = evt = tar = style = tpp = ttpc = null; }, false); evt = tar = null; },false); @@ -4347,7 +4370,7 @@ SVGCursorElement.prototype = new SVGElement(); function SVGAElement() { - SVGElement.apply(this, arguments); + SVGElement.apply(this); this._tar = document.createElement("a"); /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString(); this.addEventListener("DOMAttrModified", function(evt){ @@ -4365,9 +4388,6 @@ 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) { @@ -5467,9 +5487,13 @@ "opacity", "cursor"]; if (isMSIE) { - /*IEのみ、font-sizeは自動で調整されているものを使った方がよい*/ - fontSize = parseFloat(ti._tar.currentStyle.fontSize); + var rand = "n" +Math.random(); + ti._tar.firstChild.setAttribute("id", rand); + var titf = document.getElementById(rand); + /*IEのみ、font-sizeは自動で調整されている(つまり、DOMからよびだされた)ものを使った方がよい*/ + fontSize = parseFloat(titf.currentStyle.fontSize); fe = fontSize / em; + rand = titf = null; } if (/a/[-1] === 'a') { //Firefoxならば ds = true; @@ -5478,6 +5502,9 @@ } if (ds){ while(node) { + if (!glyphs) { + break; + } data = node.data; if (data !== void 0) { //dataがある場合 var advanceX = [], glyphData = []; @@ -5543,20 +5570,20 @@ } if (isMSIE) { var style = ti.ownerDocument.getOverrideStyle(ti, null); - style.setProperty("display", "none"); + style.setProperty("visibility", "hidden"); style = null; } else { ti.setAttributeNS(null, "opacity", "0"); } } - data = isTategaki = horizOrVert = em = advX = dx = dy = fontSize = style = svgns = null; + data = isTategaki = horizOrVert = em = advX = dx = dy = fontSize = style = svgns = node = null; }; /*以下は、getComputedStyleメソッドで使うために、CSS2Propertiesの_listプロパティに、 *CSSprimitiveValueのリストを収納している。なお、その際に、writingModeなどはwriting-modeに変更している */ (function(){ - var s = new CSSStyleDeclaration(); + var s = new CSSStyleDeclaration(), n = 0; for (var i in CSS2Properties) { if(CSS2Properties.hasOwnProperty(i)) { var t = i.replace(/([A-Z])/, "-"); @@ -5567,13 +5594,15 @@ } t = t.replace(/\-/, u); s.setProperty(t, CSS2Properties[i]); + s._list[t] = s._list[n]; //この処理はCSSモジュールのgetCoputedStyleメソッドのため + ++n; p = m = i = t = u = null; } } s._list._opacity = 1; s._list._fontSize = 12; CSS2Properties._list = s._list; - Document.prototype.defaultView._defaultCSS = CSS2Properties._list; + Document.prototype.defaultView._defaultCSS = s._list; s = null; })(); Property changes on: branches/06x/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/063/org/w3c/dom/svg.js:2110-2146 /branches/06x/064/org/w3c/dom/svg.js:2149-2177 /branches/06x/065/org/w3c/dom/svg.js:2179-2209 /branches/06x/066/org/w3c/dom/svg.js:2211-2239 /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/064/org/w3c/dom/svg.js:2149-2177 /branches/06x/065/org/w3c/dom/svg.js:2179-2209 /branches/06x/066/org/w3c/dom/svg.js:2211-2239 /branches/06x/067/org/w3c/dom/svg.js:2257-2282 /branches/ufltima/dom/svg.js:1621-1856