diff --git a/src/css.js b/src/css.js index c64fdb3a5..585108f1a 100644 --- a/src/css.js +++ b/src/css.js @@ -532,7 +532,9 @@ jQuery(function() { if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { - return elem.offsetWidth === 0 || elem.offsetHeight === 0; + // Support: Opera <= 12.12 + // Opera reports offsetWidths and offsetHeights less than zero on some elements + return elem.offsetWidth <= 0 || elem.offsetHeight <= 0; }; jQuery.expr.filters.visible = function( elem ) { diff --git a/test/index.html b/test/index.html index 45204e27e..9f8edfe20 100644 --- a/test/index.html +++ b/test/index.html @@ -87,7 +87,7 @@ -
See this blog entry for more information.
diff --git a/test/unit/css.js b/test/unit/css.js index d1cf33304..4d0cec3bb 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -857,7 +857,7 @@ test( "css opacity consistency across browsers (#12685)", function() { }); test( ":visible/:hidden selectors", function() { - expect( 13 ); + expect( 16 ); ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible" ); jQuery("#nothiddendiv").css({ display: "none" }); @@ -884,6 +884,10 @@ test( ":visible/:hidden selectors", function() { equal(jQuery("#table td:visible").length, 1, "hidden cell is not perceived as visible (#4512). Works on table elements"); $table.css("display", "none").html("