- t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] );
- t( "Is Visible", "#form input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] );
- t( "Is Hidden", "#form input:hidden", ["hidden1","hidden2"] );
-
- t( "Form element :input", "#form :input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3"] );
+
+ t( "Check position filtering", "div#nothiddendiv:eq(0)", ["nothiddendiv"] );
+ t( "Check position filtering", "div#nothiddendiv:last", ["nothiddendiv"] );
+ t( "Check position filtering", "div#nothiddendiv:not(:gt(0))", ["nothiddendiv"] );
+ t( "Check position filtering", "#foo > :not(:first)", ["en", "sap"] );
+ t( "Check position filtering", "select > :not(:gt(2))", ["option1a", "option1b", "option1c"] );
+ t( "Check position filtering", "select:lt(2) :not(:first)", ["option1b", "option1c", "option1d", "option2a", "option2b", "option2c", "option2d"] );
+ t( "Check position filtering", "div.nothiddendiv:eq(0)", ["nothiddendiv"] );
+ t( "Check position filtering", "div.nothiddendiv:last", ["nothiddendiv"] );
+ t( "Check position filtering", "div.nothiddendiv:not(:lt(0))", ["nothiddendiv"] );
+
+ t( "Check element position", "div div:eq(0)", ["nothiddendivchild"] );
+ t( "Check element position", "div div:eq(5)", ["t2037"] );
+ t( "Check element position", "div div:eq(28)", ["hide"] );
+ t( "Check element position", "div div:first", ["nothiddendivchild"] );
+ t( "Check element position", "div > div:first", ["nothiddendivchild"] );
+ t( "Check element position", "#dl div:first div:first", ["foo"] );
+ t( "Check element position", "#dl div:first > div:first", ["foo"] );
+ t( "Check element position", "div#nothiddendiv:first > div:first", ["nothiddendivchild"] );
+});
+
+if ( (window.Sizzle || jQuery.find).selectors.filters.visibility ) {
+test("pseudo - visibility", function() {
+ expect(11);
+
+ t( "Is Visible", "#form input:visible", [] );
+ t( "Is Visible", "div:visible:not(#qunit-testrunner-toolbar):lt(2)", ["nothiddendiv", "nothiddendivchild"] );
+ t( "Is Hidden", "#form input:hidden", ["text1","text2","radio1","radio2","check1","check2","hidden1","hidden2","name","search"] );
+ t( "Is Hidden", "#main:hidden", ["main"] );
+ t( "Is Hidden", "#dl:hidden", ["dl"] );
+
+ var $div = jQuery('<div/>').appendTo("body");
+ $div.css({ fontSize: 0, lineHeight: 0 });// IE also needs to set font-size and line-height to 0
+ $div.width(1).height(0);
+ t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
+ t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ $div.width(0).height(1);
+ t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
+ t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ $div.width(1).height(1);
+ t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
+ t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ $div.remove();
+});
+}
+
+test("pseudo - form", function() {
+ expect(8);
+
+ t( "Form element :input", "#form :input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "search", "button", "area1", "select1", "select2", "select3"] );