X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcss.js;h=2eeef6cc9d90cd03f980311f8f60ce1475c31f89;hb=735a949a0649f0299e8e4d87b259290970a68ddf;hp=d6b48813976655040e0ffb6c30f09373b75ecfb0;hpb=c3c507e900fceb419628157504004ab2813b7d01;p=jquery.git diff --git a/src/css.js b/src/css.js index d6b4881..2eeef6c 100644 --- a/src/css.js +++ b/src/css.js @@ -248,14 +248,17 @@ jQuery(function() { get: function( elem, computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block - var ret = "0px", - display = elem.style.display; - elem.style.display = "inline-block"; - ret = getComputedStyle( elem, "margin-right", "margin-right" ); - elem.style.display = display; + var ret; + jQuery.swap( elem, { "display": "inline-block" }, function() { + if ( computed ) { + ret = curCSS( elem, "margin-right", "marginRight" ); + } else { + ret = elem.style.marginRight; + } + }); return ret; } - } + }; } });