Skip to content

Commit 62c83a7

Browse files
committed
Only change ID on nodes that don't already have an ID for rooted qSA. Fixes #7212.
1 parent 9d1bfeb commit 62c83a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/unit/selector.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module("selector");
22

33
test("element", function() {
4-
expect(18);
4+
expect(21);
55
QUnit.reset();
66

77
ok( jQuery("*").size() >= 30, "Select all" );
@@ -32,6 +32,11 @@ test("element", function() {
3232
t( "Checking sort order", "h2, h1", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
3333
t( "Checking sort order", "h2:first, h1:first", ["qunit-header", "qunit-banner"] );
3434
t( "Checking sort order", "p, p a", ["firstp", "simon1", "ap", "google", "groups", "anchor1", "mark", "sndp", "en", "yahoo", "sap", "anchor2", "simon", "first"] );
35+
36+
// Test Conflict ID
37+
same( jQuery("#lengthtest").find("#idTest").get(), q("idTest"), "Finding element with id of ID." );
38+
same( jQuery("#lengthtest").find("[name='id']").get(), q("idTest"), "Finding element with id of ID." );
39+
same( jQuery("#lengthtest").find("input[id='idTest']").get(), q("idTest"), "Finding elements with a context." );
3540
});
3641

3742
if ( location.protocol != "file:" ) {

0 commit comments

Comments
 (0)