OSDN Git Service

Version 0.6.221, Update the X.TextRange.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 20_XNode.js
index 6b67d04..bb392e3 100644 (file)
@@ -1382,7 +1382,7 @@ function X_Node_reserveUpdate(){
 var X_Node_updateReservedByReleaseGPU = false;
 
 function X_Node_startUpdate( time ){
-       var removal, i, xnodeOrElm, xnodesIEFilterFixAfter, xnode;
+       var removal, i, xnodeOrElm, xnodesIEFilterFixAfter, xnode, active;
        
        if( !X_Node_updateTimerID || X_ViewPort_readyState < X_EVENT_INIT ){
                return;
@@ -1422,17 +1422,24 @@ function X_Node_startUpdate( time ){
                removal.length = 0;
        };
        
-       //
-       X_UA[ 'IE5' ] && ( X_elmBody.style.visibility = 'hidden' );
-       
+       // 強制的に再描画を起こす, 但し activeElement からフォーカスが外れるため復帰する
+       // IE5mode win10 で 確認
+       if( X_UA[ 'IE5' ] ){
+               active = document.activeElement;
+               X_elmBody.style.visibility = 'hidden';
+       };
+
        if( X_Node_html[ '_flags' ] & X_Node_BitMask_IS_DIRTY ){
                X_Node__commitUpdate( X_Node_html, X_Node_html[ '_rawObject' ].parentNode, null, X_Node_html[ '_flags' ], 1, xnodesIEFilterFixAfter = [] );
        } else {
                X_Node__commitUpdate( X_Node_head, X_Node_head[ '_rawObject' ].parentNode, null, X_Node_head[ '_flags' ], 1, xnodesIEFilterFixAfter = [] );
                X_Node__commitUpdate( X_Node_body, X_Node_body[ '_rawObject' ].parentNode, null, X_Node_body[ '_flags' ], 1, xnodesIEFilterFixAfter = [] );
        };
-       
-       X_UA[ 'IE5' ] && ( X_elmBody.style.visibility = '' );
+
+       if( X_UA[ 'IE5' ] ){
+               X_elmBody.style.visibility = '';
+               active && active.parentNode && active.focus();
+       };
        
        if( X_Node_updateReservedByReleaseGPU ){
                X_Node_reserveUpdate();
@@ -1522,7 +1529,12 @@ var X_Node__commitUpdate =
                        if( !elm ){
                                if( !that[ '_tag' ] ){
                                        that[ '_flags' ] &= X_Node_BitMask_RESET_DIRTY;
-                                       elm = document.createTextNode( X_String_chrReferanceTo( that[ '_text' ] ) );
+                                       if( X_UA[ 'IE' ] < 8 ){
+                                               // \n -> \r\n に変換しないと pre タグで開業されない  win10ie7(ie11 emu) で確認
+                                               elm = document.createTextNode( X_String_chrReferanceTo( that[ '_text' ] ).split( '\n' ).join( X_String_CRLF ) );
+                                       } else {
+                                               elm = document.createTextNode( X_String_chrReferanceTo( that[ '_text' ] ) );
+                                       };
                                        if( !X_UA[ 'IE' ] ){
                                                elm[ 'UID' ] = that[ '_uid' ];
                                        };
@@ -1798,7 +1810,12 @@ var X_Node__updateRawNode =
 
                        // textNode
                        if( !that[ '_tag' ] ){
-                               elm.data = X_String_chrReferanceTo( that[ '_text' ] );
+                               if( X_UA[ 'IE' ] < 8 ){
+                                       // \n -> \r\n に変換しないと pre タグで開業されない  win10ie7(ie11 emu) で確認
+                                       elm.data = X_String_chrReferanceTo( that[ '_text' ] ).split( '\n' ).join( X_String_CRLF );
+                               } else {
+                                       elm.data = X_String_chrReferanceTo( that[ '_text' ] );
+                               };
                                that[ '_flags' ] &= X_Node_BitMask_RESET_DIRTY;
                                return;
                        };