- /* Temporarily disabled some tests - Opera 10 doesn't appear to support
- disabled/enabled/checked properly.
- t( "Enabled UI Element", "#form input:not([type=hidden]):enabled", ["text1","radio1","radio2","check1","check2","hidden2","name","search"] );
- t( "Disabled UI Element", "#form input:disabled", ["text2"] );
- t( "Checked UI Element", "#form input:checked", ["radio2","check1"] );
- */
- t( "Selected Option Element", "#form option:selected", ["option1a","option2d","option3b","option3c"] );
- t( "Text Contains", "a:contains('Google')", ["google","groups"] );
- t( "Text Contains", "a:contains('Google Groups')", ["groups"] );
-
- t( "Text Contains", "a:contains('Google Groups (Link)')", ["groups"] );
- t( "Text Contains", "a:contains('(Link)')", ["groups"] );
-
- t( "Element Preceded By", "p ~ div", ["foo", "moretests","tabindex-tests", "liveHandlerOrder"] );
+ t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] );
+
+ t( "First Child", "p:first-child", ["firstp","sndp"] );
+ t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] );
+ t( "Not Nth Child", "p:not(:nth-child(1))", ["ap","en","sap","first"] );
+
+ // Verify that the child position isn't being cached improperly
+ jQuery("p:first-child").after("<div></div>");
+ jQuery("p:first-child").before("<div></div>").next().remove();
+
+ t( "First Child", "p:first-child", [] );
+
+ QUnit.reset();
+
+ t( "Last Child", "p:last-child", ["sap"] );
+ t( "Last Child", "#main a:last-child", ["simon1","anchor1","mark","yahoo","anchor2","simon","liveLink1","liveLink2"] );
+
+ t( "Nth-child", "#main form#form > *:nth-child(2)", ["text1"] );
+ t( "Nth-child", "#main form#form > :nth-child(2)", ["text1"] );
+
+ t( "Nth-child", "#form select:first option:nth-child(3)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(0n+3)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(1n+0)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(1n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(n)", ["option1a", "option1b", "option1c", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(even)", ["option1b", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(odd)", ["option1a", "option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(2n)", ["option1b", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(2n+1)", ["option1a", "option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n+1)", ["option1a", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n+2)", ["option1b"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n+3)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n-1)", ["option1b"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n-2)", ["option1a", "option1d"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n-3)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(3n+0)", ["option1c"] );
+ t( "Nth-child", "#form select:first option:nth-child(-n+3)", ["option1a", "option1b", "option1c"] );
+});
+
+test("pseudo - misc", function() {
+ expect(7);
+
+ t( "Headers", ":header", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
+ t( "Has Children - :has()", "p:has(a)", ["firstp","ap","en","sap"] );
+
+ var select = document.getElementById("select1");
+ ok( (window.Sizzle || window.jQuery.find).matchesSelector( select, ":has(option)" ), "Has Option Matches" );
+
+ t( "Text Contains", "a:contains(Google)", ["google","groups"] );
+ t( "Text Contains", "a:contains(Google Groups)", ["groups"] );
+
+ t( "Text Contains", "a:contains(Google Groups (Link))", ["groups"] );
+ t( "Text Contains", "a:contains((Link))", ["groups"] );
+});
+
+
+test("pseudo - :not", function() {
+ expect(24);