From: jeresig Date: Wed, 10 Nov 2010 04:33:18 +0000 (-0500) Subject: Need to also handle the case where 'auto' is being returned, as in Firefox. Follow... X-Git-Tag: 1.4.4rc3~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=efaf375e56920c9699c3d4ef09fb9171352aa8bb;p=jquery.git Need to also handle the case where 'auto' is being returned, as in Firefox. Follow-up to #7395. --- diff --git a/src/css.js b/src/css.js index 369485e47..8a83c6072 100644 --- a/src/css.js +++ b/src/css.js @@ -179,7 +179,7 @@ jQuery.each(["height", "width"], function( i, name ) { if ( val != null ) { // Should return "auto" instead of 0, use 0 for // temporary backwards-compat - return val === "" ? "0px" : val; + return val === "" || val === "auto" ? "0px" : val; } } @@ -188,7 +188,7 @@ jQuery.each(["height", "width"], function( i, name ) { // Should return "auto" instead of 0, use 0 for // temporary backwards-compat - return val === "" ? "0px" : val; + return val === "" || val === "auto" ? "0px" : val; } return typeof val === "string" ? val : val + "px";