diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2017-08-07 12:26:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 12:26:03 -0400 |
commit | 3cf1d14ccc63b8054ee977e90c72c5da07c80e59 (patch) | |
tree | 308b3123896e6dab080541016aba7c8897da2fa7 /src/css.js | |
parent | f3c5776b826169de26ff58e6616b99427d5b8db0 (diff) | |
download | jquery-3cf1d14ccc63b8054ee977e90c72c5da07c80e59.tar.gz jquery-3cf1d14ccc63b8054ee977e90c72c5da07c80e59.zip |
Dimensions: Don't trust non-pixel computed width/height
Fixes gh-3611
Closes gh-3741
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/css.js b/src/css.js index 2395f42b4..107d85a93 100644 --- a/src/css.js +++ b/src/css.js @@ -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 |