git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that accessing computed CSS for elements returns 'auto' instead of '' consi...
[jquery.git]
/
src
/
css.js
diff --git
a/src/css.js
b/src/css.js
index
30cecf3
..
0998657
100644
(file)
--- a/
src/css.js
+++ b/
src/css.js
@@
-173,12
+173,13
@@
jQuery.each(["height", "width"], function( i, name ) {
val = curCSS( elem, name, name );
if ( val != null ) {
val = curCSS( elem, name, name );
if ( val != null ) {
- return val === "auto" ? "" : val;
+ return val;
}
}
if ( val < 0 || val == null ) {
}
}
if ( val < 0 || val == null ) {
- return elem.style[ name ];
+ val = elem.style[ name ];
+ return val === "" ? "auto" : val;
}
return typeof val === "string" ? val : val + "px";
}
return typeof val === "string" ? val : val + "px";
@@
-247,7
+248,7
@@
if ( getComputedStyle ) {
}
}
}
}
- return ret;
+ return ret === "" ? "auto" : ret;
};
} else if ( document.documentElement.currentStyle ) {
};
} else if ( document.documentElement.currentStyle ) {
@@
-274,7
+275,7
@@
if ( getComputedStyle ) {
elem.runtimeStyle.left = rsLeft;
}
elem.runtimeStyle.left = rsLeft;
}
- return ret;
+ return ret === "" ? "auto" : ret;
};
}
};
}