]> source.dussan.org Git - jquery.git/commitdiff
Dimensions: Reverse a check to avoid potential reflows
authorChristian Kosmowski <ksmwsk@gmail.com>
Mon, 14 Apr 2014 14:00:42 +0000 (16:00 +0200)
committerDave Methvin <dave.methvin@gmail.com>
Fri, 18 Apr 2014 14:10:11 +0000 (10:10 -0400)
Fixes #14979
Closes gh-1560
(cherry picked from commit 1ca84214cc89d9e5f8af12b18b34426fc91b1b08)

Conflicts:
AUTHORS.txt

AUTHORS.txt
src/css.js

index 0856478f23bbd88dda14b54b3c90ce71a8a3e4e8..18756d2812ce4c30b25b98c85d14ad58dc49d4e2 100644 (file)
@@ -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>
 
index 31f551eb1e47c3bd59a4ad3b019fe706ff7bc5ef..2c88f2bc3c0eb319ae463fe4d69f21a3d50b329d 100644 (file)
@@ -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 );
                                        }) :