svnno****@sourc*****
svnno****@sourc*****
2010年 10月 3日 (日) 23:10:33 JST
Revision: 2037 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2037 Author: dhrname Date: 2010-10-03 23:10:33 +0900 (Sun, 03 Oct 2010) Log Message: ----------- Modified Paths: -------------- branches/06x/061/org/w3c/dom/svg.js Modified: branches/06x/061/org/w3c/dom/svg.js =================================================================== --- branches/06x/061/org/w3c/dom/svg.js 2010-10-03 14:10:22 UTC (rev 2036) +++ branches/06x/061/org/w3c/dom/svg.js 2010-10-03 14:10:33 UTC (rev 2037) @@ -3419,10 +3419,6 @@ }, false); 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, ti = tar.firstChild, tp = tar.parentNode; if (!(tar instanceof SVGTextContentElement)) { return; @@ -3542,23 +3538,8 @@ } tar._isYokogaki = isYokogaki //getEndPositionOfCharメソッドなどで使う evt = tar = style = null; - }, true); - /*tspan要素から先にDONNodeInsertedIntoDocumentイベントを発火させる*/ - if (tar.localName === "tspan") { - var evtt = tar.ownerDocument.createEvent("MutationEvents"); - evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); - evtt.target = tar; - evtt.eventPhase = Event.AT_TARGET; - var tce = tar._capter; //tceは登録しておいたリスナーのリスト - for (var j=0,tcli=tce.length;j<tcli;++j){ - if (tce[j]) { - tce[j].handleEvent(evtt); - } - } - evtt = null; } - evt = tar = null; - },false); + }, false); return this; }; SVGTextPositioningElement.constructor = SVGTextContentElement; @@ -3602,6 +3583,20 @@ } tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { var tar = evt.target, ti = tar.firstChild, ttp = tar._tar; + if ((tar.localName === "text") && (tar.namespaceURI === "http://www.w3.org/2000/svg")) { + /*先にDONNodeInsertedイベントの浮上フェーズだけを発火させる*/ + var evtt = tar.ownerDocument.createEvent("MutationEvents"); + evtt.initMutationEvent("DOMNodeInserted", true, false, this, null, null, null, null); + evtt.target = tar; + evtt.eventPhase = Event.BUBBLING_PHASE; + var tce = tar._capter; //tceは登録しておいたリスナーのリスト + for (var j=0,tcli=tce.length;j<tcli;++j){ + if (tce[j]) { + tce[j].handleEvent(evtt); + } + } + evtt = tce = null; + } ttp.style.cssText = tar.style.cssText; var style = tar.ownerDocument.defaultView.getComputedStyle(tar, null); var n = parseFloat(style.getPropertyValue("font-size")) * Math.sqrt(Math.abs(tar.getScreenCTM()._determinant()));