aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-01-17 15:50:20 -0500
committerjeresig <jeresig@gmail.com>2011-01-17 15:50:20 -0500
commitf01ef93aab1d2e90efbcacc71b01180f7f33656b (patch)
tree560bfa849f4c55ecf066a7d283ca95eac39388b5 /src
parent987c44bee48557f693a59bc7ecc1bbe1718c428c (diff)
parent9bd9d270f69582b119b1835da4419a900f975b6b (diff)
downloadjquery-f01ef93aab1d2e90efbcacc71b01180f7f33656b.tar.gz
jquery-f01ef93aab1d2e90efbcacc71b01180f7f33656b.zip
Merge branch '7608' of https://github.com/rwldrn/jquery into rwldrn-7608
Diffstat (limited to 'src')
-rw-r--r--src/css.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/css.js b/src/css.js
index 8a83c6072..19c6342d2 100644
--- a/src/css.js
+++ b/src/css.js
@@ -263,8 +263,9 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
- var left, rsLeft,
+ var left,
ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style;
// From the awesome hack by Dean Edwards
@@ -275,16 +276,19 @@ if ( document.documentElement.currentStyle ) {
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
left = style.left;
- rsLeft = elem.runtimeStyle.left;
// Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
style.left = name === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
- elem.runtimeStyle.left = rsLeft;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
}
return ret === "" ? "auto" : ret;