]> source.dussan.org Git - jquery.git/commitdiff
The child selector-prefix branch doesn't work with selectors that have a larger depth...
authorJohn Resig <jeresig@gmail.com>
Tue, 12 Oct 2010 14:13:00 +0000 (10:13 -0400)
committerJohn Resig <jeresig@gmail.com>
Tue, 12 Oct 2010 14:13:00 +0000 (10:13 -0400)
src/traversing.js
test/unit/traversing.js

index 968aab03674b6e48ca5afb04bb8846ba68896f7b..3ed0a1c227747f3bdc54b47ae4edeeb760f3aeb7 100644 (file)
@@ -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++ ) {
index 3332f077c4753824278f5828a6c328171a38ca54..0d079f19a4bbbae1b4200c4923352702c663483c 100644 (file)
@@ -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() {