Fixed the issue where $("body").find("div#foo") would ignore the specified tag name. (Bug #1543)
This commit is contained in:
parent
3ae74b523e
commit
127c0b8a5d
|
@ -247,7 +247,7 @@ jQuery.extend({
|
||||||
// We need to find all descendant elements
|
// We need to find all descendant elements
|
||||||
for ( var i = 0; ret[i]; i++ ) {
|
for ( var i = 0; ret[i]; i++ ) {
|
||||||
// Grab the tag name being searched for
|
// Grab the tag name being searched for
|
||||||
var tag = m[1] != "" || m[0] == "" ? "*" : m[2];
|
var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
|
||||||
|
|
||||||
// Handle IE7 being really dumb about <object>s
|
// Handle IE7 being really dumb about <object>s
|
||||||
if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
|
if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
|
||||||
|
|
|
@ -41,7 +41,7 @@ test("broken", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("id", function() {
|
test("id", function() {
|
||||||
expect(24);
|
expect(25);
|
||||||
t( "ID Selector", "#body", ["body"] );
|
t( "ID Selector", "#body", ["body"] );
|
||||||
t( "ID Selector w/ Element", "body#body", ["body"] );
|
t( "ID Selector w/ Element", "body#body", ["body"] );
|
||||||
t( "ID Selector w/ Element", "ul#first", [] );
|
t( "ID Selector w/ Element", "ul#first", [] );
|
||||||
|
@ -72,6 +72,8 @@ test("id", function() {
|
||||||
t( "ID Selector on Form with an input that has a name of 'id'", "#lengthtest", ["lengthtest"] );
|
t( "ID Selector on Form with an input that has a name of 'id'", "#lengthtest", ["lengthtest"] );
|
||||||
|
|
||||||
t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986
|
t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986
|
||||||
|
|
||||||
|
isSet( $("body").find("div#form"), [], "ID selector within the context of another element" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("class", function() {
|
test("class", function() {
|
||||||
|
|
Loading…
Reference in a new issue