X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=9af2882d754dfb64040aee072f1f70c8865de6c6;hb=6458885881e7badb99c70c24843c31d13064a167;hp=4311e310351adf1a0219c751efe8d57ba9898630;hpb=220a0ce1628d376ec14394c9b0be3c10f92a4cdb;p=jquery.git diff --git a/src/core.js b/src/core.js index 4311e31..9af2882 100644 --- a/src/core.js +++ b/src/core.js @@ -19,12 +19,8 @@ var jQuery = function( selector, context ) { // (both of which we optimize for) quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/, - // Check if a string has a non-whitespace character in it rnotwhite = /\S/, - rwhite = /\s/, // Used for trimming whitespace trimLeft = /^\s+/, @@ -134,7 +130,7 @@ jQuery.fn = jQuery.prototype = { } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? jQuery(ret.fragment).clone()[0] : ret.fragment).childNodes; + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; } return jQuery.merge( this, selector ); @@ -1039,9 +1035,8 @@ if ( indexOf ) { }; } -// Verify that \s matches non-breaking spaces -// (IE fails on this test) -if ( !rwhite.test( "\xA0" ) ) { +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; }