Commit 31b57318 authored by Brandon Aaron's avatar Brandon Aaron

fix :hidden selector that was accidentally reverted in previous commit, also...

fix :hidden selector that was accidentally reverted in previous commit, also fixed tests for :hidden selector in IE6
parent d72b8307
...@@ -977,7 +977,7 @@ jQuery.expr = Sizzle.selectors; ...@@ -977,7 +977,7 @@ jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters; jQuery.expr[":"] = jQuery.expr.filters;
Sizzle.selectors.filters.hidden = function(elem){ Sizzle.selectors.filters.hidden = function(elem){
return elem.offsetWidth === 0 || elem.offsetHeight === 0; return elem.offsetWidth === 0 && elem.offsetHeight === 0;
}; };
Sizzle.selectors.filters.visible = function(elem){ Sizzle.selectors.filters.visible = function(elem){
......
...@@ -364,6 +364,7 @@ test("pseudo (:) selectors", function() { ...@@ -364,6 +364,7 @@ test("pseudo (:) selectors", function() {
t( "Is Hidden", "#dl:hidden", ["dl"] ); t( "Is Hidden", "#dl:hidden", ["dl"] );
var $div = jQuery('#nothiddendivchild'); var $div = jQuery('#nothiddendivchild');
$div.css({ fontSize: 0, lineHeight: 0 });// IE also needs to set font-size and line-height to 0
$div.width(0).height(0); $div.width(0).height(0);
t( "Is Hidden", '#nothiddendivchild:hidden', ['nothiddendivchild'] ); t( "Is Hidden", '#nothiddendivchild:hidden', ['nothiddendivchild'] );
t( "Is Not Hidden", '#nothiddendivchild:visible', [] ); t( "Is Not Hidden", '#nothiddendivchild:visible', [] );
...@@ -376,7 +377,7 @@ test("pseudo (:) selectors", function() { ...@@ -376,7 +377,7 @@ test("pseudo (:) selectors", function() {
$div.width(1).height(1); $div.width(1).height(1);
t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
$div.width('').height(''); $div.width('').height('').css({ fontSize: '', lineHeight: '' });
t( "Check position filtering", "div#nothiddendiv:eq(0)", ["nothiddendiv"] ); t( "Check position filtering", "div#nothiddendiv:eq(0)", ["nothiddendiv"] );
t( "Check position filtering", "div#nothiddendiv:last", ["nothiddendiv"] ); t( "Check position filtering", "div#nothiddendiv:last", ["nothiddendiv"] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment