From 1ca84214cc89d9e5f8af12b18b34426fc91b1b08 Mon Sep 17 00:00:00 2001 From: Christian Kosmowski Date: Mon, 14 Apr 2014 16:00:42 +0200 Subject: [PATCH] Dimensions: Reverse a check to avoid potential reflows Fixes #14979 Closes gh-1560 --- AUTHORS.txt | 1 + src/css.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 45e7ee0e9..725fce001 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -221,4 +221,5 @@ Benjy Cui Rodrigo Rosenfeld Rosas John Hoven Philip Jägenstedt +Christian Kosmowski diff --git a/src/css.js b/src/css.js index a7f61bb1e..6c20b32df 100644 --- a/src/css.js +++ b/src/css.js @@ -340,7 +340,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 ); }) : -- 2.39.5