OSDN Git Service

Version 0.6.140, fix size detection @IE.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 06_AbstractUINode.js
index f649cd5..9004773 100644 (file)
@@ -393,7 +393,7 @@ X.UI._AbstractUINode = X_EventDispatcher[ 'inherits' ](
                                        contentW = XUI_AbstractUINode_calcFinalValue( attrs[ X.UI.Attr.Support.width.No ], attrs[ X.UI.Attr.Support.minWidth.No ], attrs[ X.UI.Attr.Support.maxWidth.No ], allowedW );                                  \r
                                };\r
                                this.contentWidth = contentW + boxMinus;\r
-                               this.scrollWidth  = this.contentWidth + this.contentL + this.contentR;\r
+                               //this.scrollWidth  = this.contentWidth + this.contentL + this.contentR;\r
                                this.boxWidth     = contentW - boxMinus + this.contentL + this.contentR;\r
                                this.boxSizingOffsetLR = boxMinus;\r
                                delete this.minContentWidth;\r
@@ -401,9 +401,9 @@ X.UI._AbstractUINode = X_EventDispatcher[ 'inherits' ](
                                delete this.minBoxWidth;\r
                                delete this.maxBoxWidth;\r
                        } else {        \r
-                               this.minContentWidth = XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.minWidth.No ], allowedW ) + boxMinus;\r
-                               this.maxContentWidth = XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.maxWidth.No ], allowedW ) + boxMinus;\r
-                               this.scrollWidth     = this.contentWidth + this.contentL + this.contentR;\r
+                               this.minContentWidth = XUI_AbstractUINode_ceil( XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.minWidth.No ], allowedW ) + boxMinus );\r
+                               this.maxContentWidth = XUI_AbstractUINode_ceil( XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.maxWidth.No ], allowedW ) + boxMinus );\r
+                               //this.scrollWidth     = this.contentWidth + this.contentL + this.contentR;\r
                                this.minBoxWidth     = this.minContentWidth - boxMinus + this.contentL + this.contentR;\r
                                this.maxBoxWidth     = this.maxContentWidth - boxMinus + this.contentL + this.contentR;\r
                                //delete this.contentWidth;\r
@@ -435,7 +435,7 @@ X.UI._AbstractUINode = X_EventDispatcher[ 'inherits' ](
                                        contentH = XUI_AbstractUINode_calcFinalValue( attrs[ X.UI.Attr.Support.height.No ], attrs[ X.UI.Attr.Support.minHeight.No ], attrs[ X.UI.Attr.Support.maxHeight.No ], allowedH );\r
                                };                      \r
                                this.contentHeight = contentH + boxMinus;\r
-                               this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
+                               //this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
                                this.boxHeight     = contentH - boxMinus + this.contentT + this.contentB; // padding-box の場合 border だけ足される\r
                                this.boxSizingOffsetTB = boxMinus;\r
                                delete this.minContentHeight;\r
@@ -443,8 +443,8 @@ X.UI._AbstractUINode = X_EventDispatcher[ 'inherits' ](
                                delete this.minBoxHeight;\r
                                delete this.maxBoxHeight;\r
                        } else {\r
-                               this.minContentHeight = XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.minHeight.No ], allowedH ) + boxMinus;\r
-                               this.maxContentHeight = XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.maxHeight.No ], allowedH ) + boxMinus;                           \r
+                               this.minContentHeight = XUI_AbstractUINode_ceil( XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.minHeight.No ], allowedH ) + boxMinus );\r
+                               this.maxContentHeight = XUI_AbstractUINode_ceil( XUI_AbstractUINode_calcValue( attrs[ X.UI.Attr.Support.maxHeight.No ], allowedH ) + boxMinus );                                \r
                                this.minBoxHeight = this.minContentHeight - boxMinus + this.contentT + this.contentB;\r
                                this.maxBoxHeight = this.maxContentHeight - boxMinus + this.contentT + this.contentB;\r
                \r
@@ -529,58 +529,61 @@ X.UI._AbstractUINode = X_EventDispatcher[ 'inherits' ](
                                         */\r
                                        if( xnode[ '_xnodes' ] && xnode[ '_xnodes' ].length ){\r
                                                if( w === X.UI.Attr.AUTO ){\r
-                                                       w = this.contentWidth = xnode[ 'css' ]( 'width', 'auto' )[ 'width' ]() / X_Node_CSS_getCharSize( xnode );\r
+                                                       w = this.contentWidth = XUI_AbstractUINode_ceil( xnode[ 'css' ]( 'width', 'auto' )[ 'width' ]() / X_Node_CSS_getCharSize( xnode ) );\r
+                                                       console.log( 'chr ' + X_Node_CSS_getCharSize( xnode ) );\r
                                                        \r
-                                                       this.scrollWidth = w + this.contentL + this.contentR;\r
+                                                       //this.scrollWidth = w + this.contentL + this.contentR;\r
                                                        if( this.maxContentWidth < w - this.boxSizingOffsetLR ) this.contentWidth = this.maxContentWidth + this.boxSizingOffsetLR;\r
                                                        if( w - this.boxSizingOffsetLR < this.minContentWidth ) this.contentWidth = this.minContentWidth + this.boxSizingOffsetLR;\r
                                                        this.lastContentWidth = this.contentWidth;\r
                                                        \r
-                                                       w !== this.contentWidth && xnode[ 'css' ]( 'width', XUI_AbstractUINode_ceil( this.contentWidth ) + 'em' );\r
+                                                       w !== this.contentWidth && xnode[ 'css' ]( 'width', this.contentWidth + 'em' );\r
                                                        \r
                                                        if( h === X.UI.Attr.AUTO ){\r
-                                                               this.contentHeight = h = xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ); // scrollHeight() ??\r
-                                                               this.scrollHeight  = h + this.contentT + this.contentB;\r
+                                                               this.contentHeight = h = XUI_AbstractUINode_ceil( xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ) ); // scrollHeight() ??\r
+                                                               //this.scrollHeight  = h + this.contentT + this.contentB;\r
                                                                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 = h + 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
+                                                       console.log( 'chr ' + X_Node_CSS_getCharSize( xnode ) );\r
                                                        if( w !== this.lastContentWidth ){\r
-                                                               xnode[ 'css' ]( 'width', XUI_AbstractUINode_ceil( w ) + 'em' );\r
+                                                               xnode[ 'css' ]( 'width', w + 'em' );\r
                                                                \r
                                                                this.lastContentWidth  = w;\r
-                                                               this.contentHeight = h = xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode );\r
-                                                               this.scrollWidth       = w + this.contentL + this.contentR;\r
-                                                               this.scrollHeight      = h + this.contentT + this.contentB;\r
+                                                               this.contentHeight = h = XUI_AbstractUINode_ceil( xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ) ); // ie8 clientHeight, ff scrollHeight & clientHeight\r
+                                                               //this.scrollWidth       = w + this.contentL + this.contentR;\r
+                                                               //this.scrollHeight      = h + this.contentT + this.contentB;\r
                                                                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.contentHeight = this.lastContentHeight = h =\r
-                                                                       this.lastContentHeight === -1 ? xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ) : this.lastContentHeight;\r
-                                                               this.scrollWidth   = w + this.contentL + this.contentR;\r
-                                                               this.scrollHeight  = h + this.contentT + this.contentB;\r
+                                                                       this.lastContentHeight === -1 ? XUI_AbstractUINode_ceil( xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ) ) : 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 = this.lastContentHeight = xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode );\r
-                                                       this.scrollWidth   = this.contentWidth  + this.contentL + this.contentR;\r
-                                                       this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
+                                                       console.log( 'chr ' + X_Node_CSS_getCharSize( xnode ) );\r
+                                                       this.contentWidth  = this.lastContentWidth  = w;\r
+                                                       this.contentHeight = this.lastContentHeight = XUI_AbstractUINode_ceil( xnode[ 'css' ]( 'height', 'auto' )[ 'scrollHeight' ]() / X_Node_CSS_getCharSize( xnode ) );\r
+                                                       //this.scrollWidth   = this.contentWidth  + this.contentL + this.contentR;\r
+                                                       //this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
                                                } else {\r
-                                                       this.scrollWidth  = w + this.contentL + this.contentR;\r
-                                                       this.scrollHeight = h + this.contentT + this.contentB;\r
+                                                       //this.scrollWidth  = w + this.contentL + this.contentR;\r
+                                                       //this.scrollHeight = h + this.contentT + this.contentB;\r
                                                };              \r
                                        } else {\r
                                                // コンテンツを持たないため基本のサイズは0\r
                                                if( w === X.UI.Attr.AUTO ) this.contentWidth  = w = 0 < this.minContentWidth  ? this.minContentWidth  : 0;\r
                                                if( h === X.UI.Attr.AUTO ) this.contentHeight = h = 0 < this.minContentHeight ? this.minContentHeight : 0;\r
-                                               this.scrollWidth  = w + this.contentL + this.contentR;\r
-                                               this.scrollHeight = h + this.contentT + this.contentB;\r
+                                               //this.scrollWidth  = w + this.contentL + this.contentR;\r
+                                               //this.scrollHeight = h + this.contentT + this.contentB;\r
                                        };\r
                                        \r
                                        delete this.dirty;\r