From 085de849595ac99677795ed1524f840877a6b7bb Mon Sep 17 00:00:00 2001 From: John Resig Date: Tue, 12 Oct 2010 10:13:00 -0400 Subject: [PATCH] The child selector-prefix branch doesn't work with selectors that have a larger depth. Removing for now - will need to re-evaluate in the future. --- src/traversing.js | 5 ----- test/unit/traversing.js | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/traversing.js b/src/traversing.js index 968aab036..3ed0a1c22 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -11,11 +11,6 @@ var runtil = /Until$/, 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, "$1" ) ); - } - var ret = this.pushStack( "", "find", selector ), length = 0; for ( var i = 0, l = this.length; i < l; i++ ) { diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 3332f077c..0d079f19a 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -1,7 +1,7 @@ module("traversing"); test("find(String)", function() { - expect(4); + expect(5); equals( 'Yahoo', jQuery('#foo').find('.blogTest').text(), 'Check for find' ); // using contents will get comments regular, text, and comment nodes @@ -10,6 +10,7 @@ test("find(String)", function() { same( jQuery("#main").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" ); same( jQuery("#main").find("> #foo, > #moretests").get(), q("foo", "moretests"), "find child elements" ); + same( jQuery("#main").find("> #foo > p").get(), q("sndp", "en", "sap"), "find child elements" ); }); test("is(String)", function() { -- 2.39.5