OSDN Git Service

Version 0.6.50, fix X.UI.AbstractUINode.
authoritozyun <itozyun@user.sourceforge.jp>
Fri, 27 Jun 2014 12:42:42 +0000 (21:42 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Fri, 27 Jun 2014 12:42:42 +0000 (21:42 +0900)
0.6.x/css/xui.css [moved from 0.6.x/css/ju.css with 85% similarity]
0.6.x/index.html
0.6.x/js/dom/13_XDomBoxModel.js
0.6.x/js/ui/02_XUI_Attr.js
0.6.x/js/ui/06_AbstractUINode.js

similarity index 85%
rename from 0.6.x/css/ju.css
rename to 0.6.x/css/xui.css
index badd6fb..2b27751 100644 (file)
@@ -6,11 +6,18 @@ html, body {
        overflow : hidden;\r
 }\r
 \r
+.PageRoot {\r
+       height             : 100%;\r
+       position : relative;\r
+}\r
+\r
+.PageRoot,\r
 .PageRoot div {\r
 /* 要素は絶対配置される */\r
        position           : absolute;\r
        top                : 0;\r
        left               : 0;\r
+       width              : 100%;\r
        padding            : 0;\r
        margin             : 0;\r
 /* ブラウザのレイアウト機能による auto なサイズ指定は行わない */\r
@@ -25,6 +32,17 @@ html, body {
 /* browser bug fix */\r
        -moz-opacity       : 0.99;\r
        zoom               : 1;\r
+       \r
+       *word-break        : break-all;  /* ie5+ */\r
+       word-wrap          : break-word; /* IE5.5?5?, Firefox3.5, Chrome1 Opera10.5 Safari1 */\r
+       white-space        : pre;           /* CSS 2.0 */\r
+       white-space        : pre-wrap;      /* CSS 2.1 */\r
+       white-space        : pre-line;      /* CSS 3.0 */\r
+       /* white-space : -pre-wrap;     Opera 4-6 */\r
+       /* white-space : -o-pre-wrap;   Opera 7 */\r
+       white-space        : -moz-pre-wrap; /* Mozilla */\r
+       /* white-space : -hp-pre-wrap;  HP Printers */\r
+       white-space        : normal\9;   /* ie系では、 float要素へ回り込みする、 white-space の効いているテキストの位置が狂う */\r
 }\r
 \r
 * {zoom:1}\r
@@ -84,29 +102,6 @@ html, body {
        z-index    : 99;\r
 }\r
 \r
-/*------------------------------------------------------------------------------------\r
- *  mouse-operation-catcher\r
- */\r
-.jul-hover {\r
-       opacity : 0.5;\r
-}\r
-\r
-.PageRoot {\r
-       position : relative;\r
-}\r
-\r
-.Box,\r
-.VBox,\r
-.HBox,\r
-.TileBox,\r
-.ChromeBox,\r
-.ScrollBox {\r
-       position        : absolute;\r
-       overflow        : hidden;\r
-       box-sizing      : border-box;\r
-       -moz-box-sizing : border-box;\r
-}\r
-\r
 /*  Scrollbox\r
 --------------------------------------------------------------------------------------*/\r
        .ScrollBox-Scroller {\r
index 0291492..1c746da 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>\r
 <html lang="ja" class="js-disabled">\r
 <head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+<meta charset="utf-8">\r
 <title>New X.UI</title>\r
 <meta name="HandheldFriendly" content="true">\r
 <meta name="mobileoptimized" content="0">\r
@@ -10,7 +10,7 @@
 <meta name="format-detection" content="telephone=no">\r
 <meta name="apple-mobile-web-app-capable">\r
 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,maximum-scale=1">\r
-<link rel="stylesheet" type="text/css" media="all" href="css/ju.css">\r
+<link rel="stylesheet" type="text/css" media="all" href="css/xui.css">\r
 \r
 <script type="text/javascript" src="js/core/00_builtin.js"></script>\r
 <script type="text/javascript" src="js/core/00_X.js"></script>\r
index 49a0288..7d70bc3 100644 (file)
@@ -137,7 +137,7 @@ Node.prototype.scrollHeight = function(){
                return this._rawNode.scrollHeight;\r
        } else\r
        if( X.Dom.DOM_IE4 ){\r
-               return ( this._rawNode || this._ie4getRawNode() ).scollHeight;\r
+               return ( this._rawNode || this._ie4getRawNode() ).scrollHeight;\r
        } else {\r
                \r
        };\r
index ab224ff..5d9dd5e 100644 (file)
@@ -123,7 +123,7 @@ X.UI.Attr.Support = X.UI.Attr.createAttrDef( false,
 \r
        borderColor       : [ 0x0,            X.UI.Dirty.PAINT,  X.UI.Attr.USER.XNODE,  X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.COLOR   ], // color [ top, right, bottom, left ]\r
        borderStyle       : [ 0,              X.UI.Dirty.PAINT,  X.UI.Attr.USER.XNODE,  X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.LIST, X.UI.Attr.Option.BORDER_STYLE ], // string [ top, right, bottom, left ]\r
-       bgColor           : [ 0xFFFFFF,       X.UI.Dirty.PAINT,  X.UI.Attr.USER.XNODE,  X.UI.Attr.Type.COLOR     ], // color\r
+       bgColor           : [ 0xFFFFFF,       X.UI.Dirty.PAINT,  X.UI.Attr.USER.XNODE,  X.UI.Attr.Type.COLOR     ], // color, none\r
 \r
        fontColor         : [ 0x0,            X.UI.Dirty.PAINT,  X.UI.Attr.USER.XNODE, X.UI.Attr.Type.COLOR     ],\r
        fontFamily        : [ null,           X.UI.Dirty.FONT,   X.UI.Attr.USER.XNODE, X.UI.Attr.Type.FONT_NAME ],\r
index 933ada1..4dcbc02 100644 (file)
@@ -427,8 +427,8 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                        this.xnode\r
                                .css( 'left',        x ? x + 'em' : 0 )\r
                                .css( 'top',         y ? y + 'em' : 0 )\r
-                               .css( 'width',       this.contentWidth  ? this.contentWidth  + 'em' : 0 )\r
-                               .css( 'height',      this.contentHeight ? this.contentHeight + 'em' : 0 )\r
+                               .css( 'width',       this.contentWidth  ? _AbstractUINode.ceil( this.contentWidth  )  + 'em' : 0 )\r
+                               .css( 'height',      this.contentHeight ? _AbstractUINode.ceil( this.contentHeight ) + 'em' : 0 )\r
                                .css( 'padding',     this._createCssText( 'padding' ) )\r
                                .css( 'borderWidth', this._createCssText( 'borderWidth' ) );\r
                },\r
@@ -607,17 +607,18 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                         */\r
                                        if( xnode._xnodes && xnode._xnodes.length ){\r
                                                if( w === X.UI.Attr.AUTO ){\r
-                                                       w = this.contentWidth = xnode.width() / xnode._getCharSize();\r
+                                                       w = this.contentWidth = xnode.css( 'width', 'auto' ).width() / xnode._getCharSize();\r
+                                                       console.log( xnode.width() + ' ' + xnode._getCharSize() + ' > ' + w );\r
                                                        \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', this.contentWidth + 'em' );\r
+                                                       w !== this.contentWidth && xnode.css( 'width', _AbstractUINode.ceil( this.contentWidth ) + 'em' );\r
                                                        \r
                                                        if( h === X.UI.Attr.AUTO ){\r
-                                                               this.contentHeight = h = xnode.height() / xnode._getCharSize();\r
+                                                               this.contentHeight = h = xnode.scrollHeight() / xnode._getCharSize(); // 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
@@ -627,10 +628,10 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                } else\r
                                                if( h === X.UI.Attr.AUTO ){\r
                                                        if( w !== this.lastContentWidth ){\r
-                                                               xnode.css( 'width', w + 'em' );\r
+                                                               xnode.css( 'width', _AbstractUINode.ceil( w ) + 'em' );\r
                                                                \r
                                                                this.lastContentWidth  = w;\r
-                                                               this.contentHeight = h = xnode.height() / xnode._getCharSize();\r
+                                                               this.contentHeight = h = xnode.scrollHeight() / xnode._getCharSize();\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
@@ -851,6 +852,12 @@ _AbstractUINode.finalValue = function( styleValue, styleMin, styleMax, srcValue
                max  = calc( styleMax, srcValue );\r
        return v <= min ? min : max <= v ? max : v;\r
 };\r
+_AbstractUINode.ceil = function( v ){\r
+       if( 0 <= v ){\r
+               return ( v * 10 + 0.999 | 0 ) / 10;\r
+       };\r
+       return ( -v * 10 + 0.999 | 0 ) / -10;\r
+};\r
 \r
 var AbstractUINode = X.Class.create(\r
        'AbstractUINode',\r