diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2014-07-17 16:53:57 -0700 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2014-07-17 17:03:35 -0700 |
commit | 10399ddcf8a239acc27bdec9231b996b178224d3 (patch) | |
tree | 84db1d9f7cf7d1d6b348602f6377d38bbf2b19d2 /src | |
parent | 269a27c70204c7d233eac3cd91a383e9b5759a2f (diff) | |
download | jquery-10399ddcf8a239acc27bdec9231b996b178224d3.tar.gz jquery-10399ddcf8a239acc27bdec9231b996b178224d3.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/css/hiddenVisibleSelectors.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/css/hiddenVisibleSelectors.js b/src/css/hiddenVisibleSelectors.js index c7f1c7ee7..2b1eb8155 100644 --- a/src/css/hiddenVisibleSelectors.js +++ b/src/css/hiddenVisibleSelectors.js @@ -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 ); |