diff options
author | Christian Kosmowski <ksmwsk@gmail.com> | 2014-04-14 16:00:42 +0200 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2014-04-18 10:10:11 -0400 |
commit | 90c50ef961ac3862e6ef693f588f513bf5e759ee (patch) | |
tree | cc8310a31ec7c3b0b4505a543983b0d844f78992 | |
parent | f873d065432c20a61b7351f559b43dbfcf661ddf (diff) | |
download | jquery-90c50ef961ac3862e6ef693f588f513bf5e759ee.tar.gz jquery-90c50ef961ac3862e6ef693f588f513bf5e759ee.zip |
Dimensions: Reverse a check to avoid potential reflows
Fixes #14979
Closes gh-1560
(cherry picked from commit 1ca84214cc89d9e5f8af12b18b34426fc91b1b08)
Conflicts:
AUTHORS.txt
-rw-r--r-- | AUTHORS.txt | 1 | ||||
-rw-r--r-- | src/css.js | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt index 0856478f2..18756d281 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -211,4 +211,5 @@ Roman Reiß <me@silverwind.io> Benjy Cui <benjytrys@gmail.com> Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> John Hoven <hovenj@gmail.com> +Christian Kosmowski <ksmwsk@gmail.com> diff --git a/src/css.js b/src/css.js index 31f551eb1..2c88f2bc3 100644 --- a/src/css.js +++ b/src/css.js @@ -350,7 +350,7 @@ jQuery.each([ "height", "width" ], function( i, name ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this - return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : |