CSS: elements are hidden when either offsetWidth or offsetHeight is zero

- Note: this is a breaking change that has been delayed for several versions.

Fixes #10406
Fixes #13132
This commit is contained in:
Timmy Willison
2014-07-17 16:53:57 -07:00
parent 269a27c702
commit 10399ddcf8
2 changed files with 15 additions and 11 deletions

View File

@@ -6,7 +6,9 @@ define([
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
// Use OR instead of AND as the element is not visible if either is true
// See tickets #10406 and #13132
return elem.offsetWidth <= 0 || elem.offsetHeight <= 0;
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );