if( !parent ) return this;
- // TODO anime
// stop() ->
if( this[ '_anime' ] && this[ '_anime' ].phase ){
console.log( 'Animation 中の REMOVE' );
- this[ 'stop' ]();
+ X_NodeAnime_stopNow( this );
};
+ // 子孫にアニメーション中の要素が要る
+ // 先祖に GPU 化した要素が要る
delete this.parent;
parent[ '_xnodes' ].splice( parent[ '_xnodes' ].indexOf( this ), 1 );
if( X_UA_DOM.IE4 ){
if( elm = this[ '_rawObject' ] || X_Node__ie4getRawNode( this ) ){
X_Node_reserveRemoval[ X_Node_reserveRemoval.length ] = this;
- X_Node_reserveUpdate();
+ X_Node_reserveUpdate();
} else
if( !this[ '_tag' ] && ( ( parent[ '_flags' ] & X_NodeFlags_IE4_FIXED ) === 0 ) ){
parent[ '_flags' ] |= X_NodeFlags_IE4_DIRTY_CHILDREN;
parent && parent[ '_xnodes' ] && parent[ '_xnodes' ].splice( parent[ '_xnodes' ].indexOf( that ), 1 );
- elm = that[ '_rawObject' ] || X_UA_DOM.IE4 && X_Node__ie4getRawNode( that );
-
if( xnodes && ( i = xnodes.length ) ){
delete that[ '_xnodes' ];
for( ; i; ){
X_Node_CHASHE[ that[ '_uid' ] ] = null; // array に対して delete X_Node_CHASHE[ uid ] はまずい!
-// TODO anime
if( that[ '_anime' ] && that[ '_anime' ].phase ){
console.log( 'Animation 中の KILL' );
- that[ 'stop' ]();
+ X_NodeAnime_stopNow( that );
};
+ elm = that[ '_rawObject' ] || X_UA_DOM.IE4 && X_Node__ie4getRawNode( that );
+
// remove _xnodes
if( X_UA_DOM.IE4 ){
if( elm ){
* @example node.contains( testNode );
*/
function X_Node_contains( v ){
- var elm, type, xnodes, i;
+ var xnodes;
if( !v || !this[ '_tag' ] || 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_NodeType_RAW_HTML || type === X_NodeType_RAW_TEXT ) ){
- return elm.contains( v );
- }; */
- //if( document.compareDocumentPosition ){
- //
- //};
-
xnodes = this[ '_xnodes' ];
if( !xnodes || !xnodes.length ) return false;
- if( this === v[ 'parent' ] ) return true; // fast
- if( xnodes.indexOf( v ) !== -1 ) return true; // fast
- for( i = xnodes.length; i; ){
- if( xnodes[ --i ][ 'contains' ]( v ) ) return true;
+
+ while( v = v[ 'parent' ] ){
+ if( this === v ) return true;
};
return false;
};
return this.parent ? X_Node_CSS_getCharSize( this ) : 0;
case 'inGPU' :
return !!( this[ '_flags' ] & ( X_NodeFlags_GPU_NOW | X_NodeFlags_GPU_RELEASE_RESERVED ) );
+ case 'isGPUChild' :
+ if( this[ '_flags' ] & X_NodeFlags_IN_TREE ){
+ parent = this;
+ while( parent = parent.parent ){
+ if( parent[ '_flags' ] & ( X_NodeFlags_GPU_NOW | X_NodeFlags_GPU_RELEASE_RESERVED ) ) return true;
+ };
+ };
+ return false;
+ case 'containGPU' :
+
+ return false;
case 'canAnimateNow' :
return ( this[ '_flags' ] & X_NodeFlags_IN_TREE ) && X_NodeAnime_detectWaitAnimation( this, true, true ) === 6;
case 'animeState' :
console.log( 'GPU 解放 ' );
//X_Node_updateReservedByReleaseGPU = true;
that[ '_flags' ] &= X_Node_BitMask_RESET_GPU;
- //return elm;// TODO もしかしたらこのタイミングで更新できるかも。
+ //return elm;// このタイミングで更新できるっぽい。
};
// 3. GPU予約 -> GPU
if( that[ '_flags' ] & X_NodeFlags_GPU_RESERVED ){
- // TODO size 取得のための update の場合、GPU化を待つ
+ // TODO size 取得のための update の場合、GPU化をスキップ
that[ '_flags' ] &= X_Node_BitMask_RESET_GPU;
that[ '_flags' ] |= X_NodeFlags_GPU_NOW;
};
if( that[ '_flags' ] & X_NodeFlags_IS_SVG ){
elm = document.createElementNS( 'http://www.w3.org/2000/svg', that[ '_tag' ].toLowerCase() );
- // math http://www.w3.org/1998/Math/MathML
+ // TODO math http://www.w3.org/1998/Math/MathML
} else {
elm = document.createElement( that[ '_tag' ] );
};