OSDN Git Service

Version 0..6.127, commitUpdate after GPU_RELEASED.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 16_XViewPort.js
index 61c898f..cdcdf72 100644 (file)
@@ -51,17 +51,20 @@ X_ViewPort = X_Class_override(
                                        break;
 
                                case 'visibilitychange' :
-                                       X_ViewPort.asyncDispatch( ( X_ViewPort_active = document[ 'hidden' ] ) ? X.Event.VIEW_DEACTIVATE : X.Event.VIEW_ACTIVATE );
+                                       X_ViewPort.dispatch( ( X_ViewPort_active = document[ 'hidden' ] ) ? X.Event.VIEW_DEACTIVATE : X.Event.VIEW_ACTIVATE );
+                                       break;
+                               case 'mozvisibilitychange' :
+                                       X_ViewPort.dispatch( ( X_ViewPort_active = document[ 'mozHidden' ] ) ? X.Event.VIEW_DEACTIVATE : X.Event.VIEW_ACTIVATE );
                                        break;
                                case 'webkitvisibilitychange' :
-                                       X_ViewPort.asyncDispatch( ( X_ViewPort_active = document[ 'webkitHidden' ] ) ? X.Event.VIEW_DEACTIVATE : X.Event.VIEW_ACTIVATE );
+                                       X_ViewPort.dispatch( ( X_ViewPort_active = document[ 'webkitHidden' ] ) ? X.Event.VIEW_DEACTIVATE : X.Event.VIEW_ACTIVATE );
                                        break;
                                        
                                case 'pageshow' :
                                case 'focus' :
                                        if( !X_ViewPort_active ){
                                                X_ViewPort_active = true;
-                                               X_ViewPort.asyncDispatch( X.Event.VIEW_ACTIVATE );                                              
+                                               X_ViewPort.dispatch( X.Event.VIEW_ACTIVATE );
                                        };
                                        break;
 
@@ -69,7 +72,7 @@ X_ViewPort = X_Class_override(
                                case 'blur' :
                                        if( X_ViewPort_active ){
                                                X_ViewPort_active = false;
-                                               X_ViewPort.asyncDispatch( X.Event.VIEW_DEACTIVATE );                                            
+                                               X_ViewPort.dispatch( X.Event.VIEW_DEACTIVATE );                         
                                        };
                                        break;
                        };
@@ -284,22 +287,20 @@ X.ViewPort = {
                        X_ViewPort_rootElement = document.compatMode !== 'CSS1Compat' ? elmBody : elmHtml || elmBody;
 
                        html = X.Doc.html = X_Node_html = elmHtml && new Node( elmHtml );
-               
+                       html._flags |= X_Node_State.IN_TREE;
+                       
                        head = X.Doc.head = X_Node_head = elmHead && new Node( elmHead );
                
                        body = X.Doc.body = X_Node_body = new Node( elmBody );
-                       
-                       body._root   = html._root = head._root = body;// _root は html だろ
+
                        body.parent  = head.parent = html;
-                       html._xnodes = [ head, body ];                  
-                       
-                       Node.root = body; // 後方互換
+                       html._xnodes = [ head, body ];
                        
-                       html.appendTo = html.appendToRoot = html.before = html.after = html.clone = html.remove = html.destroy = html.prevNode = html.nextNode =
+                       html.appendTo = html.appendToRoot = html.before = html.after = html.clone = html.remove = html.destroy = html.prev = html.next =
                        html.create = html.createText = html.createAt = html.createTextAt = html.append = html.appendAt = html.empty = html.html = html.text =
-                       head.appendTo = head.appendToRoot = head.before = head.after = head.clone = head.remove = head.destroy = head.prevNode = head.nextNode =
+                       head.appendTo = head.appendToRoot = head.before = head.after = head.clone = head.remove = head.destroy =
                        head.empty = head.html = head.text =
-                       body.appendTo = body.appendToRoot = body.before = body.after = body.clone = body.remove = body.destroy = body.prevNode = body.nextNode = new Function( 'return this' );
+                       body.appendTo = body.appendToRoot = body.before = body.after = body.clone = body.remove = body.destroy = new Function( 'return this' );
 
                        X_ViewPort.listenOnce( X_TEMP.SYSTEM_EVENT_PRE_INIT, function(){
                                X_ViewPort_readyState = X_TEMP.SYSTEM_EVENT_XTREE;
@@ -311,8 +312,8 @@ X.ViewPort = {
                                X_ViewPort_readyState = X_TEMP.SYSTEM_EVENT_INIT;
                                //X_UA.Opera7 && alert( 'bc' );
                                X_Node_body.appendAt( 0,
-                                       X_Node_systemNode = Node.create( 'div', { 'class' : 'hidden-system-node' } ),
-                                       X_Node_fontSizeNode = Node.create( 'div', { 'class' : 'hidden-system-node' } ).cssText( 'line-height:1;height:1em;' ).text( 'X' )
+                                       X_Node_systemNode = X_Doc_create( 'div', { 'class' : 'hidden-system-node' } ),
+                                       X_Node_fontSizeNode = X_Doc_create( 'div', { 'class' : 'hidden-system-node' } ).cssText( 'line-height:1;height:1em;' ).text( 'X' )
                                );
                                X_Node_startUpdate();
 
@@ -372,13 +373,16 @@ X.ViewPort = {
 //ブラウザの戻るボタンで戻ったときに呼ばれるイベントとかキャッシュとかそこらへんのこと
 //http://d.hatena.ne.jp/koumiya/20080916/1221580149
 
-                       if( document[ 'hidden' ] !== undefined ) {// iOS 7+
+                       if( document[ 'hidden' ] !== undefined ){// iOS 7+
                                X_EventDispatcher_systemListen( X_ViewPort_document, 'visibilitychange', X_ViewPort );
                        } else
-                       if( document[ 'webkitHidden' ] !== undefined ) {
+                       if( document[ 'mozHidden' ] !== undefined ){
+                               X_EventDispatcher_systemListen( X_ViewPort_document, 'mozvisibilitychange', X_ViewPort );
+                       } else
+                       if( document[ 'webkitHidden' ] !== undefined ){
                                X_EventDispatcher_systemListen( X_ViewPort_document, 'webkitvisibilitychange', X_ViewPort );
                        } else
-                       if( X_UA.iOS && window[ 'onpageshow' ] !== undefined ) {
+                       if( X_UA.iOS && window[ 'onpageshow' ] !== undefined ){
                                X_EventDispatcher_systemListen( X_ViewPort, [ 'pageshow', 'pagehide' ] );
                        } else {
                                X_EventDispatcher_systemListen( X_ViewPort, [ 'focus', 'blur' ] );