diff options
author | timmywil <timmywillisn@gmail.com> | 2011-12-12 11:23:47 -0500 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2011-12-12 11:23:47 -0500 |
commit | 2a63b980eda1cf4ec1c2f27749821785c78c65b6 (patch) | |
tree | 8528a3543e13ccf5e8b5b8cfba906baeb5420226 | |
parent | 9bea2167c434d5b97643f53da16b04927dc02a7d (diff) | |
download | jquery-2a63b980eda1cf4ec1c2f27749821785c78c65b6.tar.gz jquery-2a63b980eda1cf4ec1c2f27749821785c78c65b6.zip |
Use Sizzle.Expr.match.globalPOS for identifying POS selectors in traversing. Fixes #10970.
m--------- | src/sizzle | 0 | ||||
-rw-r--r-- | src/traversing.js | 2 | ||||
-rw-r--r-- | test/unit/traversing.js | 8 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/sizzle b/src/sizzle -Subproject 935874052e54b4686b4e69b653eb05cd6e25c44 +Subproject 423f35af8bf43f3f07bb17284e21608f08372c2 diff --git a/src/traversing.js b/src/traversing.js index f06cfd92f..c342e15c1 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -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, diff --git a/test/unit/traversing.js b/test/unit/traversing.js index bcd3a974e..63d46dd45 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -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'" ); @@ -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() { |