OSDN Git Service

Version 0.6.52, fix X.UI.
authoritozyun <itozyun@user.sourceforge.jp>
Thu, 10 Jul 2014 05:47:48 +0000 (14:47 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Thu, 10 Jul 2014 05:47:48 +0000 (14:47 +0900)
0.6.x/js/core/00_builtin.js
0.6.x/js/dom/12_XDomEvent.js
0.6.x/js/ui/06_AbstractUINode.js
0.6.x/js/ui/20_PageRoot.js

index e49582f..496c533 100644 (file)
@@ -228,7 +228,7 @@ Object.prototype.hasOwnProperty || (Object.prototype.hasOwnProperty = function(
                var proto = this.constructor && this.constructor.prototype,\r
                        __p__ = proto && proto.__proto__,\r
                        v     = this[ p ],\r
-                       r = false;\r
+                       r     = false;\r
                \r
                if( __p__ ) proto.__proto__ = null;\r
                \r
@@ -236,24 +236,48 @@ Object.prototype.hasOwnProperty || (Object.prototype.hasOwnProperty = function(
                        if( v !== v ){\r
                                if( proto && ( p in proto ) && proto[ p ] !== proto[ p ] ){ // proto[ p ] is NaN\r
                                        proto[ p ] = 0; // different value\r
-                                       r = this[ p ] !== this[ p ]; // isNaN\r
-                                       proto[ p ] = v; // proto で定義されていた.\r
+                                       r = this[ p ] !== this[ p ]; // isNaN?\r
+                                       proto[ p ] = v; // set NaN\r
                                } else {\r
                                        r = true;\r
                                };\r
                        } else\r
-                       if( !proto || !( p in proto ) || ( proto[ p ] !== v ) ){\r
-                               r = true;\r
-                       } else {\r
+                       if( proto && p in proto && proto[ p ] === v ){\r
                                // this と proto に同名で同値が書かれている可能性あり\r
                                proto[ p ] = v + ' '; // different value\r
                                r = v === this[ p ];\r
-                               \r
                                proto[ p ] = v;\r
+                       } else {\r
+                               r = true;\r
+                       };\r
+               };\r
+               \r
+               if( __p__ ) proto.__proto__ = __p__;\r
+               \r
+               return r;\r
+  }); */\r
+/*\r
+Object.prototype.hasOwnProperty || (Object.prototype.hasOwnProperty = function( p ){\r
+               var proto = this.constructor && this.constructor.prototype,\r
+                       __p__ = proto && proto.__proto__,\r
+                       v     = this[ p ],\r
+                       isNaN = v !== v;\r
+                       r     = false;\r
+               \r
+               if( __p__ ) proto.__proto__ = null;\r
+               \r
+               if( p in this ){\r
+                       if( proto && p in proto && ( proto[ p ] === v ) ^ isNaN ){ //true + false, false + true\r
+                               // this と proto に同名で同値が書かれている可能性あり\r
+                               proto[ p ] = v + ' '; // different value\r
+                               r = ( v === this[ p ] ) ^ isNaN; // true + false, false + true\r
+                               proto[ p ] = v;\r
+                       } else {\r
+                               r = true;\r
                        };\r
                };\r
                \r
                if( __p__ ) proto.__proto__ = __p__;\r
                \r
                return r;\r
-  });*/\r
+  }); */
\ No newline at end of file
index 1ec779c..145054e 100644 (file)
@@ -217,7 +217,7 @@ X.Dom.Node.prototype._addEvent =
                                raw.addEventListener( type, this._handleEvent, false );\r
                        };\r
                }) :\r
-       X.Dom.EVENT_W3C && ( X.UA.Opera7 || X.UA.NetFront ) ?\r
+       X.Dom.EVENT_W3C && X.UA.Opera7 ?\r
                (function( type ){\r
                        var raw = this._rawNode;\r
                        if( !raw ) return;\r
@@ -272,7 +272,7 @@ X.Dom.Node.prototype._removeEvent =
                                delete this._handleEvent;\r
                        };\r
                }) :\r
