Fixed #1854 by using wizzud's suggestion. The only real difference is the code is only called when there is more than a single selector. So there should be no speed decrease in the current working cases. Only additional functionality for cases that used to fail.
This commit is contained in:
parent
3e3b86c7a7
commit
da33a981c6
5 changed files with 29 additions and 14 deletions
|
@ -1052,10 +1052,12 @@ test("filter()", function() {
|
|||
});
|
||||
|
||||
test("not()", function() {
|
||||
expect(3);
|
||||
expect(5);
|
||||
ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" );
|
||||
isSet( $("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" );
|
||||
isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" );
|
||||
isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );
|
||||
isSet( $("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d" ), "not('complex selector')");
|
||||
});
|
||||
|
||||
test("andSelf()", function() {
|
||||
|
|
|
@ -182,7 +182,7 @@ test("attributes", function() {
|
|||
});
|
||||
|
||||
test("pseudo (:) selectors", function() {
|
||||
expect(32);
|
||||
expect(35);
|
||||
t( "First Child", "p:first-child", ["firstp","sndp"] );
|
||||
t( "Last Child", "p:last-child", ["sap"] );
|
||||
t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] );
|
||||
|
@ -195,6 +195,9 @@ test("pseudo (:) selectors", function() {
|
|||
t( "Text Contains", "a:contains('Google Groups')", ["groups"] );
|
||||
t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests", "moretests"] );
|
||||
t( "Not", "a.blog:not(.link)", ["mark"] );
|
||||
t( "Not - multiple", "#form option:not(:contains('Nothing'),#option1b,:selected)", ["option1c", "option1d", "option2b", "option2c", "option3d"] );
|
||||
t( "Not - complex", "#form option:not([id^='opt']:gt(0):nth-child(-n+3))", [ "option1a", "option1d", "option2d", "option3d"] );
|
||||
t( "Not - recursive", "#form option:not(:not(:selected))[id^='option3']", [ "option3b", "option3c"] );
|
||||
|
||||
t( "nth Element", "p:nth(1)", ["ap"] );
|
||||
t( "First Element", "p:first", ["firstp"] );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue