mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Dimensions: Don't trust non-pixel computed width/height
Fixes gh-3611 Closes gh-3741
This commit is contained in:
@@ -153,9 +153,13 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
||||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
valueIsBorderBox = isBorderBox;
|
||||
|
||||
// Computed unit is not pixels. Stop here and return.
|
||||
// Support: Firefox <=54
|
||||
// Return a confounding non-pixel value or feign ignorance, as appropriate.
|
||||
if ( rnumnonpx.test( val ) ) {
|
||||
return val;
|
||||
if ( !extra ) {
|
||||
return val;
|
||||
}
|
||||
val = "auto";
|
||||
}
|
||||
|
||||
// Check for style in case a browser which returns unreliable values
|
||||
|
||||
Reference in New Issue
Block a user