From d5cd3943f09c2e3ca76ddb2959c911e6ff4a38d7 Mon Sep 17 00:00:00 2001 From: itozyun Date: Fri, 11 Dec 2015 00:04:49 +0900 Subject: [PATCH] Verison 0.6.201, X.UI.ScrollBox woring at IE5.5 well. --- 0.6.x/css/xui.css | 3 +-- 0.6.x/js/02_dom/06_XNodeCSS.js | 19 ++++++++++++------- 0.6.x/js/02_dom/10_XNodeAnime.js | 10 ++++++---- 0.6.x/js/02_dom/20_XNode.js | 6 +++++- 0.6.x/js/20_ui/15_ScrollBox.js | 10 +++++----- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/0.6.x/css/xui.css b/0.6.x/css/xui.css index d1f57f2..6f91c92 100644 --- a/0.6.x/css/xui.css +++ b/0.6.x/css/xui.css @@ -76,7 +76,6 @@ /* browser bug fix */ zoom : 1; - word-wrap : break-word; /* IE5.5?5?, Firefox3.5, Chrome1 Opera10.5 Safari1 */ white-space : pre; /* CSS 2.0 */ white-space : pre-wrap; /* CSS 2.1 */ @@ -207,7 +206,7 @@ position : absolute; overflow : hidden; background : #000; - background : rgba(0,0,0,0.5); + /* background : rgba(0,0,0,0.5); IE5.5 ietester でインジケーターに色がつかない、、、*/ } .Root .ScrollBox-IndicatorV { top : 0; diff --git a/0.6.x/js/02_dom/06_XNodeCSS.js b/0.6.x/js/02_dom/06_XNodeCSS.js index a59b708..9bcfdfd 100644 --- a/0.6.x/js/02_dom/06_XNodeCSS.js +++ b/0.6.x/js/02_dom/06_XNodeCSS.js @@ -246,7 +246,7 @@ function X_Node_CSS_parseColor( x ){ function X_Node_CSS_objToCssText( that, skipFilter ){ var obj = that[ '_css' ], - plain = X_EMPTY_OBJECT, + //plain = X_EMPTY_OBJECT, css = [], n = -1, p, v, specialFix, filterFix; @@ -260,7 +260,7 @@ function X_Node_CSS_objToCssText( that, skipFilter ){ for( p in obj ){ // object の拡張に備えて plain なオブジェクトを用意し、そのメンバーと一致するものは処理の対象外。 - if( plain[ p ] ) continue; + //if( plain[ p ] ) continue; v = obj[ p ]; @@ -277,7 +277,7 @@ function X_Node_CSS_objToCssText( that, skipFilter ){ }; if( filterFix ){ - v = X_Node_CSS_objToIEFilterText( that, filterFix ); + v = X_Node_CSS_objToIEFilterText( that, filterFix, css ); if( v ){ css[ ++n ] = 'filter:' + v; }; @@ -314,13 +314,15 @@ X_Node_CSS_FILTER_FIX_PROPS = } : null; -function X_Node_CSS_objToIEFilterText( that, opt_css ){ +function X_Node_CSS_objToIEFilterText( that, opt_css, opt_cssList ){ var obj = opt_css || that[ '_css' ], test = X_Node_CSS_FILTER_FIX_PROPS, + css = {}, filters = [], n = -1, p, id, v, num, ary, params, i, l, dir, afterUpdate, impossible; + for( p in obj ){ if( X_EMPTY_OBJECT[ p ] ) continue; @@ -332,7 +334,10 @@ function X_Node_CSS_objToIEFilterText( that, opt_css ){ filters[ ++n ] = v; break; case 2 : //'opacity' : - if( v !== 1 ) filters[ ++n ] = 'alpha(opacity=' + ( v * 100 | 0 ) +')'; + //if( v === 0 ){ + // opt_cssList && ( opt_cssList[ opt_cssList.length ] = 'visibility:hidden' ); + //} else + if( v < 1 ) filters[ ++n ] = 'alpha(opacity=' + ( v * 100 | 0 ) +')'; break; case 3 : //'boxShadow' : // TODO カンマ区切りの複数指定 @@ -528,11 +533,11 @@ function X_Node_css( nameOrObj /* value */ ){ // setter:object if( X_Type_isObject( nameOrObj ) ){ if( !css ) css = this[ '_css' ] = {}; - plain = X_EMPTY_OBJECT; + //plain = X_EMPTY_OBJECT; camelize = X_Node_CSS_camelize; flags = this[ '_flags' ]; for( p in nameOrObj ){ - if( plain[ p ] ) continue; + //if( plain[ p ] ) continue; name = camelize( p ); v = nameOrObj[ p ]; if( css[ name ] === v ) continue; diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index cbf6a33..5404814 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -51,7 +51,9 @@ function X_Node_animate( start, dest, duration, easing, lazyRelease, option ){ if( !obj ){ this[ '_anime' ] = obj = { - x : 0, y : 0, a : 1, + x : X_NodeAnime_hasTransform ? 0 : NaN, + y : X_NodeAnime_hasTransform ? 0 : NaN, + a : 1, duration : 0 //phase, lazyRelease, easing, follower, releaseNow }; @@ -152,7 +154,7 @@ function X_Node_stop( option ){ case 4 : // 強制停止(GPU転送予約) case 7 : // アニメーション中 if( option & X_NODE_ANIME_RESET ){ - obj.startX = obj.startY = obj.destX = obj.destY = obj.x = obj.y = 0; + obj.startX = obj.startY = obj.destX = obj.destY = obj.x = obj.y = X_NodeAnime_hasTransform ? 0 : NaN; obj.startA = obj.destA = obj.a = 1; }; // TODO 終了値で停止も,,, @@ -276,8 +278,8 @@ function X_NodeAnime_updateAnimations( e ){ if( now < obj.destTime ){ easing = obj.progress = obj.easing.fn( ( now - obj.startTime ) / obj.duration ); X_NodeAnime_updatePosition( xnode, - obj.x = ( obj.destX - obj.startX ) * easing + obj.startX | 0, - obj.y = ( obj.destY - obj.startY ) * easing + obj.startY | 0, + obj.x = ( obj.destX - obj.startX ) * easing + obj.startX, + obj.y = ( obj.destY - obj.startY ) * easing + obj.startY, obj.a = ( obj.destA - obj.startA ) * easing + obj.startA, true ); c = true; break; diff --git a/0.6.x/js/02_dom/20_XNode.js b/0.6.x/js/02_dom/20_XNode.js index ab4e26b..1656421 100644 --- a/0.6.x/js/02_dom/20_XNode.js +++ b/0.6.x/js/02_dom/20_XNode.js @@ -1577,6 +1577,7 @@ var X_Node__commitUpdate = that[ '_flags' ] |= X_NodeFlags_ACTUAL_LISTENING; }; + // ie8 では子要素に opacity が反映されないため、親要素の opacity を積算する ie8opacity = ie8opacity * ( that[ '_css' ] && 0 <= that[ '_css' ].opacity ? that[ '_css' ].opacity : 1 ); // 8. 更新の適用 @@ -1718,7 +1719,8 @@ var X_Node__commitUpdate = var X_Node__updateRawNode = X_UA_DOM.W3C ? ( function( that, elm, ie8opacity, accumulatedFlags ){ - var attrs, rename, k, v, memory, f; + var // flags = that[ '_flags' ], + attrs, rename, k, v, memory, f; // textNode if( !that[ '_tag' ] ){ @@ -1726,6 +1728,7 @@ var X_Node__updateRawNode = that[ '_flags' ] &= X_Node_BitMask_RESET_DIRTY; return; }; + // id if( that[ '_flags' ] & X_NodeFlags_DIRTY_ID ){ that[ '_id' ] ? @@ -1792,6 +1795,7 @@ var X_Node__updateRawNode = delete that[ '_newAttrs' ]; }; + if( accumulatedFlags & X_NodeFlags_IE8_OPACITY_FIX ){ memory = that[ '_css' ] && that[ '_css' ].opacity; if( f = true ){ diff --git a/0.6.x/js/20_ui/15_ScrollBox.js b/0.6.x/js/20_ui/15_ScrollBox.js index 1770704..fd8946b 100644 --- a/0.6.x/js/20_ui/15_ScrollBox.js +++ b/0.6.x/js/20_ui/15_ScrollBox.js @@ -26,7 +26,7 @@ function XUI_ScrollBox_start( scrollBox ){ scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorV ); XUI_ScrollBox_indicatorV[ 'animate' ]( { opacity : 0 }, - { opacity : 1 }, + { opacity : 0.5 }, 900, 'circular', 300 ); scrollBox @@ -46,7 +46,7 @@ function XUI_ScrollBox_start( scrollBox ){ scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorH ); XUI_ScrollBox_indicatorH[ 'animate' ]( { opacity : 0 }, - { opacity : 1 }, + { opacity : 0.5 }, 900, 'circular', 300 ); scrollBox @@ -66,7 +66,7 @@ function XUI_ScrollBox_indicatorHandleEvent( e ){ case XUI_Event.SCROLL_END : console.log( '-fadeout-' ); this[ 'animate' ]( - { opacity : 1 }, + { opacity : 0.5 }, { opacity : 0 }, 900, 'circular', 300 ); @@ -326,7 +326,7 @@ function X_UI_ScrollBox_translate( that, x, y, opt_time, opt_easing, opt_release }, { y : scrollBoxH * y / that.scrollYMax, - opacity : 1 + opacity : 0.5 }, opt_time, opt_easing, opt_release ); @@ -344,7 +344,7 @@ function X_UI_ScrollBox_translate( that, x, y, opt_time, opt_easing, opt_release }, { x : scrollBoxW * x / that.scrollXMax, - opacity : 1 + opacity : 0.5 }, opt_time, opt_easing, opt_release ); -- 2.11.0