aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-28 10:33:21 -0700
committerJohn Resig <jeresig@gmail.com>2010-09-28 10:33:21 -0700
commitf1f6bc3ec43d86f5b2a0c2b8bf711a2d35930717 (patch)
tree450f858d4e4441cb81564344cf5fd206062279ba /src
parent873c28425fb64fdb48cfa09d17041bded39b301f (diff)
downloadjquery-f1f6bc3ec43d86f5b2a0c2b8bf711a2d35930717.tar.gz
jquery-f1f6bc3ec43d86f5b2a0c2b8bf711a2d35930717.zip
Handle child selectors in particular - away from the selector engine. Fixes #7029.
Diffstat (limited to 'src')
-rw-r--r--src/traversing.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/traversing.js b/src/traversing.js
index dff108754..f57819d86 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -4,11 +4,17 @@ var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
+ rchild = /^\s*>/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice;
jQuery.fn.extend({
find: function( selector ) {
+ // Handle "> div" child selectors and pass them to .children()
+ if ( typeof selector === "string" && rchild.test( selector ) ) {
+ return this.children( selector.replace( rchild, "" ) );
+ }
+
var ret = this.pushStack( "", "find", selector ), length = 0;
for ( var i = 0, l = this.length; i < l; i++ ) {