Merge branch 'bug_7369' of https://github.com/timmywil/jquery into timmywil-bug_7369
This commit is contained in:
commit
909a6ff60a
|
@ -130,7 +130,7 @@ jQuery.fn.extend({
|
|||
|
||||
} else {
|
||||
cur = cur.parentNode;
|
||||
if ( !cur || !cur.ownerDocument || cur === context ) {
|
||||
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,6 +205,10 @@ test("closest()", function() {
|
|||
|
||||
// Test on disconnected node
|
||||
equals( jQuery("<div><p></p></div>").find("p").closest("table").length, 0, "Make sure disconnected closest work." );
|
||||
|
||||
// Bug #7369
|
||||
equals( jQuery('<div foo="bar"></div>').closest('[foo]').length, 1, "Disconnected nodes with attribute selector" );
|
||||
equals( jQuery('<div>text</div>').closest('[lang]').length, 0, "Disconnected nodes with text and non-existent attribute selector" );
|
||||
});
|
||||
|
||||
test("closest(Array)", function() {
|
||||
|
|
Loading…
Reference in a new issue