]> source.dussan.org Git - jquery.git/commitdiff
CSS: Fix the pixelMarginRight support test in Android 2.3
authorMichał Gołębiowski <m.goleb@gmail.com>
Thu, 5 Feb 2015 00:41:10 +0000 (01:41 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Thu, 5 Feb 2015 00:41:10 +0000 (01:41 +0100)
src/css/curCSS.js
src/css/support.js

index f5c85ecc09cc83f603b4950cee231e40f0428626..aba57ad37eb10a9c6814133bd401049c9402c9e8 100644 (file)
@@ -25,12 +25,6 @@ function curCSS( elem, name, computed ) {
                        ret = jQuery.style( elem, name );
                }
 
-               // Support: Android 4.0-4.3
-               // A tribute to the "awesome hack by Dean Edwards"
-               // Android Browser returns percentage for some values,
-               // but width seems to be reliably pixels.
-               // This is against the CSSOM draft spec:
-               // http://dev.w3.org/csswg/cssom/#resolved-values
                if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
 
                        // Remember the original values
index 3165af87d3c225633116ad256247d8fb4abb846e..b26cc568e76a15747f5da251681c70a33aa6877c 100644 (file)
@@ -62,8 +62,15 @@ define([
                                return boxSizingReliableVal;
                        },
                        pixelMarginRight: function() {
+                               // Support: Android 4.0-4.3
+                               // A tribute to the "awesome hack by Dean Edwards"
+                               // Android Browser returns percentage for some values,
+                               // but width seems to be reliably pixels.
+                               // This is against the CSSOM draft spec:
+                               // http://dev.w3.org/csswg/cssom/#resolved-values
                                if ( pixelMarginRightVal == null ) {
-                                       div.style.cssText = "display:block;width:50%;margin-right:50%";
+                                       div.style.cssText = "display:block;width:50%;border:0;margin:0;padding:0;" +
+                                               "margin-right:50%";
                                        documentElement.appendChild( container );
                                        pixelMarginRightVal =
                                                window.getComputedStyle( div, null ).marginRight === "4px";