Skip to content
Permalink
Browse files

Merge branch 'bug_7369' of https://github.com/timmywil/jquery into ti…

…mmywil-bug_7369
  • Loading branch information...
jeresig committed Apr 10, 2011
2 parents 247363b + a807451 commit 909a6ff60a88b17155bc000ab49d02c2dd6938f2
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/traversing.js
  2. +4 −0 test/unit/traversing.js
@@ -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() {

0 comments on commit 909a6ff

Please sign in to comment.
You can’t perform that action at this time.