Skip to content

Commit

Permalink
Need to also handle the case where 'auto' is being returned, as in Fi…
Browse files Browse the repository at this point in the history
…refox. Follow-up to #7395.
  • Loading branch information
jeresig committed Nov 10, 2010
1 parent 3394d32 commit efaf375
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/css.js
Expand Up @@ -179,7 +179,7 @@ jQuery.each(["height", "width"], function( i, name ) {
if ( val != null ) { if ( val != null ) {
// Should return "auto" instead of 0, use 0 for // Should return "auto" instead of 0, use 0 for
// temporary backwards-compat // temporary backwards-compat
return val === "" ? "0px" : val; return val === "" || val === "auto" ? "0px" : val;
} }
} }


Expand All @@ -188,7 +188,7 @@ jQuery.each(["height", "width"], function( i, name ) {


// Should return "auto" instead of 0, use 0 for // Should return "auto" instead of 0, use 0 for
// temporary backwards-compat // temporary backwards-compat
return val === "" ? "0px" : val; return val === "" || val === "auto" ? "0px" : val;
} }


return typeof val === "string" ? val : val + "px"; return typeof val === "string" ? val : val + "px";
Expand Down

0 comments on commit efaf375

Please sign in to comment.