mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Dimensions: Reverse a check to avoid potential reflows
Fixes #14979
Closes gh-1560
(cherry picked from commit 1ca84214cc
)
Conflicts:
AUTHORS.txt
This commit is contained in:
parent
f873d06543
commit
90c50ef961
@ -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>
|
||||
|
||||
|
@ -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 );
|
||||
}) :
|
||||
|
Loading…
Reference in New Issue
Block a user