aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-10-22 02:39:06 -0400
committerjeresig <jeresig@gmail.com>2010-10-22 02:39:06 -0400
commit53396b879bd29c090824da182e3cf69158829f82 (patch)
treea273c7b167f177b3ba63c0934a16ce80bf5628c7 /src/css.js
parent7e02cee5ff8b5e9117366d7b43af7b5794f0f258 (diff)
downloadjquery-53396b879bd29c090824da182e3cf69158829f82.tar.gz
jquery-53396b879bd29c090824da182e3cf69158829f82.zip
Make sure that .width()/.height() don't return NaN also standardize on returning instead of auto for default values (which is what we do elsewhere in .css() as well). Fixes #7225.
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/css.js b/src/css.js
index 88c4ffa05..30cecf39d 100644
--- a/src/css.js
+++ b/src/css.js
@@ -169,15 +169,11 @@ jQuery.each(["height", "width"], function( i, name ) {
});
}
- if ( val < 0 ) {
- return elem.style[ name ] || "0px";
- }
-
- if ( val === 0 ) {
+ if ( val <= 0 ) {
val = curCSS( elem, name, name );
if ( val != null ) {
- return val;
+ return val === "auto" ? "" : val;
}
}