Skip to content

Commit

Permalink
Use Sizzle.Expr.match.globalPOS for identifying POS selectors in trav…
Browse files Browse the repository at this point in the history
…ersing. Fixes #10970.
  • Loading branch information
timmywil committed Dec 12, 2011
1 parent 9bea216 commit 2a63b98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sizzle
Submodule sizzle updated 1 files
+3 −0 sizzle.js
2 changes: 1 addition & 1 deletion src/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var runtil = /Until$/,
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS,
POS = jQuery.expr.match.globalPOS,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
Expand Down
8 changes: 5 additions & 3 deletions test/unit/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("find(node|jQuery object)", function() {
});

test("is(String|undefined)", function() {
expect(29);
expect(30);
ok( jQuery("#form").is("form"), "Check for element: A form must be a form" );
ok( !jQuery("#form").is("div"), "Check for element: A form is not a div" );
ok( jQuery("#mark").is(".blog"), "Check for class: Expected class 'blog'" );
Expand Down Expand Up @@ -70,8 +70,10 @@ test("is(String|undefined)", function() {
ok( jQuery("#en").is("[lang=\"en\"] , [lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
ok( jQuery("#en").is("[lang=\"de\"] , [lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );

ok( !jQuery(window).is('a'), "Checking is on a window does not throw an exception(#10178)" );
ok( !jQuery(document).is('a'), "Checking is on a document does not throw an exception(#10178)" );
ok( !jQuery(window).is("a"), "Checking is on a window does not throw an exception(#10178)" );
ok( !jQuery(document).is("a"), "Checking is on a document does not throw an exception(#10178)" );

ok( jQuery("#option1b").is("#select1 option:not(:first)"), "POS inside of :not() (#10970)" );
});

test("is(jQuery)", function() {
Expand Down

0 comments on commit 2a63b98

Please sign in to comment.