From 5f35b3d9f90d07ee084d59702a54051ee51fb0d3 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Sun, 10 Jun 2012 21:54:16 -0400 Subject: Fix #11857. Modularize css.js, add dependency management. Closes gh-816. See the pull request for more info on the dependency management details. --- test/unit/selector.js | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'test/unit/selector.js') diff --git a/test/unit/selector.js b/test/unit/selector.js index f4a5f4954..5bea3215e 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -34,26 +34,28 @@ test("attributes - jQuery only", function() { t( "Find elements with a tabindex attribute", "[tabindex]", ["listWithTabIndex", "foodWithNegativeTabIndex", "linkWithTabIndex", "linkWithNegativeTabIndex", "linkWithNoHrefWithTabIndex", "linkWithNoHrefWithNegativeTabIndex"] ); }); -test("pseudo - visibility", function() { - expect( 9 ); - - t( "Is Visible", "div:visible:not(#qunit-testrunner-toolbar):lt(2)", ["nothiddendiv", "nothiddendivchild"] ); - t( "Is Not Hidden", "#qunit-fixture:hidden", [] ); - t( "Is Hidden", "#form input:hidden", ["hidden1","hidden2"] ); - - var $div = jQuery('
').appendTo("body"); - $div.css({ fontSize: 0, lineHeight: 0 });// IE also needs to set font-size and line-height to 0 - $div.css( "width", 1 ).css( "height", 0 ); - t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); - t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); - $div.css( "width", 0 ).css( "height", 1 ); - t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); - t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); - $div.css( "width", 1 ).css( "height", 1 ); - t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); - t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); - $div.remove(); -}); +if ( jQuery.css ) { + test("pseudo - visibility", function() { + expect( 9 ); + + t( "Is Visible", "div:visible:not(#qunit-testrunner-toolbar):lt(2)", ["nothiddendiv", "nothiddendivchild"] ); + t( "Is Not Hidden", "#qunit-fixture:hidden", [] ); + t( "Is Hidden", "#form input:hidden", ["hidden1","hidden2"] ); + + var $div = jQuery('
').appendTo("body"); + $div.css({ fontSize: 0, lineHeight: 0 });// IE also needs to set font-size and line-height to 0 + $div.css( "width", 1 ).css( "height", 0 ); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.css( "width", 0 ).css( "height", 1 ); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.css( "width", 1 ).css( "height", 1 ); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.remove(); + }); +} test("disconnected nodes", function() { expect( 4 ); -- cgit v1.2.3