Dimensions: Reverse a check to avoid potential reflows

Fixes #14979
Closes gh-1560
This commit is contained in:
Christian Kosmowski 2014-04-14 16:00:42 +02:00 committed by Dave Methvin
parent 4bd2830636
commit 1ca84214cc
2 changed files with 2 additions and 1 deletions

View File

@ -221,4 +221,5 @@ Benjy Cui <benjytrys@gmail.com>
Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>
John Hoven <hovenj@gmail.com> John Hoven <hovenj@gmail.com>
Philip Jägenstedt <philip@foolip.org> Philip Jägenstedt <philip@foolip.org>
Christian Kosmowski <ksmwsk@gmail.com>

View File

@ -340,7 +340,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
if ( computed ) { if ( computed ) {
// certain elements can have dimension info if we invisibly show them // certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this // 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() { jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra ); return getWidthOrHeight( elem, name, extra );
}) : }) :