svnno****@sourc*****
svnno****@sourc*****
2011年 2月 1日 (火) 22:57:48 JST
Revision: 2352
http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2352
Author: dhrname
Date: 2011-02-01 22:57:48 +0900 (Tue, 01 Feb 2011)
Log Message:
-----------
SVGLoadイベント発生後に、属性変更による画像の更新をするように改良
Modified Paths:
--------------
branches/06x/069/org/w3c/dom/svg.js
Modified: branches/06x/069/org/w3c/dom/svg.js
===================================================================
--- branches/06x/069/org/w3c/dom/svg.js 2011-02-01 13:29:07 UTC (rev 2351)
+++ branches/06x/069/org/w3c/dom/svg.js 2011-02-01 13:57:48 UTC (rev 2352)
@@ -286,19 +286,6 @@
}
}
}
- if (tar.parentNode) {
- 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 = _parseFloat = name = tar = null;
}, false);
return this;
@@ -1148,7 +1135,30 @@
tar.viewport.height = tar.height.baseVal.value;
}
evt = name = null;
- }, false);
+ }, false);
+ this.addEventListener("SVGLoad", function(evt){
+ this.addEventListener("DOMAttrModified", function(evt){
+ if (evt.eventPhase === Event.BUBBLING_PHASE) {
+ var tar = evt.target;
+ if (tar.parentNode) {
+ 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;
+ }
+ tar = null;
+ }
+ evt = null;
+ }, false);
+ evt = null;
+ }, true);
return this;
};
SVGSVGElement.constructor = SVGElement;