X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F08_XNodeSelector.js;h=727ac95ab0852a9e28361c6fd476987602388709;hb=475df4df9670f042764a99c80d7716e994d28033;hp=4b735e0e6c245607c8dff1014e0ebaeb45f5fbe5;hpb=8e63f506d14490e852fa557d326ca91f9cdd3baf;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 4b735e0..727ac95 100644 --- a/0.6.x/js/02_dom/08_XNodeSelector.js +++ b/0.6.x/js/02_dom/08_XNodeSelector.js @@ -78,10 +78,11 @@ function X_Node_Selector__parse( query, last ){ chr, chrCode, nameChr, name1st, tmp, escape, quot, start, name, key, value, operator, a, b, not; + query += ' '; while( i < l ){ chr = query.charAt( ++i ); - chrCode = ALPHABET.indexOf( chr ); + chrCode = ALPHABET.indexOf( chr ); // TODO この関数無くす! nameChr = chrCode !== -1; name1st = nameChr && chrCode < 52; switch( phase ){ @@ -233,22 +234,24 @@ function X_Node_Selector__parse( query, last ){ * @return {Node|NodeList} */ X[ 'Doc' ][ 'find' ] = X_shortcutFunction = + /** * selector を使って Node, NodeList を取得する - * @alias Node.prototype.find + * @alias NodeList.prototype.find * @function * @param {string} セレクター文字列 * @return {Node|NodeList} */ - Node.prototype[ 'find' ] = + X_NodeList.prototype[ 'find' ] = X_Node_find; + /** * selector を使って Node, NodeList を取得する - * @alias NodeList.prototype.find + * @alias Node.prototype.find * @function * @param {string} セレクター文字列 * @return {Node|NodeList} - */ - X_NodeList.prototype[ 'find' ] = function ( queryString ){ + */ + function X_Node_find( queryString ){ var HTML = X_Node_html, scope = this.constructor === X_NodeList && this.length ? this : [ this.constructor === Node ? this : X_Node_body ], parents = scope, // 探索元の親要素 XNodeList の場合あり