X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F08_XNodeSelector.js;h=7d18c8b424cb07a1b2b24f8a242db8c4db76167f;hb=9a3ec59dd9eafb9fde293ee2f112e168af1e62bc;hp=793e166cc5cbf84bfeba8822ca8604c54c12e0b6;hpb=c50ad9ff1e8d6e9be2089ba554813564bd24a7c8;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/08_XNodeSelector.js b/0.6.x/js/02_dom/08_XNodeSelector.js index 793e166..7d18c8b 100644 --- a/0.6.x/js/02_dom/08_XNodeSelector.js +++ b/0.6.x/js/02_dom/08_XNodeSelector.js @@ -320,7 +320,7 @@ function X_Node_Selector__parse( query, last ){ case 2 : for( ; i < l; ++i ){ for( xnode = parents[ i ].firstChild(); xnode; xnode = xnode.nextNode() ){ - if( xnode._xnodeType === 1 && ( isAll || tagName === xnode._tag ) ) xnodes[ ++n ] = xnode; + if( xnode._tag && ( isAll || tagName === xnode._tag ) ) xnodes[ ++n ] = xnode; }; }; break; @@ -328,7 +328,7 @@ function X_Node_Selector__parse( query, last ){ case 3 : for( ; i < l; ++i ){ for( xnode = parents[ i ].nextNode(); xnode; xnode = xnode.nextNode() ){ - if( xnode._xnodeType === 1 ){ + if( xnode._tag ){ if( isAll || tagName === xnode._tag ) xnodes[ ++n ] = xnode; break; }; @@ -340,7 +340,7 @@ function X_Node_Selector__parse( query, last ){ merge = {}; for( ; i < l; ++i ){ for( xnode = parents[ i ].nextNode(); xnode; xnode = xnode.nextNode() ){ - if( xnode._xnodeType === 1 && ( isAll || tagName === xnode._tag ) ){ + if( xnode._tag && ( isAll || tagName === xnode._tag ) ){ uid = xnode._uid; if( merge[ uid ] ){ break; @@ -536,7 +536,7 @@ function X_Node_Selector__parse( query, last ){ j, child, _xnodes; for( ; i < l; ++i ){ child = xnodes[ i ]; - if( child._xnodeType !== 1 ) continue; + if( !child._tag ) continue; //console.log( child._tag ); if( ( j = list.indexOf( child ) ) !== -1 ){ newList[ newList.length ] = child; @@ -561,7 +561,7 @@ function X_Node_Selector__parse( query, last ){ child; for( ; i < l; ++i ){ child = xnodes[ i ]; - if( child._xnodeType === 1 ){ + if( child._tag ){ ( !tag || child._tag === tag ) && ( list[ list.length ] = child ); //console.log( parent._tag + ' > ' + child._tag + ' == ' + tag+ ' l:' + list.length ); child._xnodes && child._xnodes.length && X_Node_Selector__fetchElements( list, child, tag ); @@ -579,7 +579,7 @@ function X_Node_Selector__parse( query, last ){ tmp = null; if( /* tmp === null && */ type <= 0 ){ for( node = xnode.prevNode(); node; node = node.prevNode() ){ - if( node._xnodeType === 1 && ( flag_all || tagName === node._tag ) ){ + if( node._tag && ( flag_all || tagName === node._tag ) ){ tmp = false; break; }; @@ -587,7 +587,7 @@ function X_Node_Selector__parse( query, last ){ }; if( tmp === null && 0 <= type ){ for( node = xnode.nextNode(); node; node = node.nextNode() ){ - if( node._xnodeType === 1 && ( flag_all || tagName === node._tag ) ){ + if( node._tag && ( flag_all || tagName === node._tag ) ){ tmp = false; break; }; @@ -610,7 +610,7 @@ function X_Node_Selector__parse( query, last ){ tmp = checked[ uid ]; if( tmp === void 0 ){ for( c = 0, node = xnode.parent[ pointer ](), tagName = flag_all || xnode._tag; node; node = node[ sibling ]() ){ - if( node._xnodeType === 1 && ( flag_all || tagName === node._tag ) ){ + if( node._tag && ( flag_all || tagName === node._tag ) ){ ++c; checked[ node._uid ] = a === 0 ? c === b : (c - b) % a === 0 && (c - b) / a >= 0; }; @@ -685,7 +685,7 @@ var X_Node_Selector__filter = { for( ; xnode = xnodes[i]; ++i ){ tmp = true; for( node = xnode.firstChild(); node; node = node.nextSibling() ){ - if( node._xnodeType === 1 || ( node._xnodeType === 3 && node._text ) ){ + if( node._tag || ( !node._tag && node._text ) ){ tmp = false; break; };