X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F01_dom%2F15_XDomStyle.js;h=968557b501930b6251704b46242fe802e8dbdcc2;hb=08e72a61fa7363b2fb04f5bc863df082c3067e47;hp=4977e24d0ca1900290c946f8b77e1a34543b802a;hpb=27420d0fbdf56a5cda68f5b10de6565de8a5c010;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/01_dom/15_XDomStyle.js b/0.6.x/js/01_dom/15_XDomStyle.js index 4977e24..968557b 100644 --- a/0.6.x/js/01_dom/15_XDomStyle.js +++ b/0.6.x/js/01_dom/15_XDomStyle.js @@ -119,14 +119,15 @@ _GRNERAL FIX_PROP = me.SPECIAL_FIX_PROP, SPECIAL_FIX = me.SPECIAL_FIX, n = -1, - p, name, sp; + p, v, name, sp; if( !obj ) return ''; // Opera7.5 未満? for( p in obj ){ - name = uncamelize( p ); + // TODO Object が拡張されていると error... + name = uncamelize( VENDER_PREFIX[ p ] || p ); if( FIX_PROP[ name ] ){ - sp = 1; + sp = true; } else { - css[ ++n ] = [ VENDER_PREFIX[ name ] || name, obj[ p ] ].join( ':' ); + css[ ++n ] = [ name, obj[ p ] ].join( ':' ); }; }; sp && ( css[ ++n ] = 'filter:' + SPECIAL_FIX( obj ) ); @@ -1183,44 +1184,51 @@ X.Dom.Node.prototype._getCharSize = X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){ - var testStyle = X.Dom._root.style; + var testStyle = X.Dom._root.style, + temp = testStyle.cssText; X.Dom.Style.VENDER_PREFIX = (function(){ var ret = {}, - vendors = 'webkit,Webkit,Moz,moz,ms,Ms,O,o,khtml,Khtml'.split( ',' ), - searches = + vendors = 'webkit,Webkit,Moz,moz,Ms,ms,O,o,khtml,Khtml'.split( ',' ), + searches = ( 'opacity,boxSizing,' + 'transform,transformOrigin,perspective,' + 'transisiton,transitionDelay,transitionProperty,transitionDuration,transitionTimingFunction,' + - 'userSelect,touchAction,touchCallout,contentZooming,userDrag,tapHighlightColor'.split( ',' ), - vendor, i, search, prop; - // - vendors.unshift( '' ); - - function findVenderPrefix( prop ){ - var v, i = vendors.length; - vendor = null; - for( ; i; ){ - v = vendors[ --i ]; - if( testStyle[ v + prop ] !== undefined ){ - vendor = v; - return v + prop; - }; - }; - }; - + 'userSelect,touchSelect,touchAction,touchCallout,contentZooming,userDrag,tapHighlightColor' ).split( ',' ), + vendor, i, search, prop, j, v; + for( i = searches.length; i; ){ - search = searches[ --i ]; - prop = findVenderPrefix( search ); - if( search === 'transform' ) ret.transVender = vendor; - if( prop ) ret[ search ] = prop; + search = prop = searches[ --i ]; + + if( testStyle[ prop ] === undefined ){ + prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ); + for( j = vendors.length; j; ){ + v = vendors[ --j ]; + if( testStyle[ v + prop ] !== undefined ){ + if( v === 'ms' ) v = 'Ms';// for ie9 + if( v === 'o' ) v = 'O';//for opera12 + ret[ search ] = v + prop; + break; + }; + }; + } else { + ret[ search ] = prop; + }; }; return ret; })(); + testStyle.cssText = 'background:rgba(0,0,0,0.5)'; + + X.Dom.Style.Support = { + rgba : !!testStyle.background + }; + + testStyle.cssText = temp; + X.Dom.Style.SPECIAL_FIX_PROP = // ~IE8 - X.UA.IE && X.UA.IE < 9 && !X.UA.MacIE ? + X.UA.IE < 9 && !X.UA.MacIE ? { filter : 1, opacity : 2//, uinode ChromeNode で行う @@ -1229,7 +1237,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){ //backgroundImage : 5 } : // IE9 - X.UA.IE && 9 <= X.UA.IE && X.UA.IE < 10 ? + 9 <= X.UA.IE && X.UA.IE < 10 ? { filter : 1//, //textShadow : 1