OSDN Git Service

Version 0.6.49, fix for xnode.attr(name).
[pettanr/clientJs.git] / 0.6.x / js / dom / 15_XDomStyle.js
index 2d2055d..2dbaa55 100644 (file)
@@ -26,13 +26,6 @@ X.Dom.Style = {
                COMBI             : 2 < 13
        },
        
-       SPECIAL_VALUES : {
-               AUTO : Number.POSITIVE_INFINITY,
-               FULL : X.Dom // something unigue value; 100%
-       },
-       
-       PropNo : {},
-       
        UNIT : {
                'px'   : 0,
                'em'   : 1,
@@ -127,6 +120,7 @@ _GRNERAL
                        SPECIAL_FIX   = me.SPECIAL_FIX,
                        n             = -1,
                        p, name, sp;
+               if( !obj ) return ''; // Opera7.5 未満?
                for( p in obj ){
                        name = uncamelize( p );
                        if( FIX_PROP[ name ] ){
@@ -140,7 +134,7 @@ _GRNERAL
        },
        
        IE_FILTER_FIX :
-               X.UA.IE && X.UA.IE < 9 ?
+               X.UA.IE && X.UA.IE < 9 && !X.UA.MacIE ?
                        {
                                opacity : 1,
                                textShadow : 1
@@ -879,7 +873,7 @@ X.Dom.Style._GET_VALUE_WITH_UNIT = {
        
 X.Dom.Style.SPECIAL_FIX =
        // ~IE8
-       X.UA.IE && X.UA.IE < 9 ?
+       X.UA.IE && X.UA.IE < 9 && !X.UA.MacIE?
                (function( obj ){
                        var test    = X.Dom.Style.SPECIAL_FIX_PROP,
                                filters = [],
@@ -1073,29 +1067,31 @@ X.Dom.Node.prototype.cssText = function( v ){
 };
 
 /*
- * ここでは HTMLElement のチャックは行わない!
+ * ここでは HTMLElement のチ1ェックは行わない!
+ * TODO
+ * body に css attr がセットされた場合には X.Dom.baseFontSize をクリア
  */
 
 X.Dom.Node.prototype._getCharSize =
        window.getComputedStyle ?
                (function(){
-                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        Node.root._updateTimerID && Node.root._startUpdate();
+                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        if( this._fontSize ) return this._fontSize;
                        return this._fontSize = parseFloat( getComputedStyle( this._rawNode, null ).fontSize );
                }) :
        document.defaultView && document.defaultView.getComputedStyle ?
                (function(){
-                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        Node.root._updateTimerID && Node.root._startUpdate();
+                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        if( this._fontSize ) return this._fontSize;
                        return this._fontSize = parseFloat( document.defaultView.getComputedStyle( this._rawNode, null ).fontSize );
                }) :
        X.UA.IE && 5.5 <= X.UA.IE ?
                (function(){
                        var font, vu, v, u, _v;
-                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        Node.root._updateTimerID && Node.root._startUpdate();
+                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        if( this._fontSize ) return this._fontSize;
                        
                        font = this._rawNode.currentStyle.fontSize;
@@ -1125,8 +1121,8 @@ X.Dom.Node.prototype._getCharSize =
        X.Dom.DOM_W3C ?
                (function(){
                        var elm, v;
-                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        Node.root._updateTimerID && Node.root._startUpdate();
+                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        if( this._fontSize ) return this._fontSize;
 
                        this._rawNode.appendChild( elm = document.createElement( 'span' ) );
@@ -1136,11 +1132,11 @@ X.Dom.Node.prototype._getCharSize =
                        this._rawNode.removeChild( elm );
                        return this._fontSize = v;
                }) :
-       X.UA.IE ?
+       X.Dom.DOM_IE4 ?
                (function(){
                        var font, vu, v, u, _v;
-                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        Node.root._updateTimerID && Node.root._startUpdate();
+                       if( this === Node.root && X.Dom.baseFontSize ) return X.Dom.baseFontSize;
                        if( this._fontSize ) return this._fontSize;
                        
                        if( this._css && ( font = this._css.fontSize ) ){
@@ -1224,7 +1220,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){
        
        X.Dom.Style.SPECIAL_FIX_PROP =
                // ~IE8
-               X.UA.IE && X.UA.IE < 9 ?
+               X.UA.IE && X.UA.IE < 9 && !X.UA.MacIE ?
                        {
                                filter          : 1,
                                opacity         : 2//, uinode ChromeNode で行う
@@ -1256,7 +1252,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
        
        for( i = list.length; i; ){
                unit = list[ --i ];
-               output[ unit ] = xnode.css( 'width', 100 + unit ).width() / 100;
+               output[ unit ] = xnode.css( 'width', 10 + unit ).width() / 10;
        };
 
        output = X.Dom.Style._FONT_SIZE_RATIO = {},
@@ -1268,9 +1264,6 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
                output[ size ] = xnode.css( 'fontSize', size ).height();// / base;
        };
        
-       // 以下解決、scroll 中に timer が無視される iOS の問題が原因(dom追加で起こったスクロール?)
-       // ipod touch 1st で必要なんですけど、、、
-       //xnode._rawNode.style.cssText = ''; 
-       xnode.cssText( '' ).empty(); //._startUpdate();
+       xnode.cssText( '' ).empty();
 } );