-       X.Dom.EVENT_W3C && ( X.UA.Opera7 || X.UA.NetFront ) ?\r
+       X.Dom.EVENT_W3C && X.UA.Opera7 ?\r
                (function( type ){\r
                        var raw = this._rawNode;\r
                        if( !raw ) return;\r
index 4dcbc02..82a9d65 100644 (file)
@@ -58,6 +58,7 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                contentHeight     : X.UI.Attr.AUTO,\r
                minContentHeight  : 0,\r
                maxContentHeight  : X.UI.Attr.AUTO,\r
+               lastContentHeight : -1,\r
                \r
                constraintW       : false,\r
                constraintH       : false,\r
@@ -577,7 +578,8 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                \r
                                case X.UI.Dirty.CONTENT : // コンテンツが変更された\r
                                case X.UI.Dirty.FONT    : // フォントサイズが変更された\r
-                                       delete this.lastContentWidth;   \r
+                                       delete this.lastContentWidth;\r
+                                       delete this.lastContentHeight;\r
                                        \r
                                case X.UI.Dirty.LAYOUT : // レイアウトの再計算が必要\r
                                \r
@@ -623,8 +625,10 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                                if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
                                                                if( h - this.boxSizingOffsetTB < this.minContentHeight ) this.contentHeight = this.minContentHeight + this.boxSizingOffsetTB;\r
                                                        } else {\r
-                                                               this.scrollHeight = xnode.height() / xnode._getCharSize() + this.contentT + this.contentB;\r
+                                                               this.scrollHeight = h + this.contentT + this.contentB;\r
                                                        };\r
+                                                       \r
+                                                       this.lastContentHeight = h;\r
                                                } else\r
                                                if( h === X.UI.Attr.AUTO ){\r
                                                        if( w !== this.lastContentWidth ){\r
@@ -637,13 +641,15 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                                if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
                                                                if( h - this.boxSizingOffsetTB < this.minContentHeight ) this.contentHeight = this.minContentHeight + this.boxSizingOffsetTB;                                                           \r
                                                        } else {\r
-                                                               this.scrollWidth  = w + this.contentL + this.contentR;\r
-                                                               this.scrollHeight = h + this.contentT + this.contentB;\r
+                                                               this.contentHeight = this.lastContentHeight = h =\r
+                                                                       this.lastContentHeight === -1 ? xnode.scrollHeight() / xnode._getCharSize() : this.lastContentHeight;\r
+                                                               this.scrollWidth   = w + this.contentL + this.contentR;\r
+                                                               this.scrollHeight  = h + this.contentT + this.contentB;\r
                                                        };\r
                                                } else\r
                                                if( dirty !== X.UI.Dirty.LAYOUT ){\r
-                                                       this.contentWidth  = this.lastContentWidth = w; //xnode.width();\r
-                                                       this.contentHeight = xnode.height() / xnode._getCharSize();\r
+                                                       this.contentWidth  = this.lastContentWidth  = w; //xnode.width();\r
+                                                       this.contentHeight = this.lastContentHeight = xnode.scrollHeight() / xnode._getCharSize();\r
                                                        this.scrollWidth   = this.contentWidth  + this.contentL + this.contentR;\r
                                                        this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
                                                } else {\r
@@ -775,7 +781,7 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                ++counter[ type ];\r
                                        } else {\r
                                                counter[ type ] = 1;                            \r
-                                               root.elmMouseCatch.listen( X.UI.Event.IdToName[ type ], eventRellay );\r
+                                               root.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ type ], eventRellay );\r
                                        };\r
                                };\r
                        };\r
@@ -807,7 +813,7 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                        if( !counter[ type ] ) return this;\r
                                        --counter[ type ];\r
                                        if( counter[ type ] === 0 ){\r
-                                               X.Dom.Event.remove( root.elmMouseCatch, X.UI.Event.IdToName[ type ], eventRellay );\r
+                                               root.xnodeInteractiveLayer.unlisten( X.UI.Event.IdToName[ type ], eventRellay );\r
                                                delete counter[ type ];\r
                                        };\r
                                };\r
index c377aad..2a658aa 100644 (file)
@@ -57,16 +57,16 @@ var _PageRoot = _Box.inherits(
        '_PageRoot',
        X.Class.FINAL | X.Class.PRIVATE_DATA | X.Class.SUPER_ACCESS,
        {
-               layout           : X.UI.Layout.Canvas,
+               layout                : X.UI.Layout.Canvas,
                
-               calcReserved     : false,
-               hoverList        : null,
-               targetNodeData   : null,
-               monopolyNodeData : null,
+               calcReserved          : false,
+               hoverList             : null,
+               targetNodeData        : null,
+               monopolyNodeData      : null,
                
-               elmMouseCatch    : null,
-               eventCounter     : null,
-               cursorStyle      : null,
+               xnodeInteractiveLayer : null,
+               eventCounter          : null,
+               cursorStyle           : null,
                
                Constructor : function( layout, args ){
                        this.SuperConstructor( layout, args );
@@ -90,11 +90,11 @@ var _PageRoot = _Box.inherits(
                addToView : function(){
                        var     counter = this.eventCounter, flg;
                        
-                       // this.elmMouseCatch の前に追加する!
+                       // this.xnodeInteractiveLayer の前に追加する!
 
                        this.addToParent( X.Dom.Node.root );
                        
-                       this.elmMouseCatch = X.Dom.Node.root.create( 'div', {
+                       this.xnodeInteractiveLayer = X.Dom.Node.root.create( 'div', {
                                'class'      : 'mouse-operation-catcher',
                                unselectable : 'on'
                        } );
@@ -103,14 +103,14 @@ var _PageRoot = _Box.inherits(
                        // X.Dom.Event.activate, X.Dom.Event.deactivate ?
                        // mouseout, mouseover
                        if( navigator.msPointerEnabled || navigator.pointerEnabled ){
-                               this.elmMouseCatch.listen( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], eventRellay );
+                               this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], eventRellay );
                                if( counter[ X.UI.Event._POINTER_MOVE ] ){
                                        ++counter[ X.UI.Event._POINTER_MOVE ];
                                } else {
                                        counter[ X.UI.Event._POINTER_MOVE ] = 1;
                                };
                        } else {
-                               this.elmMouseCatch.listen( X.UI.Event.IdToName[ X.UI.Event._MOUSE_MOVE ], eventRellay );
+                               this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._MOUSE_MOVE ], eventRellay );
                                if( counter[ X.UI.Event._MOUSE_MOVE ] ){
                                        ++counter[ X.UI.Event._MOUSE_MOVE ];
                                } else {
@@ -159,7 +159,7 @@ var _PageRoot = _Box.inherits(
                },
                
                _remove : function(){
-                       this.elmMouseCatch.unlisten();
+                       this.xnodeInteractiveLayer.unlisten();
                        _Box.prototype._remove.call( this );
                }
        }