X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcss.js;h=2eeef6cc9d90cd03f980311f8f60ce1475c31f89;hb=735a949a0649f0299e8e4d87b259290970a68ddf;hp=8a982312f17a0c70263af45323c7028494c8b1c7;hpb=6b08d88d04f4a41849753999e6e18126895086d0;p=jquery.git diff --git a/src/css.js b/src/css.js index 8a98231..2eeef6c 100644 --- a/src/css.js +++ b/src/css.js @@ -240,6 +240,28 @@ if ( !jQuery.support.opacity ) { }; } +jQuery(function() { + // This hook cannot be added until DOM ready because the support test + // for it is not run until after DOM ready + if ( !jQuery.support.reliableMarginRight ) { + jQuery.cssHooks.marginRight = { + 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; + jQuery.swap( elem, { "display": "inline-block" }, function() { + if ( computed ) { + ret = curCSS( elem, "margin-right", "marginRight" ); + } else { + ret = elem.style.marginRight; + } + }); + return ret; + } + }; + } +}); + if ( document.defaultView && document.defaultView.getComputedStyle ) { getComputedStyle = function( elem, newName, name ) { var ret, defaultView, computedStyle;