X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F20_XNode.js;h=b775d71b746e71537b42ef4de9264a4510bc2d4d;hb=241005e2a5f9f8a7fddd6f610b76a915e9c05d30;hp=b7f8ce9be563ecd0eec258815126d74147e3e21e;hpb=eca68ae8a52822bb0d2d7556fd28784bb2103a2f;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/20_XNode.js b/0.6.x/js/02_dom/20_XNode.js index b7f8ce9..b775d71 100644 --- a/0.6.x/js/02_dom/20_XNode.js +++ b/0.6.x/js/02_dom/20_XNode.js @@ -787,8 +787,7 @@ function X_Node_remove(){ this[ '_xnodes' ] && X_Node_toggleInTreeFlag( this[ '_xnodes' ], false ); if( X_UA_DOM.IE4 ){ - elm = this[ '_rawObject' ] || X_Node__ie4getRawNode( this ); - if( elm ){ + if( elm = this[ '_rawObject' ] || X_Node__ie4getRawNode( this ) ){ X_Node_reserveRemoval[ X_Node_reserveRemoval.length ] = this; X_Node_reserveUpdate(); } else @@ -802,6 +801,14 @@ function X_Node_remove(){ X_Node_reserveUpdate(); }; }; + } else { + if( !X_UA_DOM.IE4 ){ + elm = this[ '_rawObject' ]; + if( elm && elm.parentNode && elm.parentNode.tagName ){ + X_Node_reserveRemoval[ X_Node_reserveRemoval.length ] = this; + X_Node_reserveUpdate(); + }; + }; }; return this; }; @@ -1216,7 +1223,7 @@ function X_Node_call( name /*, opt_args... */ ){ }; if( name === 'inView' ){ - body = document.body; + body = X_elmBody; child = raw; visibleX = visibleY = visibleW = visibleH = 0; while( child !== body ){ @@ -1454,7 +1461,7 @@ var X_Node__commitUpdate = if( !elm ){ if( !that[ '_tag' ] ){ that[ '_flags' ] &= X_Node_BitMask_RESET_DIRTY; - that[ '_rawObject' ] = elm = document.createTextNode( X_String_chrReferanceTo( that[ '_text' ] ) ); + elm = document.createTextNode( X_String_chrReferanceTo( that[ '_text' ] ) ); if( !X_UA[ 'IE' ] ){ elm[ 'UID' ] = that[ '_uid' ]; }; @@ -1462,7 +1469,7 @@ var X_Node__commitUpdate = if( X_Node_strictElmCreation ){ that[ '_flags' ] & X_NodeFlags_OLD_CSSTEXT && X_Node_CSS_objToCssText( that, true ); // OLD_CSSTEXT ?? - that[ '_rawObject' ] = elm = + elm = document.createElement( [ '<', that[ '_tag' ], ' UID="', that[ '_uid' ], '"', @@ -1471,14 +1478,15 @@ var X_Node__commitUpdate = X_Node_Attr_objToAttrText( that, true ), that[ '_cssText' ] ? ' style="' + that[ '_cssText' ] + '"' : '', '>' ].join( '' ) ); + } else + if( that[ '_flags' ] & X_NodeFlags_IS_SVG ){ + elm = document.createElementNS( 'http://www.w3.org/2000/svg', that[ '_tag' ].toLowerCase() ); } else { - if( that[ '_flags' ] & X_NodeFlags_IS_SVG ){ - that[ '_rawObject' ] = elm = document.createElementNS( 'http://www.w3.org/2000/svg', that[ '_tag' ].toLowerCase() ); - } else { - that[ '_rawObject' ] = elm = document.createElement( that[ '_tag' ] ); - }; + elm = document.createElement( that[ '_tag' ] ); }; + that[ '_rawObject' ] = elm; + // IE には要素追加のタイミングで起こるメモリリークがありここで追加 if( !X_Node_addTreeAfterChildren ){ nextElement ? @@ -1490,10 +1498,10 @@ var X_Node__commitUpdate = X_EventDispatcher_toggleAllEvents( that, true );// イベントの復帰 that[ '_flags' ] |= X_NodeFlags_ACTUAL_LISTENING; - if( X_Node_documentFragment ){ + //if( X_Node_documentFragment ){ //( frg = X_Node_documentFragment ).appendChild( elm ); // 連続する要素の差し替えの場合に有効 - }; + //}; if( X_Node_strictElmCreation ){ that[ '_flags' ] &= X_Node_BitMask_RESET_DIRTY;