From dc5a75639232882249108b4f708916e9690e42b3 Mon Sep 17 00:00:00 2001 From: itozyun Date: Fri, 16 Jan 2015 21:41:11 +0900 Subject: [PATCH] Version 0.6.121, iScroll5 is working on iPhone touch 1G, update X.Audio. --- 0.6.x/js/01_core/02_XUA.js | 6 +- 0.6.x/js/01_core/04_XObject.js | 14 +- 0.6.x/js/01_core/06_XURL.js | 15 +- 0.6.x/js/01_core/12_XEvent.js | 24 ++- 0.6.x/js/01_core/13_XEventDispatcher.js | 19 ++- 0.6.x/js/01_core/14_XTimer.js | 8 +- 0.6.x/js/01_core/16_XViewPort.js | 4 +- 0.6.x/js/02_dom/02_XNode.js | 101 ++++++++----- 0.6.x/js/02_dom/03_XDomEvent.js | 8 - 0.6.x/js/02_dom/04_XBoxModel.js | 27 ++-- 0.6.x/js/02_dom/05_XNodeAttr.js | 38 +++-- 0.6.x/js/02_dom/06_XNodeCSS.js | 14 +- 0.6.x/js/02_dom/07_XNodeList.js | 4 +- 0.6.x/js/02_dom/10_XNodeAnime.js | 177 +++++++++++++++------- 0.6.x/js/05_util/01_XNinjaIframe.js | 2 +- 0.6.x/js/06_net/00_XNet.js | 3 + 0.6.x/js/06_net/01_XNetXHR.js | 1 + 0.6.x/js/07_audio/00_XAudio.js | 186 +++++++++++++---------- 0.6.x/js/07_audio/01_XWebAudio.js | 30 ++-- 0.6.x/js/07_audio/02_XHTMLAudio.js | 244 +++++++++++++++++++----------- 0.6.x/js/07_audio/03_XSilverlightAudio.js | 70 +++++---- 0.6.x/js/07_audio/10_XAudioSprite.js | 81 +++++----- 0.6.x/js/20_ui/02_XUI_Attr.js | 3 + 0.6.x/js/20_ui/04_XUI_Event.js | 1 + 0.6.x/js/20_ui/06_AbstractUINode.js | 1 + 0.6.x/js/20_ui/08_Box.js | 1 + 0.6.x/js/20_ui/15_ScrollBox.js | 2 +- 27 files changed, 675 insertions(+), 409 deletions(-) diff --git a/0.6.x/js/01_core/02_XUA.js b/0.6.x/js/01_core/02_XUA.js index 0f0209e..c0a1d4f 100644 --- a/0.6.x/js/01_core/02_XUA.js +++ b/0.6.x/js/01_core/02_XUA.js @@ -82,7 +82,7 @@ var X_UA = (function( n, undefined ){ acme[ sys] = true; }; } else - if( sys.indexOf( 'Linux' ) + 1 ){ + if( ( sys.indexOf( 'Linux' ) + 1 ) || ( sys.indexOf( 'Android' ) + 1 ) ){ console.log( 'Linux' ); acme.Linux = true; @@ -142,7 +142,7 @@ Sleipnir Mobile Android 2.1以上 Fenrir acme.IE9 = 9 <= acme.IE && acme.IE < 10; acme.MacIE = acme.Mac; acme.IEMobile = dua.toLowerCase().indexOf( 'iemobile' ) !== -1 || acme.WinCE; - acme.WinPhone = dua.toLowerCase().indexOf( 'windows phone' ) !== -1; + acme.WinPhone = dua.toLowerCase().indexOf( 'windows phone' ) !== -1 || 0 < dav.indexOf( 'ZuneWP' ); // ZuneWP は IEM のデスクトップモードで使用 console.log( '>> IE : ' + acme.IE + ' ActiveX : ' + acme.ActiveX ); // TODO XBox360, XBox1, Modern or Desktop, Standalone return acme; @@ -164,6 +164,8 @@ Sleipnir Mobile Android 2.1以上 Fenrir // http://www.useragentstring.com/pages/Playstation%203/ // Mozilla/5.0 (PLAYSTATION 3; 3.55) // Mozilla/4.0 (PS3 (PlayStation 3); 1.00) + // https://github.com/Famous/famous/blob/1a02c8084587d80519ea4bd3b55649ab32ee2e65/examples/assets/lib/require.js + // PS3 ブラウザのロードイベントについて if( ( i = dua.toUpperCase().indexOf( 'PLAYSTATION 3' ) !== -1 ) ){ acme.PS3 = parseFloat( dua.substr( i + 15 ) ) || 0.1; console.log( '>> PS3 : ' + acme.PS3 ); diff --git a/0.6.x/js/01_core/04_XObject.js b/0.6.x/js/01_core/04_XObject.js index be7f595..e9d96df 100644 --- a/0.6.x/js/01_core/04_XObject.js +++ b/0.6.x/js/01_core/04_XObject.js @@ -31,6 +31,7 @@ function X_Object_clone( src ){ if( typeof src !== 'object' ) return src; ret = {}; for( k in src ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; ret[ k ] = src[ k ]; }; return ret; @@ -40,6 +41,7 @@ function X_Object_override( target, src ){ var k; if( !X.Type.isObject( src ) ) return target; for( k in src ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; target[ k ] = src[ k ]; }; return target; @@ -50,7 +52,7 @@ function X_Object_deepCopy( src ){ }; function X_Object_deepCopy_( src, objSrc, objCopy, n ) { - var ret, i, key; + var ret, i, k; if( !src ){ // 0, "", null, undefined, NaN, false return src; } else @@ -69,8 +71,9 @@ function X_Object_deepCopy_( src, objSrc, objCopy, n ) { // string, number, true return src; }; - for( key in src ){ - ret[ key ] = clone( src[ key ], objSrc, objCopy, n ); + for( k in src ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; + ret[ k ] = clone( src[ k ], objSrc, objCopy, n ); }; return ret; }; @@ -86,8 +89,9 @@ function X_Object_cloneArray( ary ){ }; function X_Object_isEmpty( v ){ - var p; - for( p in v ){ + var k; + for( k in v ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; return false;//if( v.hasOwnProperty && v.hasOwnProperty( p ) ) return false; ie4 で動かない、、、 }; return true; diff --git a/0.6.x/js/01_core/06_XURL.js b/0.6.x/js/01_core/06_XURL.js index 7a23619..8bd31bc 100644 --- a/0.6.x/js/01_core/06_XURL.js +++ b/0.6.x/js/01_core/06_XURL.js @@ -34,13 +34,9 @@ var X_URL_BASE_URL = ( function( parts ){ obj[ decodeURIComponent( pair.substr( 0, p ) ) ] = X_String_parse( decodeURIComponent( pair.substr( p + 1 ) ) ); }; }; -/* - for( p in obj ){ - console.log( p + ' = ' + obj[ p ] ); - }; */ return obj; - })( location.search ); + } )( location.search ); // ------------------------------------------------------------------------- // // --- interface ----------------------------------------------------------- // @@ -59,7 +55,9 @@ X.URL = { isSameDomain : X_URL_isSameDomain, - cleanup : X_URL_cleanup + cleanup : X_URL_cleanup, + + getEXT : X_URL_getEXT }; // ------------------------------------------------------------------------- // @@ -103,3 +101,8 @@ function X_URL_cleanup( path ){ return path.split( '?' )[ 0 ].split( '#' )[ 0 ]; }; +function X_URL_getEXT( path ){ + path = X_URL_cleanup( path ).split( '.' ); + return path.length ? path.pop() : ''; +}; + diff --git a/0.6.x/js/01_core/12_XEvent.js b/0.6.x/js/01_core/12_XEvent.js index 1bcb3f9..6c2a208 100644 --- a/0.6.x/js/01_core/12_XEvent.js +++ b/0.6.x/js/01_core/12_XEvent.js @@ -90,17 +90,35 @@ X.Event = { UNLOAD : 26, BACKEND_READY : 27, - BACKEND_NOT_FOUND : 28, + BACKEND_NONE : 28, BACKEND_RESEARCH : 29, - BACKEND_CHANGED : 30 + BACKEND_CHANGED : 30, + + ANIME_BEFORE_START : 31, + ANIME_START : 32, + ANIME : 33, + ANIME_END : 34, + ANIME_BEFORE_STOP : 35, // xnode.stop() のみ、指定時間による停止では呼ばれない + ANIME_STOP : 36, + + GPU_RELEASED : 37, + + MEDIA_PLAYING : 38, + MEDIA_BEFORE_LOOP : 39, // cancelable + MEDIA_LOOPED : 40, + MEDIA_PAUSED : 41, + MEDIA_ENDED : 42, + MEDIA_WAITING : 43, + MEDIA_SEEKING : 44 }; -X_Event_last = 30; +X_Event_last = 44; X_TEMP.onSystemReady.push( function(){ var k, name, i; for( k in X_Event_Rename ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; name = X_Event_Rename[ k ]; if( X.Type.isArray( name ) ){ for( i = name.length; i; ){ diff --git a/0.6.x/js/01_core/13_XEventDispatcher.js b/0.6.x/js/01_core/13_XEventDispatcher.js index b3763fc..25c2d11 100644 --- a/0.6.x/js/01_core/13_XEventDispatcher.js +++ b/0.6.x/js/01_core/13_XEventDispatcher.js @@ -120,6 +120,14 @@ X.EventDispatcher = * @type {boolean} */ '_killReserved' : false, + + /** + * asyncDispatch 中に kill が呼ばれた場合に、X.EventDispatcher インスタンスの削除を最後のタイマーの発火後にずらすために立てるフラグ。 + * TODO asyncDispatch の解除はどうする? + * @private + * @type {boolean} + */ + '_lastLazyID' : false, /** * X.EventDispatcher のコンストラクタの実体。 @@ -229,7 +237,7 @@ X.EventDispatcher = e = delay; delay = 0; }; - return X.Timer.add( delay, 1, this, this.dispatch, [ e ] ); + return this[ '_lastLazyID' ] = X.Timer.add( delay, 1, this, X_EventDispatcher_dispatch, [ e ] ); } } ); @@ -297,6 +305,11 @@ function X_EventDispatcher_dispatch( e ){ }; if( ( --this._dispatching ) === 0 ){ + + if( this[ '_lastLazyID' ] && X_Timer_currentUID === this[ '_lastLazyID' ] ){ + delete this[ '_lastLazyID' ]; + }; + // dispatch 中に unlisten された要素の削除 unlistens = this._unlistens; delete this._dispatching; @@ -304,6 +317,7 @@ function X_EventDispatcher_dispatch( e ){ // _unlistens に入っている callbackHash は、lock をクリアしている X_EventDispatcher_unlock = true; for( type in unlistens ){ + //if( X_EMPTY_OBJECT[ type ] ) continue; list = unlistens[ type ]; for( i = list.length; i; ){ this.unlisten( type, list[ --i ] ); @@ -419,6 +433,7 @@ function X_EventDispatcher_unlisten( opt_type, opt_arg1, opt_arg2, opt_arg3 ){ if( opt_type === undefined ){ // 全て削除 for( opt_type in list ){ + //if( X_EMPTY_OBJECT[ opt_type ] ) continue; _list = list[ opt_type ]; for( i = _list.length; i; ){ this.unlisten( opt_type, _list[ --i ] ); // override されていることがあるので、必ず unlisten を使用 @@ -521,7 +536,6 @@ var X_EventDispatcher_actualAddEvent = } else { console.log( 'event > ' + type ); that._handleEvent || ( that._handleEvent = X_Callback_create( that, X_EventDispatcher_actualHandleEvent ) ); - if( raw.addEventListener ){ raw.addEventListener( type, that._handleEvent, false ); @@ -754,6 +768,7 @@ function X_EventDispatcher_toggleAllEvents( that, add ){ type; if( !list || !raw ) return; for( type in list ){ + //if( X_EMPTY_OBJECT[ type ] ) continue; // 数字イベントの除外 if( '' + parseFloat( type ) !== type ){ // TODO type rename はここ diff --git a/0.6.x/js/01_core/14_XTimer.js b/0.6.x/js/01_core/14_XTimer.js index 88c6a84..9dbfe40 100644 --- a/0.6.x/js/01_core/14_XTimer.js +++ b/0.6.x/js/01_core/14_XTimer.js @@ -67,6 +67,7 @@ var X_Timer_now = Date.now || function(){ return +new Date; }, X_Timer_busyTimeout = false, X_Timer_timeStamp = 0, // setTimeout に登録した時間 X_Timer_waitTime = 0, // 待ち時間 + X_Timer_currentUID = 0, // 現在発火中の uid X_Timer_REQ_FRAME_LIST = [], X_Timer_requestID = 0, @@ -228,8 +229,9 @@ function X_Timer_onTimeout(){ }; c = q.count; + X_Timer_currentUID = q.uid; + if( q.k ){ - //q.a = []; r = X_Callback_proxyCallback( q, [] ); } else { r = q.f(); @@ -252,12 +254,13 @@ function X_Timer_onTimeout(){ if( 1 < c ) --q.count; q.last = q.time; }; - X_Timer_timerId = 0; + X_Timer_timerId = X_Timer_currentUID = 0; X_Timer_busyTimeout = false; if( X_Timer_removal ){ X_Timer_skipUpdate = true; for( uid in X_Timer_removal ){ + //if( X_EMPTY_OBJECT[ uid ] ) continue; X.Timer.remove( uid ); }; X_Timer_skipUpdate = false; @@ -344,6 +347,7 @@ function X_Timer_onEnterFrame( time ){ X_Timer_busyOnFrame = false; if( X_Timer_removal ){ for( uid in X_Timer_removal ){ + //if( X_EMPTY_OBJECT[ uid ] ) continue; X.Timer.cancelFrame( X_Timer_removal[ uid ] ); }; X_Timer_removal = null; diff --git a/0.6.x/js/01_core/16_XViewPort.js b/0.6.x/js/01_core/16_XViewPort.js index 8b079cc..5627a85 100644 --- a/0.6.x/js/01_core/16_XViewPort.js +++ b/0.6.x/js/01_core/16_XViewPort.js @@ -64,7 +64,7 @@ X_ViewPort = X_Class_override( case 'focus' : if( !X_ViewPort_active ){ X_ViewPort_active = true; - X_ViewPort.dispatch( X.Event.VIEW_ACTIVATE ); + X_ViewPort.dispatch( X.Event.VIEW_ACTIVATE ); }; break; @@ -72,7 +72,7 @@ X_ViewPort = X_Class_override( case 'blur' : if( X_ViewPort_active ){ X_ViewPort_active = false; - X_ViewPort.dispatch( X.Event.VIEW_DEACTIVATE ); + X_ViewPort.dispatch( X.Event.VIEW_DEACTIVATE ); }; break; }; diff --git a/0.6.x/js/02_dom/02_XNode.js b/0.6.x/js/02_dom/02_XNode.js index 9c44e1d..b7bbf6f 100644 --- a/0.6.x/js/02_dom/02_XNode.js +++ b/0.6.x/js/02_dom/02_XNode.js @@ -172,6 +172,11 @@ var X_Node_CHASHE[ this._uid = uid ] = this; }, + // attr + // css, cssText + // find + // animate, stop + create : X_Node_create, createAt : X_Node_createAt, @@ -654,7 +659,7 @@ function X_Node_destroy( isChild ){ */ function X_Node_contains( v ){ var elm, type, xnodes, i; - if( !v || this._xnodeType !== 1 ) return false; + if( !v || this._xnodeType !== 1 || this === v ) return false; // contains ie4+ if( ( elm = this._rawObject || X_UA_DOM.IE4 && X_Node__ie4getRawNode( this ) ) && document.contains && ( type = X_Node_getType( v ) ) && ( type === X_Node_TYPE.RAW_HTML || type === X_Node_TYPE.RAW_TEXT ) ){ return elm.contains( v ); @@ -665,7 +670,7 @@ function X_Node_contains( v ){ xnodes = this._xnodes; if( !xnodes || !xnodes.length ) return false; if( xnodes.indexOf( v ) !== -1 ) return true; // fast - if( elm === v.parentNode ) return false; + if( elm === v.parentNode ) return true; for( i = xnodes.length; i; ){ if( xnodes[ --i ].contains( v ) ) return true; }; @@ -794,8 +799,9 @@ function X_Node_hasClass( v ){ /* -------------------------------------- * html, text + * + * outerHTML が欲しい場合は、xnode.attr('outerHTML') とできる。 */ - function X_Node_html( html ){ var _ = '', q = '"', xnodes, n, i, l; // setter @@ -1114,20 +1120,6 @@ var X_Node__updateRawNode = }; }; - // style - // TODO display:none の場合、更新をスキップ - if( that._dirty & X_Node_Dirty.CSS ){ - if( that._cssText !== null || ( that._cssText = X_Node_CSS_objToCssText( that ) ) ){ - X_UA.Opera78 || X_UA.NN6 ? - elm.setAttribute( 'style', that._cssText ) : // opera8用 - ( elm.style.cssText = that._cssText ); - } else { - elm.style.cssText = ''; // IE5.5以下 Safari3.2 で必要 - elm.removeAttribute( 'style' ); - delete that._cssText; - }; - }; - if( that._dirty & X_Node_Dirty.IE_FILTER ){ elm.style.filter = X_Node_CSS_objToIEFilterText( that );; }; @@ -1136,24 +1128,45 @@ var X_Node__updateRawNode = // TODO display:none の場合、更新をスキップ if( that._dirty & X_Node_Dirty.ATTR && ( attrs = that._newAttrs || that._attrs ) ){ rename = X_Node_Attr_renameForDOM; + + // IETester 5.5 ではエラーが出なかった.MultipulIE5.5 ではエラーが出たので + if( !X_UA.MacIE && X_UA.IE5x && that._tag === 'TEXTAREA' && ( ( v = attrs[ 'value' ] ) || X_Object_inObject( 'value', attrs ) ) ){ + delete attrs[ 'value' ]; + elm.firstChild ? + ( elm.firstChild.data = v || '' ) : + elm.appendChild( document.createTextNode( v || '' ) ); + }; + // http://outcloud.blogspot.jp/2010/09/iframe.html + // この問題は firefox3.6 で確認 + if( X_UA.Gecko && that._tag === 'IFRAME' && ( ( v = attrs[ 'src' ] ) || X_Object_inObject( 'src', attrs ) ) ){ + elm.contentWindow.location.replace = elm.src = v || ''; + delete attrs[ 'src' ]; + }; + for( k in attrs ){ - if( !X_UA.MacIE && ( X_UA.IE5 || X_UA.IE55 ) ){ // IETester 5.5 ではエラーが出なかった.MultipulIE5.5 ではエラーが出たので - if( that._tag === 'TEXTAREA' && k === 'value' ){ - elm.firstChild ? - ( elm.firstChild.data = attrs[ k ] ) : - elm.appendChild( document.createTextNode( attrs[ k ] ) ); - continue; - }; - }; - // TODO IE では input, なぜか buttonも、type の変更が出来ない、object も 同値で置き換えようとしても不可 + //if( X_EMPTY_OBJECT[ k ] ) continue; + // TODO IE では input, なぜか button, object も type の変更が出来ない、同値で置き換えようとしても不可 ( v = attrs[ k ] ) === undefined ? elm.removeAttribute( rename[ k ] || k ) : - ( elm[ rename[ k ] || k ] = X_Node_Attr_noValue[ k ] ? k : v ); - + ( elm[ rename[ k ] || k ] = X_Node_Attr_noValue[ k ] ? k : v ); }; delete that._newAttrs; }; + // style + // TODO display:none の場合、更新をスキップ + if( that._dirty & X_Node_Dirty.CSS ){ + if( that._cssText !== null || ( that._cssText = X_Node_CSS_objToCssText( that ) ) ){ + X_UA.Opera78 || X_UA.NN6 ? + elm.setAttribute( 'style', that._cssText ) : // opera8用 + ( elm.style.cssText = that._cssText ); + } else { + elm.style.cssText = ''; // IE5.5以下 Safari3.2 で必要 + elm.removeAttribute( 'style' ); + delete that._cssText; + }; + }; + delete that._dirty; }) : X_UA_DOM.IE4 ? @@ -1197,6 +1210,7 @@ var X_Node__updateRawNode = if( that._dirty & X_Node_Dirty.ATTR && ( attrs = that._newAttrs || that._attrs ) ){ rename = X_Node_Attr_renameForDOM; for( k in attrs ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; ( v = attrs[ k ] ) === undefined ? elm.removeAttribute( rename[ k ] || k ) : //that._tag === 'TEXTAREA' && k === 'value' ? @@ -1313,7 +1327,7 @@ var X_Node__actualCreate = var X_Node__afterActualCreate = X_UA_DOM.W3C ? (function( that ){ - var elm = that._rawObject, xnodes, l, attrs, k, i; + var elm = that._rawObject, xnodes, l, i; that._root = that.parent._root; @@ -1326,11 +1340,17 @@ var X_Node__afterActualCreate = l = xnodes && xnodes.length; if( that._isNew ){ - if( !X_Node_useDocumentFragment && l ){// docFrg が使えない場合、doc 追加後に子を追加 + if( !X_Node_useDocumentFragment /*&& l*/ ){// docFrg が使えない場合、doc 追加後に子を追加 for( i = 0; i < l; ++i ){ elm.appendChild( X_Node__actualCreate( xnodes[ i ], true ) ); + X_Node__afterActualCreate( xnodes[ i ] ); + }; + } else { + for( i = 0; i < l; ++i ){ + X_Node__afterActualCreate( xnodes[ i ] ); }; }; + if( X_Node_strictElmCreation ){ if( that._dirty & X_Node_Dirty.IE_FILTER ){ elm.style.filter = X_Node_CSS_objToIEFilterText( that );; @@ -1341,16 +1361,27 @@ var X_Node__afterActualCreate = that._newAttrs = that._attrs; that._dirty = X_Node_Dirty.ID | X_Node_Dirty.CLASSNAME | X_Node_Dirty.CSS | X_Node_Dirty.ATTR | X_Node_Dirty.IE_FILTER; X_Node__updateRawNode( that, elm ); + + // http://outcloud.blogspot.jp/2010/09/iframe.html + // この問題は firefox3.6 で確認 + if( X_UA.Gecko && that._tag === 'IFRAME' ){ + if( !that._attrs[ 'src' ] ){ + elm.contentWindow.location.replace = elm.src = 'about:blank'; + }; + }; }; delete that._isNew; } else { + + for( i = 0; i < l; ++i ){ + X_Node__afterActualCreate( xnodes[ i ] ); + }; + // 親要素の updateRawNode 前に子要素の updateRawNode を行う + // 親要素が GPU レイヤーに転送されるケースがあるので、先に子要素の変更を済ませる that._dirty && X_Node__updateRawNode( that, elm ); - }; - - for( i = 0; i < l; ++i ){ - X_Node__afterActualCreate( xnodes[ i ] ); - }; + }; + // src の onload があるので先ではないか? // TODO ie の str から要素を作る場合、srcだけ イベント設定後ではないか? X_EventDispatcher_toggleAllEvents( that, true );// イベントの復帰 diff --git a/0.6.x/js/02_dom/03_XDomEvent.js b/0.6.x/js/02_dom/03_XDomEvent.js index 0700cec..8708746 100644 --- a/0.6.x/js/02_dom/03_XDomEvent.js +++ b/0.6.x/js/02_dom/03_XDomEvent.js @@ -342,14 +342,6 @@ if( !X_UA.IE || 9 <= X_UA.IE ){ }; }; -X.Dom.Event.ANIME_BEFORE_START = ++X_Event_last; -X.Dom.Event.ANIME_START = ++X_Event_last; -X.Dom.Event.ANIME = ++X_Event_last; -X.Dom.Event.ANIME_END = ++X_Event_last; -X.Dom.Event.ANIME_BEFORE_STOP = ++X_Event_last; // xnode.stop() のみ、指定時間による停止では呼ばれない -X.Dom.Event.ANIME_STOP = ++X_Event_last; - - // TODO load -> readystatechange this.readyState === "loaded" || this.readyState === "complete" /* X.Dom.Event._LOAD_FIX_TAGS = { diff --git a/0.6.x/js/02_dom/04_XBoxModel.js b/0.6.x/js/02_dom/04_XBoxModel.js index 0a5c342..edddde6 100644 --- a/0.6.x/js/02_dom/04_XBoxModel.js +++ b/0.6.x/js/02_dom/04_XBoxModel.js @@ -323,13 +323,6 @@ Node.prototype.offset = function( /* xnodeParent */ ){ }; return X_Node_getPosition( elm ); - - while( elm && elm !== document.body ){ - x += elm.offsetLeft; - y += elm.offsetTop; - elm = elm.offsetParent || elm.parentNode || elm.parentElement; - }; - return { x : x, y : y }; }; // エレメントの座標取得 ~スクロール要素~ @@ -350,16 +343,16 @@ var X_Node_getPosition = } : X.UA.Opera < 10 ? function( el ){ - var ex = 0; - var ey = 0; - do - { - ex += el.offsetLeft; - ey += el.offsetTop; - } - while( el = el.offsetParent ); - // - return {x:ex,y:ey}; + var ex = 0; + var ey = 0; + do + { + ex += el.offsetLeft; + ey += el.offsetTop; + } + while( el = el.offsetParent ); + // + return {x:ex,y:ey}; } : function(target) { diff --git a/0.6.x/js/02_dom/05_XNodeAttr.js b/0.6.x/js/02_dom/05_XNodeAttr.js index 3fc530c..8b1237a 100644 --- a/0.6.x/js/02_dom/05_XNodeAttr.js +++ b/0.6.x/js/02_dom/05_XNodeAttr.js @@ -68,22 +68,24 @@ X_Node_Attr_renameForTag = {}; // 先頭にスペース function X_Node_Attr_objToAttrText( obj ){ var noValue = X_Node_Attr_noValue, - attrs = [ '' ], n = 0, p, v; + attrs = [ '' ], n = 0, k, v; if( !obj ) return ''; // Opera7 - for( p in obj ){ - v = obj[ p ]; - if( p === 'value' ){ + for( k in obj ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; + v = obj[ k ]; + if( k === 'value' ){ v = v.split( '"' ).join( '"' ).split( '>' ).join( '>' ).split( '<' ).join( '<' ); }; - attrs[ ++n ] = noValue[ p ] ? p : [ p, '="', v, '"' ].join( '' ); + attrs[ ++n ] = noValue[ k ] ? k : [ k, '="', v, '"' ].join( '' ); }; return 0 < n ? attrs.join( ' ' ) : ''; }; (function( renameForDOM, renameForTag ){ - var name, i; - for( name in renameForDOM ){ - renameForTag[ renameForDOM[ name ] ] = name; + var k, i; + for( k in renameForDOM ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; + renameForTag[ renameForDOM[ k ] ] = k; }; })( X_Node_Attr_renameForDOM, X_Node_Attr_renameForTag ); @@ -91,14 +93,13 @@ function X_Node_Attr_objToAttrText( obj ){ /* -------------------------------------- * attribute - * X_Node_Attr_toIndex に定義されている 属性の場合 * * http://nanto.asablo.jp/blog/2005/10/29/123294 * className, onclick等 はここで設定しない * */ Node.prototype.attr = function( nameOrObj /* v */ ){ - var attrs = this._attrs, newAttrs, f, p, elm, v; + var attrs = this._attrs, newAttrs, f, k, elm, v; if( this._xnodeType !== 1 ) return this; @@ -106,13 +107,14 @@ Node.prototype.attr = function( nameOrObj /* v */ ){ attrs || ( attrs = this._attrs = {} ); newAttrs = this._newAttrs || ( this._newAttrs = {} ); - for( p in nameOrObj ){ - if( X_Node_Attr_setAttr( this, attrs, newAttrs, p, nameOrObj[ p ] ) === true ) f = true; + for( k in nameOrObj ){ + //if( X_EMPTY_OBJECT[ k ] ) continue; + if( X_Node_Attr_setAttr( this, attrs, newAttrs, k, nameOrObj[ k ] ) === true ) f = true; }; if( f ){ this._attrText = false; this._dirty |= X_Node_Dirty.ATTR; - this._root && X_Node_reserveUpdate(); + this._root && X_Node_reserveUpdate(); }; return this; } else @@ -142,12 +144,19 @@ Node.prototype.attr = function( nameOrObj /* v */ ){ case 'text' : return this.text(); case 'html' : + case 'innerHTML' : return this.html(); + case 'outerHTML' : + X_Node_outerXNode = this; + v = this.html(); + X_Node_outerXNode = null; + return v; + case 'selected' : // kquery.js : safariのバグ対策 // if ($.browser.safari && key === "selected" && tmp) tmp.selectedIndex; // 親ノードの selectedIndex の getter を呼んでおくと値が正しくなる、ということ?( by itozyun ) - if( X_UA.WebKit ) this._rawObject.parentNode.selectedIndex; + if( X_UA.WebKit ) this._rawObject.parentNode && this._rawObject.parentNode.selectedIndex; case 'value' : if( this._tag === 'INPUT' && X_Node_Attr_STATIC_VALUE_TYPES[ attrs[ 'type' ] ] ) break; case 'checked' : @@ -174,6 +183,7 @@ function X_Node_Attr_setAttr( that, attrs, newAttrs, name, v ){ return; case 'id' : v = ( v !== 'ie4uid' + that._uid ) ? v : undefined; + // TODO unique の check if( v !== that._id ){ that._id = v; that._dirty |= X_Node_Dirty.ID; diff --git a/0.6.x/js/02_dom/06_XNodeCSS.js b/0.6.x/js/02_dom/06_XNodeCSS.js index f898b74..13e5450 100644 --- a/0.6.x/js/02_dom/06_XNodeCSS.js +++ b/0.6.x/js/02_dom/06_XNodeCSS.js @@ -254,10 +254,10 @@ function X_Node_CSS_objToCssText( that ){ if( !obj ) return ''; // Opera7.5 未満? for( p in obj ){ - v = obj[ p ]; - // object の拡張に備えて plain なオブジェクトを用意し、そのメンバーと一致するものは処理の対象外。 - if( plain[ p ] === v ) continue; + if( plain[ p ] ) continue; + + v = obj[ p ]; p = X_Node_CSS_uncamelize( X_Node_CSS_VENDER_PREFIX[ p ] || p ); @@ -300,6 +300,8 @@ function X_Node_CSS_objToIEFilterText( that, opt_css ){ p, id, v, num, ary, params, i, l, dir, afterUpdate, impossible; for( p in obj ){ + if( X_EMPTY_OBJECT[ p ] ) continue; + if( !( id = test[ p ] ) ) continue; v = obj[ p ]; @@ -492,7 +494,7 @@ Node.prototype.css = function( nameOrObj /* orUnitID, valuOrUnitOrName */ ){ camelize = X_Node_CSS_camelize; ieFix = X_Node_CSS_FILTER_FIX_PROPS; for( p in nameOrObj ){ - if( plain[ p ] === nameOrObj[ p ] ) continue; + if( plain[ p ] ) continue; if( ieFix && ieFix[ p ] ){ this._dirty |= X_Node_Dirty.IE_FILTER; @@ -701,13 +703,13 @@ X.CSS = { */ (function(){ - var testStyle = X_UA.IE4 ? {} : ( document.documentElement || document.createElement( 'div' ) ).style, + var testStyle = X_UA.IE4 ? {} : ( /*document.documentElement ||*/ document.createElement( 'div' ) ).style, temp = testStyle.cssText, vendors = 'webkit,Webkit,Moz,moz,Ms,ms,O,o,khtml,Khtml'.split( ',' ), searches = ( 'opacity,boxSizing,boxShadow,' + 'transform,transformOrigin,perspective,' + - 'transisiton,transitionDelay,transitionProperty,transitionDuration,transitionTimingFunction,backfaceVisibility,willChange,' + + 'transisiton,transitionDelay,transitionProperty,transitionDuration,transitionTimingFunction,backfaceVisibility,willChange,filter,' + 'userSelect,touchSelect,touchAction,touchCallout,contentZooming,userDrag,tapHighlightColor' ).split( ',' ), vendor, i, search, prop, j, v; diff --git a/0.6.x/js/02_dom/07_XNodeList.js b/0.6.x/js/02_dom/07_XNodeList.js index f1a073a..73f3faf 100644 --- a/0.6.x/js/02_dom/07_XNodeList.js +++ b/0.6.x/js/02_dom/07_XNodeList.js @@ -52,11 +52,12 @@ X_NodeList.prototype.each = function( func /* opt_args... */ ){ /* -------------------------------------- * Fuction Base, multi, getter, setter, */ -X_ViewPort.listenOnce( X_TEMP.SYSTEM_EVENT_PRE_INIT, function(){ +X_TEMP.onSystemReady.push( function( sys ){ var target = X_NodeList.prototype, src = Node.prototype, p, v, multi; for( p in src ){ + //if( X_EMPTY_OBJECT[ p ] ) continue; v = src[ p ]; if( X.Type.isFunction( v ) && !target[ p ] ){ target[ p ] = multi = new Function( [ @@ -69,4 +70,3 @@ X_ViewPort.listenOnce( X_TEMP.SYSTEM_EVENT_PRE_INIT, function(){ }; }); - diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index 0343ec8..9a1dc75 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -65,17 +65,25 @@ var X_Node_ANIMATIONS = [], X_Node_Anime_hasTransform = !!X_Node_CSS_VENDER_PREFIX[ 'transform' ], /* Opera mobile で translateZ(0) が有効だと XY が 0 0 になる */ /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox, 手当てが済むまでここは常に false */ - X_Node_Anime_translateZ = '', //X_Node_CSS_VENDER_PREFIX[ 'perspective' ] && !X.UA.OperaMobile && !X.UA.OperaTablet ? ' translateZ(0)' : '', - X_Node_Anime_hasTransition = !!X_Node_CSS_VENDER_PREFIX[ 'transitionDelay' ] && !X.UA.Opera, // Opera12(XP,8.1) 切った方がスムース - X_Node_Anime_transitionProps = X_Node_Anime_hasTransform ? X_Node_CSS_VENDER_PREFIX[ 'transform' ] : 'left,top'; + X_Node_Anime_translateZ = X_Node_CSS_VENDER_PREFIX[ 'perspective' ] && !X_UA.OperaMobile && !X_UA.OperaTablet ? ' translateZ(0)' : '', + X_Node_Anime_hasTransition = !!X_Node_CSS_VENDER_PREFIX[ 'transitionDelay' ] && !X_UA.Opera, // Opera12(XP,8.1) 切った方がスムース + X_Node_Anime_transitionProps = X_Node_Anime_hasTransform ? X_Node_CSS_VENDER_PREFIX[ 'transform' ] : 'left,top', + // transitionEnd イベント中に要素の更新( X_Node_startUpdate() )ができるか? + // iOS3+4 では可能、iOS6.1.5 で不可。TODO iOS5 及び他の環境で調査。ダメな場合、anime.html が正しく描画されない。 + X_Node_updateOnTransitionEnd = X_UA.iOS < 6, + X_Node_Anime_onTransition = false; // gpu化だけ transformX , willChange // 終了位置の変更 // 中断 - +/* + * TODO : scale, ActiveX transform, zoom, fontSizeScale + * TODO : rotate, ActiveX transform + */ Node.prototype.animate = function( start, dest, duration, easing, wait ){ - var obj = this._anime || ( this._anime = {} ); + var isNew = !this._anime, + obj = this._anime || ( this._anime = {} ); obj.duration = 0 <= duration && X.Type.isFinite( duration ) ? duration : 500; obj.easing = ease[ easing ] || ease.circular; @@ -94,23 +102,29 @@ Node.prototype.animate = function( start, dest, duration, easing, wait ){ obj.destY = ( dest.y || dest.y === 0 ) ? dest.y : obj.destY || 0; obj.destA = 0 <= dest.opacity && dest.opacity <= 1 ? dest.opacity : obj.destA || 1; - - if( obj.gpuTimerID ){ - X.Timer.remove( obj.gpuTimerID ); - delete obj.gpuTimerID; - }; - - X_Node_Anime_needsDetection = true; + if( X_Node_Anime_onTransition ) return this; + if( X_Node_Anime_hasTransition ){ + + if( obj.gpuTimerID ){ + X.Timer.remove( obj.gpuTimerID ); + delete obj.gpuTimerID; + }; + + X_Node_Anime_needsDetection = true; + X_Node_Anime_reserveUpdate( true ); } else { - X_Node_Anime_updateTimerID || ( X_Node_Anime_updateTimerID = X.Timer.requestFrame( X_Node_Anime_updateAnimationsNoTransition ) ); + X_System.unlisten( X.Event.UPDATED, X_Node_Anime_updateAnimationsNoTransition ); + X_Node_Anime_updateTimerID || ( X_Node_Anime_updateTimerID = X.Timer.requestFrame( X_Node_Anime_updateAnimationsNoTransition ) ); + + isNew && this.dispatch( { type : X.Event.ANIME_START, gpu : false } ); }; X_Node_ANIMATIONS.indexOf( this ) === -1 && ( X_Node_ANIMATIONS[ X_Node_ANIMATIONS.length ] = this ); - //console.log( 'animate ' + this._id + ' y:' + obj.startY + ' > ' + obj.destY + ' d:' + obj.duration ); + console.log( 'animate ' + this._id + ' y:' + obj.startX + ' > ' + obj.destX + ' d:' + obj.duration ); return this; }; @@ -124,7 +138,7 @@ Node.prototype.stop = function(){ X_Node_Anime_reserveUpdate(); } else { X_Node_ANIMATIONS.splice( X_Node_ANIMATIONS.indexOf( this ), 1 ); - obj.gpuTimerID && X.Timer.remove( obj.gpuTimerID ); + //obj.gpuTimerID && X.Timer.remove( obj.gpuTimerID ); delete this._anime; }; return this; @@ -136,6 +150,7 @@ function X_Node_Anime_reserveUpdate( before ){ if( X_Node_updateTimerID ){ //console.log( before ? '> BEFORE_UPDATE' : '> UPDATED' ); + before = false; X_System.listenOnce( before ? X.Event.BEFORE_UPDATE : X.Event.UPDATED, X_Node_Anime_updateAnimations ); } else { //console.log( '> Timer' ); @@ -148,7 +163,7 @@ function X_Node_Anime_reserveUpdate( before ){ }; }; -function X_Node_Anime_updateAnimations( v ){ +function X_Node_Anime_updateAnimations( v, updateNow ){ var i = X_Node_ANIMATIONS.length, ret, c = false; //console.log( v.type || v ); @@ -171,7 +186,7 @@ function X_Node_Anime_updateAnimations( v ){ }; }; - if( X_Node_Anime_updateTimerID && X_Node_updateTimerID ) X_Node_startUpdate(); + if( ( X_Node_Anime_updateTimerID || updateNow ) && X_Node_updateTimerID ) X_Node_startUpdate(); X_Node_Anime_updateTimerID = 0; X_Node_Anime_reserved = false; @@ -224,6 +239,7 @@ function X_Node_Anime_detectAnimationLayers(){ break; }; }; + if( !parent && xnode._anime.phase !== 15 ){ if( xnode._anime.phase === 0 ){ // 新規 @@ -239,17 +255,27 @@ function X_Node_Anime_detectAnimationLayers(){ X_Node_Anime_needsDetection = false; }; +/* TODO + * 0:無, 1:子のGPU解除待 2:GPU予約, 3:GPU now!, 4:GPU解除予約 + */ function X_Node_Anime_updateAnimation( xnode ){ var obj = xnode._anime, phase = obj.phase, current, time; switch( phase ){ + case 2 : + // アニメーション中 + return false; + case -1 :// 子の GPU レイヤー解除待ち case 7 : ++obj.phase; break; case 0 : // 開始位置+アニメーションの設定 case 8 : + xnode.dispatch( { type : X.Event.ANIME_START, gpu : phase === 8 } ); + X_ViewPort.unlisten( X.Event.AFTER_UPDATE, xnode, X_Node_Anime_gpuReleased ); + X_Node_Anime_readyTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.startX, obj.startY, obj.startA, phase === 8 ); ++obj.phase; @@ -257,29 +283,42 @@ function X_Node_Anime_updateAnimation( xnode ){ case 1 : case 9 : // 終了位置の設定 obj.gpuParent = phase === 9; - obj.duration ? X_Node_Anime_updateTransition( xnode ) : X_Node_Anime_clearTransition( xnode ); - X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, obj.gpuParent ); - obj.phase = 2; - break; - - case 2 : - // アニメーション中 - return false; - + if( obj.duration ){ + xnode.listenOnce( 'transitionend', X_Node_Anime_onTransitionEnd ); + + xnode.css({ + transitionProperty : X_Node_Anime_transitionProps + ',opacity,width,height', // X_Node_Anime_readyTransitionに移動?? + transitionDuration : obj.duration + 'ms' + }); + + X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, obj.gpuParent ); + obj.phase = 2; + break; + }; + console.log( 'duration = 0 の場合、アニメーションの解除' ); + // duration = 0 の場合、アニメーションの解除 + case 3 : // アニメーションの解除 - X_Node_Anime_clearTransition( xnode ); obj.phase = obj.gpuParent ? 10 : 4; + // このタイミングで animation 関連の css を削除したところ、iOS3、4 で再描画忘れが度々起きるように、、、 + if( !obj.gpuParent ) X_Node_Anime_clearTransition( xnode ); + xnode.dispatch( { type : X.Event.ANIME_END, gpu : obj.gpuParent } ); break; case 4 : - // アニメーションは停止・GPU = false -> リストから削除 + // アニメーションは停止・GPU=false -> リストから削除 obj.gpuParent = false; return true; case 10 : // アニメーションは停止・GPUレイヤーは解除していない(再アニメーションに備えて待機) + X_Node_Anime_clearTransition( xnode ); // TODO X_Node_Anime_releaseGPULayer に移動? if( !obj.gpuTimerID ){ - obj.gpuTimerID = X.Timer.once( obj.wait, xnode, X_Node_Anime_releaseGPULayer ); + if( obj.wait ){ + obj.gpuTimerID = X.Timer.once( obj.wait, xnode, X_Node_Anime_releaseGPULayer ); + } else { + X_Node_Anime_releaseGPULayer.call( xnode ); + }; }; return false; @@ -298,6 +337,7 @@ function X_Node_Anime_updateAnimation( xnode ){ X_Node_Anime_clearTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, phase === 14 ); obj.phase = phase === 14 ? 10 : 4; + xnode.dispatch( { type : X.Event.ANIME_END, gpu : obj.gpuParent } ); } else { current = X_Node_Anime_getComputedPosition( xnode ); obj.startX = current.x; @@ -313,13 +353,16 @@ function X_Node_Anime_updateAnimation( xnode ){ case 15 : // GPU有効で停止(待機)している xnode の解除 //console.log( 'GPU有効で停止(待機)している xnode の解除' + xnode._tag + xnode.getOrder() ); + console.log( 'GPU有効で停止(待機)している xnode のGPU解除' ); X_Node_Anime_clearTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, false ); obj.gpuTimerID && X.Timer.remove( obj.gpuTimerID ); + X_ViewPort.listenOnce( X.Event.AFTER_UPDATE, xnode, X_Node_Anime_gpuReleased ); return true; - case 100 : // stop() : アニメーションの中断して削除 + case 100 : // stop() : アニメーションを中断して削除 //console.log( 'stop() gpu:' + obj.gpuParent ); + console.log( 'アニメーションを中断して削除' ); current = X_Node_Anime_getComputedPosition( xnode ); X_Node_Anime_clearTransition( xnode ); @@ -343,45 +386,54 @@ function X_Node_Anime_getComputedPosition( that ) { y = + parseInt( matrix.top ); }; - return { x: x, y: y, a : matrix[ X_Node_CSS_Support[ 'opacity' ] ] }; + return { x : x, y : y, a : matrix[ X_Node_CSS_Support[ 'opacity' ] ] }; }; -function X_Node_Anime_onTransitionEnd(){ - if( this._anime.phase !== 2 ) return X.Callback.PREVENT_DEFAULT; +function X_Node_Anime_onTransitionEnd( e ){ + if( !this._anime || this._anime.phase !== 2 ) return X.Callback.PREVENT_DEFAULT | X.Callback.STOP_PROPAGATION; this._anime.phase = 3; + + console.log( 'トランジション終了' ); + + X_Node_Anime_onTransition = true; + this.dispatch( { type : X.Event.ANIME_END, gpu : this._anime.gpuParent } ); + X_Node_Anime_onTransition = false; + X_Node_Anime_needsDetection = true; - X_Node_Anime_reserveUpdate(); - //console.log( 'トランジション終了' ); - return X.Callback.UN_LISTEN | X.Callback.PREVENT_DEFAULT | X.Callback.STOP_PROPAGATION; + // iOS は transitionend 内の 更新でアニメーション可能 iOS3, iOS4 で確認 + // win+Gecko は不可 + X_Node_Anime_updateAnimations( 0, X_Node_updateOnTransitionEnd ); + + return X.Callback.PREVENT_DEFAULT | X.Callback.STOP_PROPAGATION; }; function X_Node_Anime_releaseGPULayer(){ - var obj = this._anime; + var obj = this._anime, tmp; + if( !obj ){ + console.log( '_anime無' ); + return; + }; X_Node_Anime_updatePosition( this, obj.destX, obj.destY, obj.destA, false ); X_Node_ANIMATIONS.splice( X_Node_ANIMATIONS.indexOf( this ), 1 ); delete obj.gpuTimerID; delete this._anime; - console.log( 'GPUレイヤーの破棄' ); + console.log( 'GPUレイヤーの破棄を指示' ); + + X_ViewPort.listenOnce( X.Event.AFTER_UPDATE, this, X_Node_Anime_gpuReleased ); +}; + +function X_Node_Anime_gpuReleased(){ + console.log( 'GPU レイヤーが解放されました' ); + this.dispatch( { type : X.Event.GPU_RELEASED, gpu : true } ); }; function X_Node_Anime_readyTransition( xnode ){ xnode.css({ - willChange : X_Node_Anime_transitionProps + ',opacity,width,height', + //zIndex : 0, + //willChange : X_Node_Anime_transitionProps + ',opacity,width,height', backfaceVisibility : 'hidden', transitionTimingFunction : xnode._anime.easing.style, - transitionDelay : '0s' - }); -}; - -function X_Node_Anime_updateTransition( xnode ){ - // 開始座標のセット(新規のみ) - // アニメーション指定のセット(または解除)(対象のみ) - // 目標座標のセット - xnode.listenOnce( 'transitionend', X_Node_Anime_onTransitionEnd ); - - xnode.css({ - transitionProperty : X_Node_Anime_transitionProps + ',opacity,width,height', - transitionDuration : xnode._anime.duration + 'ms' + transitionDelay : '0s' // 0.001 にすると transitionend のタイミングが狂う、、、 }); }; @@ -389,10 +441,11 @@ function X_Node_Anime_clearTransition( xnode ){ // 開始座標のセット(新規のみ) // アニメーション指定のセット(または解除)(対象のみ) // 目標座標のセット - xnode.unlisten( 'transitionend', X_Node_Anime_onTransitionEnd ); + //xnode.unlisten( 'transitionend', X_Node_Anime_onTransitionEnd ); xnode.css({ - willChange : '', + //zIndex : 1, + //willChange : '', backfaceVisibility : '', transitionTimingFunction : '', transitionDelay : '', @@ -401,6 +454,7 @@ function X_Node_Anime_clearTransition( xnode ){ }; function X_Node_Anime_updatePosition( xnode, x, y, opacity, useGPU ){ + //console.log( 'y : ' + y + ' gpu : ' + !!useGPU ); if( X_Node_Anime_hasTransform ){ xnode.css({ transform : 'translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)' + ( useGPU ? X_Node_Anime_translateZ : '' ), @@ -429,10 +483,12 @@ function X_Node_Anime_updateAnimationsNoTransition(){ if( obj.destTime <= now ){ X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, false ); - xnode.asyncDispatch( 'transitionend' ); - + //xnode.asyncDispatch( 'transitionend' ); + delete xnode._anime; X_Node_ANIMATIONS.splice( i, 1 ); - delete xnode._anime; + + // filter な 親が解除されないと子要素への filter が反映されない + xnode.asyncDispatch( { type : X.Event.ANIME_END, gpu : false } ); } else { easing = obj.easing.fn( ( now - obj.startTime ) / obj.duration ); newX = ( obj.destX - obj.startX ) * easing + obj.startX; @@ -447,7 +503,12 @@ function X_Node_Anime_updateAnimationsNoTransition(){ }; if( c ){ - X_Node_Anime_updateTimerID = X.Timer.requestFrame( X_Node_Anime_updateAnimationsNoTransition ); + if( X_Node_updateTimerID ){ + X_System.listen( X.Event.UPDATED, X_Node_Anime_updateAnimationsNoTransition ); + X_Node_Anime_updateTimerID = 0; + } else { + X_Node_Anime_updateTimerID = X.Timer.requestFrame( X_Node_Anime_updateAnimationsNoTransition ); + }; } else { X_Node_Anime_updateTimerID = 0; }; diff --git a/0.6.x/js/05_util/01_XNinjaIframe.js b/0.6.x/js/05_util/01_XNinjaIframe.js index a1fe435..85ae252 100644 --- a/0.6.x/js/05_util/01_XNinjaIframe.js +++ b/0.6.x/js/05_util/01_XNinjaIframe.js @@ -35,7 +35,7 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits( } ); - X.ViewPort.listenOnce( X.Event.AFTER_UPDATE, this ); + X_ViewPort.listenOnce( X.Event.AFTER_UPDATE, this ); // http://nanto.asablo.jp/blog/2011/12/08/6237308 // IE 6/7 で文書間通信を実現するための一案 diff --git a/0.6.x/js/06_net/00_XNet.js b/0.6.x/js/06_net/00_XNet.js index 50bb695..2a0ad3c 100644 --- a/0.6.x/js/06_net/00_XNet.js +++ b/0.6.x/js/06_net/00_XNet.js @@ -1,5 +1,8 @@ // TODO onlineevent offlineevent, netspeed // local への通信に対しては、netspeed を更新しない + +// http://bugs.jquery.com/ticket/2709 +// がある場合、